Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Store = function (dispatcher) {
this.dispatcher = dispatcher;
// Check if store exists when waiting for it
this.waitFor = function (stores, cb) {
stores = Array.isArray(stores) ? stores : [stores];
if (!flux.isStoresRegistered(stores)) {
throw new Error('Waiting for stores that are not injected into Angular yet, ' + stores.join(', ') + '. Be sure to inject stores before waiting for them');
}
this.dispatcher.waitFor(stores, cb.bind(this));
};
// Call the constructor of EventEmitter2
EventEmitter2.call(this, {
wildcard: true
});
if (typeof maxListeners === 'number') {
this.setMaxListeners(maxListeners);
} else if (maxListeners && typeof maxListeners[name] === 'number') {
this.setMaxListeners(maxListeners[name]);
}
if (this.initialize) {
this.initialize();
}
};
function Children(workerPath, options) {
if (!(this instanceof Children)) {
return new Children(workerPath, options);
}
EventEmitter2.call(this, {
wildcard: false
});
this.options = _.defaults(options || {}, Children.defaults);
this.options.workerPath = workerPath;
if (!this.options.resetEnv) {
this.options.spawn_options.env = process.env;
}
// Children array
this.childs = [];
this._shuttingDown = false;
if (this.options.autoRestart) {
this.on('killed:child', this._autorespawn.bind(this));
function Document (documentFile) {
this._file = null;
this._path = null;
this._config = null;
this._content = null;
this._plugins = [];
this._debug = 0;
if (documentFile) {
this.file(documentFile);
}
// Make class an event emitter
EventEmitter.call(this);
this.setMaxListeners(100);
}
function BitMEXClient(options) {
const emitter = this;
// We inherit from EventEmitter2, which supports wildcards.
EventEmitter.call(emitter, {
wildcard: true,
delimiter: ':',
maxListeners: Infinity,
newListener: true,
});
if (!options) options = {};
this._data = {}; // internal data store keyed by [tableName][symbol]. Used by deltaParser.
this._keys = {}; // keys store - populated by images on connect
this._maxTableLen = typeof options.maxTableLen === 'number' ? options.maxTableLen : DEFAULT_MAX_TABLE_LEN;
if (!options.endpoint) {
options.endpoint = options.testnet ? endpoints.testnet : endpoints.production;
}
if (process.env.BITMEX_ENDPOINT) options.endpoint = process.env.BITMEX_ENDPOINT;
debug(options)
this._setupListenerTracking();
function WorkingTree(store, branch) {
EventEmitter.call(this, {
wildcard: true
});
this.store = store;
this.currentBranch = branch;
_.bindAll(this);
}
util.inherits(WorkingTree, EventEmitter);
_$jscoverage['nssocket.js'][39]++;
return new NsSocket(options, socket);
}
_$jscoverage['nssocket.js'][42]++;
if (! options) {
_$jscoverage['nssocket.js'][43]++;
options = socket || {};
}
_$jscoverage['nssocket.js'][46]++;
this.connected = false;
_$jscoverage['nssocket.js'][47]++;
this.type = options.type || "tcp4";
_$jscoverage['nssocket.js'][48]++;
this.retry = options.reconnect? {retries: 0, max: options.maxRetries || 10, wait: options.retryInterval || 5000, timeoutId: undefined}: false;
_$jscoverage['nssocket.js'][55]++;
EventEmitter2.call(this, {delimiter: options.delimiter || "::", wildcard: true, maxListeners: options.maxListeners || 10});
_$jscoverage['nssocket.js'][61]++;
if (socket) {
_$jscoverage['nssocket.js'][62]++;
this.stream = socket;
_$jscoverage['nssocket.js'][63]++;
this.socket = this.stream instanceof net.Socket? this.stream: this.stream.socket;
_$jscoverage['nssocket.js'][64]++;
this.connected = this.socket.writable && this.socket.readable || false;
_$jscoverage['nssocket.js'][65]++;
configureEvents(this);
}
}
_$jscoverage['nssocket.js'][69]++;
var Thresher = function(scraperBox) {
this.scraperBox = scraperBox;
EventEmitter2.call(this, {
wildcard: true,
maxListeners: 0
});
}
function Grunt (env) {
this.env = env;
this.events = this;
this.tasks = [];
this.option = expander.interface(this.env.argv);
EventEmitter2.call(this, {wildcard:true});
bindMany(['loadTasks', 'loadNpmTasks'], this);
legacy(this);
}
util.inherits(Grunt, EventEmitter2);
function BlizzardNamespace(session, ns) {
this.session = session;
this.ns = ns;
EventEmitter2.call(this, {
wildcard: true
});
this.rpcListener = null;
this.sessionRequestEvent = null;
this.sessionRequestListener = null;
this.bound = false;
this.bind();
}