MCPcopy
hub / github.com/webpack/webpack / _appendIterators

Method _appendIterators

lib/util/LazyBucketSortedSet.js:253–270  ·  view source on GitHub ↗

* Appends iterators for every stored bucket and leaf to support unordered * traversal across the entire structure. * @param {Iterator<T>[]} iterators list of iterators to append to * @returns {void}

(iterators)

Source from the content-addressed store, hash-verified

251 * @returns {void}
252 */
253 _appendIterators(iterators) {
254 if (this._unsortedItems.size > 0) {
255 iterators.push(this._unsortedItems[Symbol.iterator]());
256 }
257 for (const key of this._keys) {
258 const entry = this._map.get(key);
259 if (this._leaf) {
260 const leafEntry = /** @type {SortableSet<T>} */ (entry);
261 const iterator = leafEntry[Symbol.iterator]();
262 iterators.push(iterator);
263 } else {
264 const nodeEntry =
265 /** @type {LazyBucketSortedSet<T, K>} */
266 (entry);
267 nodeEntry._appendIterators(iterators);
268 }
269 }
270 }
271
272 /**
273 * Iterates over all stored items without imposing bucket sort order.

Callers 1

[Symbol.iterator]Method · 0.95

Calls 2

pushMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected