MCPcopy
hub / github.com/webpack/webpack / [Symbol.iterator]

Method [Symbol.iterator]

lib/util/LazyBucketSortedSet.js:276–295  ·  view source on GitHub ↗

* Iterates over all stored items without imposing bucket sort order. * @returns {Iterator<T>} the iterator

()

Source from the content-addressed store, hash-verified

274 * @returns {Iterator<T>} the iterator
275 */
276 [Symbol.iterator]() {
277 /** @type {Iterator<T>[]} */
278 const iterators = [];
279 this._appendIterators(iterators);
280 iterators.reverse();
281 let currentIterator =
282 /** @type {Iterator<T>} */
283 (iterators.pop());
284 return {
285 next: () => {
286 const res = currentIterator.next();
287 if (res.done) {
288 if (iterators.length === 0) return res;
289 currentIterator = /** @type {Iterator<T>} */ (iterators.pop());
290 return currentIterator.next();
291 }
292 return res;
293 }
294 };
295 }
296}
297
298module.exports = LazyBucketSortedSet;

Callers

nothing calls this directly

Calls 3

_appendIteratorsMethod · 0.95
popMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected