mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-18 18:26:24 -07:00
chore: add yarn command to put compiled stylesheets into builds folder
This commit is contained in:
parent
7ae453a61c
commit
6e46b46074
6788 changed files with 697992 additions and 12 deletions
39
node_modules/@sindresorhus/merge-streams/index.js
generated
vendored
Normal file
39
node_modules/@sindresorhus/merge-streams/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import {PassThrough as PassThroughStream} from 'node:stream';
|
||||
|
||||
export default function mergeStreams(streams) {
|
||||
if (!Array.isArray(streams)) {
|
||||
throw new TypeError(`Expected an array, got \`${typeof streams}\`.`);
|
||||
}
|
||||
|
||||
const passThroughStream = new PassThroughStream({objectMode: true});
|
||||
passThroughStream.setMaxListeners(Number.POSITIVE_INFINITY);
|
||||
|
||||
if (streams.length === 0) {
|
||||
passThroughStream.end();
|
||||
return passThroughStream;
|
||||
}
|
||||
|
||||
let activeStreams = streams.length;
|
||||
|
||||
for (const stream of streams) {
|
||||
if (!(typeof stream?.pipe === 'function')) {
|
||||
throw new TypeError(`Expected a stream, got: \`${typeof stream}\`.`);
|
||||
}
|
||||
|
||||
stream.pipe(passThroughStream, {end: false});
|
||||
|
||||
stream.on('end', () => {
|
||||
activeStreams--;
|
||||
|
||||
if (activeStreams === 0) {
|
||||
passThroughStream.end();
|
||||
}
|
||||
});
|
||||
|
||||
stream.on('error', error => {
|
||||
passThroughStream.emit('error', error);
|
||||
});
|
||||
}
|
||||
|
||||
return passThroughStream;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue