MCPcopy Index your code
hub / github.com/SplootCode/splootcode / removeChild

Method removeChild

packages/core/src/language/childset.ts:119–140  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

117 }
118
119 removeChild(index: number): SplootNode {
120 if (index >= this.children.length) {
121 console.warn("Attempting to delete child that doesn't exist!!", index, this.childParentRef.childSetId)
122 }
123 const child = this.children.splice(index, 1)[0]
124 child.beforeRemoval()
125 child.parent = null
126 child.recursivelyClearValidation()
127 if (this.enableMutations) {
128 child.recursivelySetMutations(false)
129 const parent = this.getParentRef().node
130 parent.validateSelf()
131 const mutation = new ChildSetMutation()
132 mutation.type = ChildSetMutationType.DELETE
133 mutation.childSet = this
134 mutation.nodes = []
135 mutation.index = index
136 this.fireMutation(mutation)
137 }
138 child.recursivelyClearObservers()
139 return child
140 }
141
142 recursivelyClearObservers() {
143 this.mutationObservers = []

Callers 15

deleteSelectedNodeMethod · 0.80
unindentMethod · 0.80
backspaceMethod · 0.80
wrapNodeOnPasteMethod · 0.80
replaceNodeMethod · 0.80
wrapNodeMethod · 0.80
generateKeyValuePairFunction · 0.80
getDictionaryTestFileFunction · 0.80
deserializerMethod · 0.80
cleanMethod · 0.80
registerMethod · 0.80

Calls 7

getParentRefMethod · 0.95
fireMutationMethod · 0.95
beforeRemovalMethod · 0.80
validateSelfMethod · 0.45

Tested by 2

generateKeyValuePairFunction · 0.64
getDictionaryTestFileFunction · 0.64