Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (options.headers && typeof options.headers !== 'object') {
throw new TypeError('options `headers` must be an object');
}
//
this.files = [];
this.method = options.method || 'POST';
this.name = options.name || 'file';
this.url = options.url || null;
this.headers = options.headers || {};
// EE3
EE3.call(this);
// error listener
this.on('error', this._onError.bind(this));
// check support
this._checkSupport();
// attach to $el
this._attach();
}
util.inherits(Uploader, EE3);
function RiskyStream(stream) {
EventEmitter.call(this)
this.endListener = function() {
this.ended = true
this.stream.removeListener('end', this.endListener)
if (!this.expectingEnd) {
this.emit('unexpectedEnd')
}
this.emit('end')
}.bind(this)
this.stream = stream
.on('end', this.endListener)
this.expectingEnd = false
this.ended = false
function TouchConsumer(config) {
EventEmitter.call(this)
this.actionQueue = []
this.runningState = TouchConsumer.STATE_STOPPED
this.desiredState = new StateQueue()
this.output = null
this.socket = null
this.banner = null
this.touchConfig = config
this.starter = Promise.resolve(true)
this.failCounter = new FailCounter(3, 10000)
this.failCounter.on('exceedLimit', this._failLimitExceeded.bind(this))
this.failed = false
this.readableListener = this._readableListener.bind(this)
this.writeQueue = []
}
export var OrderBook = function(productID: string, websocketURI: string, restURI: string, timeProvider: Utils.ITimeProvider) {
var self = this;
EventEmitter.call(self);
self.productID = productID || 'BTC-USD';
self.websocketURI = websocketURI || 'wss://ws-feed.exchange.coinbase.com';
self.restURI = restURI;
self.state = self.STATES.closed;
self.fail_count = 0;
self.timeProvider = timeProvider;
self.connect();
};
constructor() {
super();
EventEmitter.call(this);
}
}
function ProxyServer(options) {
EE3.call(this);
this.web = createRightProxy('web')(options);
this.ws = createRightProxy('ws')(options);
this.options = options;
this.webPasses = Object.keys(web).map(function(pass) {
return web[pass];
});
this.wsPasses = Object.keys(ws).map(function(pass) {
return ws[pass];
});
}
function Router() {
if (!(this instanceof Router)) {
return new Router()
}
EventEmitter.call(this)
}