MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / safeRealpath

Function safeRealpath

src/memory/loader.ts:99–105  ·  view source on GitHub ↗

realpathSync that never throws (falls back to the input path).

(p: string)

Source from the content-addressed store, hash-verified

97
98/** realpathSync that never throws (falls back to the input path). */
99function safeRealpath(p: string): string {
100 try {
101 return fs.realpathSync(p)
102 } catch {
103 return path.resolve(p)
104 }
105}
106
107/** Walk from cwd up to root, collecting directories (root last). */
108function ancestorDirs(cwd: string): string[] {

Callers 1

loadWithIncludesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected