REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.54 KB
Close
//opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/readable-stream/lib/internal/streams/from.js
Text
Base64
'use strict' /* replacement start */ const process = require('process/') /* replacement end */ const { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials') const { Buffer } = require('buffer') const { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes function from(Readable, iterable, opts) { let iterator if (typeof iterable === 'string' || iterable instanceof Buffer) { return new Readable({ objectMode: true, ...opts, read() { this.push(iterable) this.push(null) } }) } let isAsync if (iterable && iterable[SymbolAsyncIterator]) { isAsync = true iterator = iterable[SymbolAsyncIterator]() } else if (iterable && iterable[SymbolIterator]) { isAsync = false iterator = iterable[SymbolIterator]() } else { throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable) } const readable = new Readable({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? ...opts }) // Flag to protect against _read // being called before last iteration completion. let reading = false readable._read = function () { if (!reading) { reading = true next() } } readable._destroy = function (error, cb) { PromisePrototypeThen( close(error), () => process.nextTick(cb, error), // nextTick is here in case cb throws (e) => process.nextTick(cb, e || error) ) } async function close(error) { const hadError = error !== undefined && error !== null const hasThrow = typeof iterator.throw === 'function' if (hadError && hasThrow) { const { value, done } = await iterator.throw(error) await value if (done) { return } } if (typeof iterator.return === 'function') { const { value } = await iterator.return() await value } } async function next() { for (;;) { try { const { value, done } = isAsync ? await iterator.next() : iterator.next() if (done) { readable.push(null) } else { const res = value && typeof value.then === 'function' ? await value : value if (res === null) { reading = false throw new ERR_STREAM_NULL_VALUES() } else if (readable.push(res)) { continue } else { reading = false } } } catch (err) { readable.destroy(err) } break } } return readable } module.exports = from
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 18
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
add-abort-signal.js
1.32 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
buffer_list.js
3.77 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
compose.js
3.31 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
destroy.js
6.61 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
duplex.js
4.73 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
duplexify.js
8.89 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
end-of-stream.js
6.70 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
from.js
2.54 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lazy_transform.js
1.54 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
legacy.js
2.83 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
operators.js
11.57 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
passthrough.js
1.71 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pipeline.js
10.23 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readable.js
39.85 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
state.js
901 B
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transform.js
6.93 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
9.81 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
writable.js
25.31 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).