MCPcopy Index your code
hub / github.com/immutable-js/immutable-js / __iterator

Method __iterator

src/Operations.js:176–199  ·  view source on GitHub ↗
(type, reverse)

Source from the content-addressed store, hash-verified

174 }
175
176 __iterator(type, reverse) {
177 const iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
178 return new Iterator(() => {
179 while (true) {
180 const step = iterator.next();
181 if (step.done) {
182 return step;
183 }
184 const entry = step.value;
185 // Check if entry exists first so array access doesn't throw for holes
186 // in the parent iteration.
187 if (entry) {
188 validateEntry(entry);
189 const indexedCollection = isCollection(entry);
190 return iteratorValue(
191 type,
192 indexedCollection ? entry.get(0) : entry[0],
193 indexedCollection ? entry.get(1) : entry[1],
194 step
195 );
196 }
197 }
198 });
199 }
200}
201
202ToIndexedSequence.prototype.cacheResult =

Callers

nothing calls this directly

Calls 6

isCollectionFunction · 0.90
iteratorValueFunction · 0.90
validateEntryFunction · 0.85
nextMethod · 0.80
getMethod · 0.65
__iteratorMethod · 0.45

Tested by

no test coverage detected