MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / _walk

Method _walk

vulnerablecode/static/js/highlight-10.6.0.min.js:29–31  ·  view source on GitHub ↗
(e,t)

Source from the content-addressed store, hash-verified

27if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){
28for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}
29walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){
30return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),
31t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){
32"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{
33l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e}
34addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}

Callers 1

walkMethod · 0.80

Calls 3

addTextMethod · 0.45
openNodeMethod · 0.45
closeNodeMethod · 0.45

Tested by

no test coverage detected