MCPcopy Index your code
hub / github.com/nodejs/node / from

Function from

lib/internal/streams/iter/share.js:712–726  ·  view source on GitHub ↗
(input, options)

Source from the content-addressed store, hash-verified

710const Share = {
711 __proto__: null,
712 from(input, options) {
713 if (isShareable(input)) {
714 const result = input[shareProtocol](options);
715 if (result === null || typeof result !== 'object') {
716 throw new ERR_INVALID_RETURN_VALUE(
717 'an object', '[Symbol.for(\'Stream.shareProtocol\')]', result);
718 }
719 return result;
720 }
721 if (isAsyncIterable(input) || isSyncIterable(input)) {
722 return share(input, options);
723 }
724 throw new ERR_INVALID_ARG_TYPE(
725 'input', ['Shareable', 'AsyncIterable', 'Iterable'], input);
726 },
727};
728
729const SyncShare = {

Callers 1

shareFunction · 0.70

Calls 4

isShareableFunction · 0.85
shareFunction · 0.85
isAsyncIterableFunction · 0.70
isSyncIterableFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…