MCPcopy Create free account
hub / github.com/nodejs/node / #partsToRegExp

Method #partsToRegExp

deps/minimatch/index.js:979–988  ·  view source on GitHub ↗
(dot)

Source from the content-addressed store, hash-verified

977 this.#toString = void 0;
978 }
979 #partsToRegExp(dot) {
980 return this.#parts.map((p) => {
981 if (typeof p === "string") {
982 throw new Error("string type in extglob ast??");
983 }
984 const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
985 this.#uflag = this.#uflag || uflag;
986 return re;
987 }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
988 }
989 static #parseGlob(glob, hasMagic, noEmpty = false) {
990 let escaping = false;
991 let re = "";

Callers 1

toRegExpSourceMethod · 0.80

Calls 6

toRegExpSourceMethod · 0.80
isStartMethod · 0.80
isEndMethod · 0.80
filterMethod · 0.65
mapMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected