MCPcopy Create free account
hub / github.com/danvk/webdiff / add

Method add

webdiff/static/js/highlight.min.js:29–30  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

27;return Object.assign(t,e),t};class l{constructor(){
28this.rootNode=o(),this.stack=[this.rootNode]}get top(){
29return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){
30this.top.children.push(e)}openNode(e){const t=o({scope:e})
31;this.add(t),this.stack.push(t)}closeNode(){
32if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){
33for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}

Callers 4

openNodeMethod · 0.95
addTextMethod · 0.45
addSublanguageMethod · 0.45
CFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected