MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / glob2re

Function glob2re

scripts/agent-eval/parse-run.mjs:453–458  ·  view source on GitHub ↗
(glob)

Source from the content-addressed store, hash-verified

451 // The `**` sentinel is written as an escape, never a literal NUL byte — a raw
452 // one makes git treat this whole script as binary and costs every future diff.
453 const glob2re = (glob) => {
454 const S = '\\u0000';
455 const body = glob.replace(/[.+^${}()|[\]\\]/g, '\\$&')
456 .replace(/\*\*/g, S).replace(/\*/g, '[^/]*').replaceAll(S, '.*');
457 return new RegExp(`^${body}$`);
458 };
459 const answerRes = answerGlobs.map(glob2re);
460 const isAnswer = (p) => answerRes.some((re) => re.test(p));
461

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected