Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
23 lines
568 B
TypeScript
23 lines
568 B
TypeScript
export function isWindowsDrivePath(value: string): boolean {
|
|
return /^[a-zA-Z]:([/\\]|$)/.test(value);
|
|
}
|
|
|
|
export function isUncPath(value: string): boolean {
|
|
return value.startsWith("\\\\");
|
|
}
|
|
|
|
export function isWindowsAbsolutePath(value: string): boolean {
|
|
return isUncPath(value) || isWindowsDrivePath(value);
|
|
}
|
|
|
|
export function isExplicitRelativePath(value: string): boolean {
|
|
return (
|
|
value === "." ||
|
|
value === ".." ||
|
|
value.startsWith("./") ||
|
|
value.startsWith("../") ||
|
|
value.startsWith(".\\") ||
|
|
value.startsWith("..\\")
|
|
);
|
|
}
|