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

Function foldersAbove

src/resolution/php-web-root.ts:40–49  ·  view source on GitHub ↗

`folder` and each folder above it, the project root ('') last.

(folder: string)

Source from the content-addressed store, hash-verified

38
39/** `folder` and each folder above it, the project root ('') last. */
40function foldersAbove(folder: string): string[] {
41 const out: string[] = [];
42 let dir = folder;
43 for (;;) {
44 out.push(dir);
45 if (dir === '') return out;
46 const up = path.posix.dirname(dir);
47 dir = up === '.' ? '' : up;
48 }
49}
50
51/**
52 * `written` (the path an include appends to the web root, `inc/header.php`)

Callers 1

inferPhpWebRootsFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected