MCPcopy Create free account
hub / github.com/immutable-js/immutable-js / __iteratorUncached

Method __iteratorUncached

src/Seq.js:271–285  ·  view source on GitHub ↗
(type, reverse)

Source from the content-addressed store, hash-verified

269 }
270
271 __iteratorUncached(type, reverse) {
272 if (reverse) {
273 return this.cacheResult().__iterator(type, reverse);
274 }
275 const collection = this._collection;
276 const iterator = getIterator(collection);
277 if (!isIterator(iterator)) {
278 return new Iterator(iteratorDone);
279 }
280 let iterations = 0;
281 return new Iterator(() => {
282 const step = iterator.next();
283 return step.done ? step : iteratorValue(type, iterations++, step.value);
284 });
285 }
286}
287
288// # pragma Helper functions

Callers 1

__iteratorMethod · 0.45

Calls 6

getIteratorFunction · 0.90
isIteratorFunction · 0.90
iteratorValueFunction · 0.90
nextMethod · 0.80
cacheResultMethod · 0.65
__iteratorMethod · 0.45

Tested by

no test coverage detected