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

Function sensitiveSystemPaths

src/utils.ts:291–304  ·  view source on GitHub ↗

* The system set's own real paths, folded. macOS keeps `/etc`, `/tmp` and * `/var` under `/private`, so a project whose real path is `/private/etc` is * `/etc`. Read once: these folders don't move.

()

Source from the content-addressed store, hash-verified

289 * `/etc`. Read once: these folders don't move.
290 */
291function sensitiveSystemPaths(): Set<string> {
292 if (!sensitiveSystemRealPaths) {
293 sensitiveSystemRealPaths = new Set();
294 for (const entry of SENSITIVE_PATHS) {
295 // Only this platform's entries: on Windows `/` would resolve to the root
296 // of the current drive and refuse every project at a drive root.
297 const native = process.platform === 'win32' ? /^[a-z]:\\/.test(entry) : entry.startsWith('/');
298 if (!native) continue;
299 const real = nativeRealPath(entry);
300 if (real) sensitiveSystemRealPaths.add(foldPathCase(real));
301 }
302 }
303 return sensitiveSystemRealPaths;
304}
305
306/**
307 * The sensitive home folders, folded: as spelled under the home directory,

Callers 1

Calls 3

nativeRealPathFunction · 0.85
foldPathCaseFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected