MCPcopy Create free account
hub / github.com/VSpaceCode/VSpaceCode / hasDriveLetter

Function hasDriveLetter

src/pathCommands.ts:84–97  ·  view source on GitHub ↗
(fsPath: string, offset = 0)

Source from the content-addressed store, hash-verified

82}
83
84function hasDriveLetter(fsPath: string, offset = 0): boolean {
85 if (fsPath.length >= 2 + offset) {
86 // Checks C:\Users
87 // ^^
88 const char0 = fsPath.charCodeAt(0 + offset);
89 const char1 = fsPath.charCodeAt(1 + offset);
90 return (
91 char1 === CharCode.Colon &&
92 ((char0 >= CharCode.A && char0 <= CharCode.Z) ||
93 (char0 >= CharCode.a && char0 <= CharCode.z))
94 );
95 }
96 return false;
97}
98
99function isPathSeparator(code: number): boolean {
100 return code === CharCode.Slash || code === CharCode.Backslash;

Callers 2

getPlatformPathFunction · 0.85
uriToFsPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected