How to use the stream-splicer.call 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
function Labeled (streams, opts) {
    if (!(this instanceof Labeled)) return new Labeled(streams, opts);
    Splicer.call(this, [], opts);
    
    var reps = [];
    for (var i = 0; i < streams.length; i++) {
        var s = streams[i];
        if (typeof s === 'string') continue;
        if (Array.isArray(s)) {
            s = new Labeled(s, opts);
        }
        if (i >= 0 && typeof streams[i-1] === 'string') {
            s.label = streams[i-1];
        }
        reps.push(s);
    }
    if (typeof streams[i-1] === 'string') {
        reps.push(new Labeled([], opts));
    }

stream-splicer

streaming pipeline with a mutable configuration

MIT
Latest version published 5 years ago

Package Health Score

68 / 100
Full package analysis