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

Function globClosure

src/resolution/workspace-packages.ts:1034–1039  ·  view source on GitHub ↗

`states` with every `**` that can match no folder at all stepped over.

(glob: GlobSegment[], states: Set<number>)

Source from the content-addressed store, hash-verified

1032
1033/** `states` with every `**` that can match no folder at all stepped over. */
1034function globClosure(glob: GlobSegment[], states: Set<number>): Set<number> {
1035 for (const i of [...states]) {
1036 for (let j = i; glob[j]?.globstar; j++) states.add(j + 1);
1037 }
1038 return states;
1039}
1040
1041/** Read the `name` field from a member directory's package.json. */
1042function readPackageName(dirAbs: string): string | null {

Callers 3

expandWorkspaceGlobFunction · 0.85
workspaceGlobMatchesFunction · 0.85
globStepFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected