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

Function pathHasSegment

src/resolution/callback-synthesizer.ts:2467–2469  ·  view source on GitHub ↗

A path segment (dir or filename stem) equals `seg` — `…/modules/user.js` has * the segment `user` for namespace `user`.

(filePath: string, seg: string)

Source from the content-addressed store, hash-verified

2465/** A path segment (dir or filename stem) equals `seg` — `…/modules/user.js` has
2466 * the segment `user` for namespace `user`. */
2467function pathHasSegment(filePath: string, seg: string): boolean {
2468 return new RegExp('[\\\\/]' + seg.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '[\\\\/.]').test(filePath);
2469}
2470
2471async function vuexDispatchEdges(ctx: ResolutionContext, onYield: MaybeYield): Promise<Edge[]> {
2472 let scannedFiles = 0;

Callers 1

resolveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected