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

Function getIterator

test/fixtures/snapshot/typescript.js:350–360  ·  view source on GitHub ↗
(iterable)

Source from the content-addressed store, hash-verified

348var ts;
349(function (ts) {
350 function getIterator(iterable) {
351 if (iterable) {
352 if (isArray(iterable))
353 return arrayIterator(iterable);
354 if (iterable instanceof ts.Map)
355 return iterable.entries();
356 if (iterable instanceof ts.Set)
357 return iterable.values();
358 throw new Error("Iteration not supported.");
359 }
360 }
361 ts.getIterator = getIterator;
362 ts.emptyArray = [];
363 ts.emptyMap = new ts.Map();

Callers 3

MapFunction · 0.85
SetFunction · 0.85
flatMapIteratorFunction · 0.85

Calls 4

arrayIteratorFunction · 0.85
isArrayFunction · 0.70
entriesMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…