Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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));
}