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

Method trim

packages/core/src/language/fragment.ts:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 trim() {
32 // Trim invisible nodes
33 if (this.nodes.length === 1 && this.nodes[0].getNodeLayout().isInvisible()) {
34 const node = this.nodes[0]
35 if (node.childSetOrder.length === 1) {
36 const childSet = node.getChildSet(node.childSetOrder[0])
37 this.nodes = childSet.children
38 this.nodeCategory = childSet.nodeCategory
39 }
40 }
41 }
42
43 isEmpty() {
44 return this.nodes.length === 0

Callers 8

constructorMethod · 0.95
getShortDocFunction · 0.80
prefixMatchMethod · 0.80
handleEarlyInsertMethod · 0.80
getFragmentMethod · 0.80
dynamicSuggestionsMethod · 0.80
dynamicSuggestionsMethod · 0.80
createTextNodeFunction · 0.80

Calls 3

isInvisibleMethod · 0.80
getNodeLayoutMethod · 0.45
getChildSetMethod · 0.45

Tested by

no test coverage detected