iocat
Version:
WebSocket netcat with Socket.io support
38 lines (29 loc) • 1.39 kB
JavaScript
// Generated by CoffeeScript 1.10.0
(function() {
var Base, EventEmitter,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
slice = [].slice;
EventEmitter = require('events').EventEmitter;
Base = (function(superClass) {
extend(Base, superClass);
function Base() {
this.log = bind(this.log, this);
return Base.__super__.constructor.apply(this, arguments);
}
Base.prototype.log = function() {
var args, name, ref, ref1;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (!this.options.verbose) {
return false;
}
name = (typeof this !== "undefined" && this !== null ? (ref = this.constructor) != null ? typeof ref.toString === "function" ? (ref1 = ref.toString().match(/function\s*(\w+)/)) != null ? ref1[1] : void 0 : void 0 : void 0 : void 0) || 'ApiBase';
return console.log.apply(console, [name + ">"].concat(slice.call(args)));
};
return Base;
})(EventEmitter);
module.exports = {
Base: Base
};
}).call(this);