Files
t3code/packages/shared/src/path.ts
T
2026-04-14 23:26:05 -07:00

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("..\\")
);
}