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

Function readExclusion

src/resolution/frameworks/next-proxy.ts:231–236  ·  view source on GitHub ↗

* One branch of a negative lookahead, as a regex of our own: a literal path * prefix (`api`, `_next/static`, `favicon.ico`, `api(?:/|$)`) or a pattern for * files with an extension (`[^?]*\.(?:html?|css)`, `.*\.(?:svg|png)$`, * `.*\..*`). Every such pattern reads the same way: a route with a dot

(branch: string)

Source from the content-addressed store, hash-verified

229 * takes every path, so that app's proxy really does skip its pages.
230 */
231function readExclusion(branch: string): string | null {
232 if (/^(?:\[\^\?\]\*|\.\*|\.\+|\[[^\]]*\]\+)\\\./.test(branch)) return FILE_WITH_EXTENSION;
233 const literal = /^((?:[\w/~-]|\\?\.)+)(\$|\(\?:\/\|\$\))?$/.exec(branch);
234 if (!literal) return null;
235 return escapeRegex(literal[1]!.replace(/\\\./g, '.')) + (literal[2] ?? '');
236}
237
238/**
239 * The inside of a matcher's group: `.*`, `.+`, `a|b` of literals, or

Callers

nothing calls this directly

Calls 2

escapeRegexFunction · 0.70
execMethod · 0.65

Tested by

no test coverage detected