Method
delete
(node: RadixTrie<T> | Leaf<T>)
Source from the content-addressed store, hash-verified
| 68 | } |
| 69 | |
| 70 | delete(node: RadixTrie<T> | Leaf<T>): boolean { |
| 71 | for (const edge in this.children) { |
| 72 | const currentNode = this.children[edge] |
| 73 | if (currentNode === node) { |
| 74 | const success = delete this.children[edge] |
| 75 | if (Object.keys(this.children).length === 0 && this.parent) { |
| 76 | this.parent.delete(this) |
| 77 | } |
| 78 | return success |
| 79 | } |
| 80 | } |
| 81 | return false |
| 82 | } |
| 83 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected