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

Function trimTrailingSlashes

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

Source from the content-addressed store, hash-verified

7}
8
9const trimTrailingSlashes = (value: string) => {
10 for (let i = value.length - 1; i >= 0; i--) {
11 if (value[i] !== "/") return value.slice(0, i + 1)
12 }
13 return ""
14}
15
16const isWindowsPath = (value: string) => value[1] === ":" || value.startsWith("\\\\")
17

Callers 1

pathKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected