How to use the stream-splicer.prototype function in stream-splicer

To help you get started, we’ve selected a few stream-splicer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudflare / ipfs-ext / node_modules / labeled-stream-splicer / index.js View on Github external
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);
    }
};
github cloudflare / ipfs-ext / node_modules / labeled-stream-splicer / index.js View on Github external
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);
};
github cloudflare / ipfs-ext / node_modules / labeled-stream-splicer / index.js View on Github external
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);
};

stream-splicer

streaming pipeline with a mutable configuration

MIT
Latest version published 6 years ago

Package Health Score

68 / 100
Full package analysis