| Server IP : 162.19.112.25 / Your IP : 216.73.217.36 Web Server : LiteSpeed System : Linux qamar.tasjeel.ae 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64 User : archiart ( 1428) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/readable-stream/lib/stream/ |
Upload File : |
'use strict'
const { ArrayPrototypePop, Promise } = require('../ours/primordials')
const { isIterable, isNodeStream } = require('../internal/streams/utils')
const { pipelineImpl: pl } = require('../internal/streams/pipeline')
const { finished } = require('../internal/streams/end-of-stream')
function pipeline(...streams) {
return new Promise((resolve, reject) => {
let signal
let end
const lastArg = streams[streams.length - 1]
if (lastArg && typeof lastArg === 'object' && !isNodeStream(lastArg) && !isIterable(lastArg)) {
const options = ArrayPrototypePop(streams)
signal = options.signal
end = options.end
}
pl(
streams,
(err, value) => {
if (err) {
reject(err)
} else {
resolve(value)
}
},
{
signal,
end
}
)
})
}
module.exports = {
finished,
pipeline
}