MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / add

Method add

hyperagent-ext/media/scripts/highlight.min.js:29–30  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

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

Callers 4

openNodeMethod · 0.95
addTextMethod · 0.45
addSublanguageMethod · 0.45
yFunction · 0.45

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected