MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / next

Method next

src/back/util/map.ts:295–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 let idx: number;
294 let data: V[];
295 const next = (): IteratorResult<V> => {
296 if (!data) {
297 // lazy till first invocation
298 data = [];
299 idx = 0;
300 this._forEach(node, value => data.push(value));
301 }
302 if (idx >= data.length) {
303 return { done: true, value: undefined };
304 }
305
306 if (!res) {
307 res = { done: false, value: data[idx++] };
308 } else {
309 res.value = data[idx++];
310 }
311 return res;
312 };
313 return { next };
314 }
315

Callers

nothing calls this directly

Calls 2

_forEachMethod · 0.95
pushMethod · 0.65

Tested by

no test coverage detected