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

Method addRule

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

Source from the content-addressed store, hash-verified

86constructor(){
87this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
88addRule(e,t){
89t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),
90this.matchAt+=(e=>RegExp(e.toString()+"|").exec("").length-1)(e)+1}compile(){
910===this.regexes.length&&(this.exec=()=>null)
92;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(((e,t="|")=>{
93const n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;let s=0,r=""

Callers 1

getMatcherMethod · 0.95

Calls 1

execMethod · 0.45

Tested by

no test coverage detected