MCPcopy Index your code
hub / github.com/TanStack/db / delete

Method delete

packages/db/src/SortedMap.ts:125–134  ·  view source on GitHub ↗

* Removes a key-value pair from the map * * @param key - The key to remove * @returns True if the key was found and removed, false otherwise

(key: TKey)

Source from the content-addressed store, hash-verified

123 * @returns True if the key was found and removed, false otherwise
124 */
125 delete(key: TKey): boolean {
126 if (this.map.has(key)) {
127 const oldValue = this.map.get(key)
128 const index = this.indexOf(key, oldValue!)
129 this.sortedKeys.splice(index, 1)
130 return this.map.delete(key)
131 }
132
133 return false
134 }
135
136 /**
137 * Checks if a key exists in the map

Callers

nothing calls this directly

Calls 3

indexOfMethod · 0.95
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected