MCPcopy Create free account
hub / github.com/anomalyco/opencode / pathKey

Function pathKey

packages/app/src/utils/path-key.ts:18–24  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

16const isWindowsPath = (value: string) => value[1] === ":" || value.startsWith("\\\\")
17
18export const pathKey = (path: string) => {
19 const value = isWindowsPath(path) ? path.replaceAll("\\", "/") : path
20 const trimmed = trimTrailingSlashes(value)
21 if (!trimmed && value.startsWith("/")) return "/" as PathKey
22 if (isDrive(trimmed)) return `${trimmed}/` as PathKey
23 return trimmed as PathKey
24}

Callers 15

selectedFunction · 0.90
selectFunction · 0.90
legacyWorkspaceStorageFunction · 0.90
serverWorkspaceTargetFunction · 0.90
buildHomeSessionRecordsFunction · 0.90
homeSessionSearchKeyFunction · 0.90
setBusyFunction · 0.90
isBusyFunction · 0.90
useSDKNotificationToastsFunction · 0.90
LegacyLayoutFunction · 0.90
workspaceNameFunction · 0.90
setWorkspaceNameFunction · 0.90

Calls 3

isWindowsPathFunction · 0.85
trimTrailingSlashesFunction · 0.85
isDriveFunction · 0.85

Tested by

no test coverage detected