// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.

import {
  CHAR_BACKWARD_SLASH,
  CHAR_FORWARD_SLASH,
  CHAR_LOWERCASE_A,
  CHAR_LOWERCASE_Z,
  CHAR_UPPERCASE_A,
  CHAR_UPPERCASE_Z,
} from "../_common/constants.ts";

export function isPosixPathSeparator(code: number): boolean {
  return code === CHAR_FORWARD_SLASH;
}

export function isPathSeparator(code: number): boolean {
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}

export function isWindowsDeviceRoot(code: number): boolean {
  return (
    (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z) ||
    (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z)
  );
}

// denoCacheMetadata={"headers":{"nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","set-cookie":"__cf_bm=idmw2HJGmvbFKZHjjHC0k5j5y.p2kZiagMRdhKNk7cg-1785241875.2810137-1.0.1.1-xlEzMMZsoPyJ3VrIPfxaCn7pZQoKVfl_iFqxMC47xYQMy9wvX0Xhu7i3JUuxpa2.0KopU_UXPp5A9mI_4pgGx3f6jY8U2ZodKybVyW.6zzg.neb8YjgNu2X4blIecoWy; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","content-length":"828","cross-origin-resource-policy":"cross-origin","content-type":"text/typescript","date":"Tue, 28 Jul 2026 12:31:15 GMT","vary":"Origin","x-jsr-backend":"modules","age":"4263379","etag":"\"77e408e05b02b82b6c91e057d35ac7f4\"","access-control-expose-headers":"*","cf-ray":"a223e6587c887db6-LAX","cache-control":"public, max-age=31536000, immutable","alt-svc":"h3=\":443\"; ma=86400","x-content-type-options":"nosniff","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=U61%2BnlwieRgl4%2BdpmDH%2F8ViI0wzdqZxd6cMTungHBLcNy1PJ28Ag1V0SnQ1YfsoOpc4MpBpEKMhEna%2BaFaYyS3tAAc0wv9lbNTRcASfB9Kv8R7j6T50j1uM%3D\"}]}","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';","accept-ranges":"bytes","cf-cache-status":"HIT","access-control-allow-origin":"*","server":"cloudflare","x-robots-tag":"noindex"},"url":"https://jsr.io/@std/path/0.224.0/windows/_util.ts","time":1785241875}