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

Function pathAndFolders

__tests__/git-ignored-dirs-scope.test.ts:57–60  ·  view source on GitHub ↗

`rel` and every folder above it, in the forms the watcher asks about.

(rel: string)

Source from the content-addressed store, hash-verified

55
56/** `rel` and every folder above it, in the forms the watcher asks about. */
57function pathAndFolders(rel: string): string[] {
58 const parts = rel.split('/');
59 return [rel, ...parts.slice(0, -1).map((_, i) => parts.slice(0, i + 1).join('/') + '/')];
60}
61
62const sorted = (files: Iterable<string>): string[] => [...files].sort();
63

Callers 1

Calls 2

mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected