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

Function isDrive

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

Source from the content-addressed store, hash-verified

1export type PathKey = string & { _brand: "PathKey" }
2
3const isDrive = (value: string) => {
4 if (value.length !== 2) return false
5 const code = value.charCodeAt(0)
6 return value[1] === ":" && ((code >= 65 && code <= 90) || (code >= 97 && code <= 122))
7}
8
9const trimTrailingSlashes = (value: string) => {
10 for (let i = value.length - 1; i >= 0; i--) {

Callers 1

pathKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected