MCPcopy Index your code
hub / github.com/Hashnode/starter-kit / compile

Method compile

packages/utils/renderer/highlight.js:539–570  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

537 })(e) + 1);
538 }
539 compile() {
540 0 === this.regexes.length && (this.exec = () => null);
541 const e = this.regexes.map((e) => e[1]);
542 (this.matcherRe = n(
543 (function (e, n = '|') {
544 for (
545 var t = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./, r = 0, a = '', i = 0;
546 i < e.length;
547 i++
548 ) {
549 var s = (r += 1),
550 o = g(e[i]);
551 for (i > 0 && (a += n), a += '('; o.length > 0; ) {
552 var l = t.exec(o);
553 if (null == l) {
554 a += o;
555 break;
556 }
557 (a += o.substring(0, l.index)),
558 (o = o.substring(l.index + l[0].length)),
559 '\\' === l[0][0] && l[1]
560 ? (a += '\\' + (+l[1] + s))
561 : ((a += l[0]), '(' === l[0] && r++);
562 }
563 a += ')';
564 }
565 return a;
566 })(e),
567 !0,
568 )),
569 (this.lastIndex = 0);
570 }
571 exec(e) {
572 this.matcherRe.lastIndex = this.lastIndex;
573 const n = this.matcherRe.exec(e);

Callers 1

getMatcherMethod · 0.95

Calls 3

gFunction · 0.85
nFunction · 0.70
execMethod · 0.45

Tested by

no test coverage detected