MCPcopy
hub / github.com/vercel/next.js / remove

Method remove

packages/next/src/server/lib/lru-cache.ts:215–222  ·  view source on GitHub ↗

* Removes a specific key from the cache. * Updates both the hash map and doubly-linked list. * * Note: This is an explicit removal and does NOT trigger the `onEvict` * callback. Use this for intentional deletions where eviction tracking * is not needed. * * Time Complexity: O(1)

(key: string)

Source from the content-addressed store, hash-verified

213 * Time Complexity: O(1)
214 */
215 public remove(key: string): void {
216 const node = this.cache.get(key)
217 if (!node) return
218
219 this.removeNode(node)
220 this.cache.delete(key)
221 this.totalSize -= node.size
222 }
223
224 /**
225 * Returns the number of items in the cache.

Callers 15

transformerFunction · 0.45
transformerFunction · 0.45
transformerFunction · 0.45
transformerFunction · 0.45
transformerFunction · 0.45
removeRuntimeConfigFunction · 0.45
withPromiseCacheFunction · 0.45
DevOverlayRootFunction · 0.45
useDragFunction · 0.45
handleThemeChangeFunction · 0.45
setIsrStatusMethod · 0.45

Calls 3

removeNodeMethod · 0.95
getMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected