MCPcopy
hub / github.com/webpack/webpack / delete

Method delete

lib/util/LazyBucketSortedSet.js:119–131  ·  view source on GitHub ↗

* Removes an item from either the unsorted staging area or its resolved * bucket and prunes empty buckets as needed. * @param {T} item an item * @returns {void}

(item)

Source from the content-addressed store, hash-verified

117 * @returns {void}
118 */
119 delete(item) {
120 this.size--;
121 if (this._unsortedItems.has(item)) {
122 this._unsortedItems.delete(item);
123 return;
124 }
125 const key = this._getKey(item);
126 const entry = /** @type {Entry<T, K>} */ (this._map.get(key));
127 entry.delete(item);
128 if (entry.size === 0) {
129 this._deleteKey(key);
130 }
131 }
132
133 /**
134 * Removes an empty bucket key and its corresponding nested entry.

Callers 4

applyMethod · 0.95
_deleteKeyMethod · 0.45
popFirstMethod · 0.45
startUpdateMethod · 0.45

Calls 3

_deleteKeyMethod · 0.95
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected