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

Method compile

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

Source from the content-addressed store, hash-verified

128 addRule(e,n){
129 n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),
130 this.matchAt+=_(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
131 ;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(f(e,{joinWith:"|"
132 }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
133 ;const n=this.matcherRe.exec(e);if(!n)return null
134 ;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t]
135 ;return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){

Callers 2

getMatcherMethod · 0.95

Calls 3

mapMethod · 0.80
nFunction · 0.70
fFunction · 0.70

Tested by

no test coverage detected