// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

import { isWindows } from "./_os.ts";
import { isAbsolute as posixIsAbsolute } from "./posix/is_absolute.ts";
import { isAbsolute as windowsIsAbsolute } from "./windows/is_absolute.ts";

/**
 * Verifies whether provided path is absolute
 * @param path to be verified as absolute
 */
export function isAbsolute(path: string): boolean {
  return isWindows ? windowsIsAbsolute(path) : posixIsAbsolute(path);
}

// denoCacheMetadata={"headers":{"cf-ray":"a223e6579a177db6-LAX","etag":"\"259a91ecb424abce5f9650ea09ed7f55\"","cache-control":"public, max-age=31536000, immutable","x-jsr-backend":"modules","vary":"Origin","access-control-expose-headers":"*","content-length":"521","cross-origin-resource-policy":"cross-origin","x-content-type-options":"nosniff","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=aseAly%2FS9MahLwiIpyNeuyiLwl62lk8cFqgWurIMrQAEpOnaTppurQmVrCa0nJfzvD1vCUl%2FndNBTbOPQbz9D1NAXEwLbC9Q8PyjblQSHz8sdOqfHXnOSY4%3D\"}]}","access-control-allow-origin":"*","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","accept-ranges":"bytes","server":"cloudflare","alt-svc":"h3=\":443\"; ma=86400","set-cookie":"__cf_bm=ntWQuEe19Vr.aoGHXXeIecjxjkauEAjtNXqFQNfKyPg-1785241875.1405082-1.0.1.1-188YenVys96Ntn9OyggF3gwrWhvyaIOECGt3H7qXkjgL2Rmoa.8tvCa799boDE2L0KiLEmRbERAYbVfYshuUkRIVh1Iffbt33ChWafvdNG.ePgJ3LUsADbdes6GaBcno; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","cf-cache-status":"HIT","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","age":"44352","date":"Tue, 28 Jul 2026 12:31:15 GMT","x-robots-tag":"noindex","content-type":"text/typescript"},"url":"https://jsr.io/@std/path/0.224.0/is_absolute.ts","time":1785241875}