MCPcopy
hub / github.com/github/hotkey / delete

Method delete

src/radix-trie.ts:9–17  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

7 }
8
9 delete(value: T): boolean {
10 const index = this.children.indexOf(value)
11 if (index === -1) return false
12 this.children = this.children.slice(0, index).concat(this.children.slice(index + 1))
13 if (this.children.length === 0) {
14 this.parent.delete(this)
15 }
16 return true
17 }
18
19 add(value: T): Leaf<T> {
20 this.children.push(value)

Callers 4

test-radix-trie.jsFile · 0.45
uninstallFunction · 0.45
insertMethod · 0.45
deleteMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected