MCPcopy Index your code
hub / github.com/anomalyco/opencode / normalizePath

Function normalizePath

packages/opencode/src/util/filesystem.ts:115–123  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

113 * may return paths with different casing than what we send them.
114 */
115export function normalizePath(p: string): string {
116 if (process.platform !== "win32") return p
117 const resolved = win32.normalize(win32.resolve(windowsPath(p)))
118 try {
119 return realpathSync.native(resolved)
120 } catch {
121 return resolved
122 }
123}
124
125export function normalizePathPattern(p: string): string {
126 if (process.platform !== "win32") return p

Callers 2

normalizePathPatternFunction · 0.70
resolveFunction · 0.70

Calls 1

windowsPathFunction · 0.70

Tested by

no test coverage detected