import { CHAR_COLON } from "./_constants.ts";import { assertPath, isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot,} from "./_util.ts";
export function windowsIsAbsolute(path: string): boolean { assertPath(path);
const len = path.length; if (len === 0) return false;
const code = path.charCodeAt(0); if (isPathSeparator(code)) { return true; } else if (isWindowsDeviceRoot(code)) {
if (len > 2 && path.charCodeAt(1) === CHAR_COLON) { if (isPathSeparator(path.charCodeAt(2))) return true; } } return false;}
export function posixIsAbsolute(path: string): boolean { assertPath(path); return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));}