MCPcopy
hub / github.com/webpack/webpack / dequeue

Method dequeue

lib/util/TupleQueue.js:56–71  ·  view source on GitHub ↗

* Removes and returns the next queued tuple, rebuilding the iterator when * the underlying tuple set has changed since the last full pass. * @returns {[T, V, ...EXPECTED_ANY] | undefined} The head of the queue of `undefined` if this queue is empty.

()

Source from the content-addressed store, hash-verified

54 * @returns {[T, V, ...EXPECTED_ANY] | undefined} The head of the queue of `undefined` if this queue is empty.
55 */
56 dequeue() {
57 const result = this._iterator.next();
58 if (result.done) {
59 if (this._set.size > 0) {
60 this._iterator = this._set[Symbol.iterator]();
61 const value =
62 /** @type {[T, V, ...EXPECTED_ANY]} */
63 (this._iterator.next().value);
64 this._set.delete(...value);
65 return value;
66 }
67 return;
68 }
69 this._set.delete(.../** @type {[T, V, ...EXPECTED_ANY]} */ (result.value));
70 return result.value;
71 }
72}
73
74module.exports = TupleQueue;

Callers

nothing calls this directly

Calls 2

nextMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected