Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Labeled.prototype.indexOf = function (stream) {
if (typeof stream === 'string') {
for (var i = 0; i < this._streams.length; i++) {
if (this._streams[i].label === stream) return i;
}
return -1;
}
else {
return Splicer.prototype.indexOf.call(this, stream);
}
};
Labeled.prototype.splice = function (key) {
var ix;
if (typeof key === 'string') {
ix = this.indexOf(key);
}
else ix = key;
var args = [ ix ].concat([].slice.call(arguments, 1));
return Splicer.prototype.splice.apply(this, args);
};
Labeled.prototype.get = function (key) {
if (typeof key === 'string') {
var ix = this.indexOf(key);
if (ix < 0) return undefined;
return this._streams[ix];
}
else return Splicer.prototype.get.call(this, key);
};