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

Method compile

webdiff/static/js/highlight.min.js:131–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 3

getMatcherMethod · 0.95
argparser.pyFile · 0.80
github_fetcher.pyFile · 0.80

Calls 2

tFunction · 0.70
bFunction · 0.70

Tested by

no test coverage detected