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

Function sensitiveSystemPaths

src/utils.ts:290–303  ·  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

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