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

Function isIterable

lib/internal/streams/utils.js:112–118  ·  view source on GitHub ↗
(obj, isAsync)

Source from the content-addressed store, hash-verified

110}
111
112function isIterable(obj, isAsync) {
113 if (obj == null) return false;
114 if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function';
115 if (isAsync === false) return typeof obj[SymbolIterator] === 'function';
116 return typeof obj[SymbolAsyncIterator] === 'function' ||
117 typeof obj[SymbolIterator] === 'function';
118}
119
120function isDestroyed(stream) {
121 if (!isNodeStream(stream)) return null;

Callers 5

makeAsyncIterableFunction · 0.70
pipelineImplFunction · 0.70
duplexify.jsFile · 0.70
isCustomIterableFunction · 0.50
pipelineFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…