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

// Keep this up-to-date with Deno.build.os
/**
 * Operating system type, equivalent to the type of
 * {@linkcode https://deno.land/api?s=Deno.build | Deno.build.os}.
 */
type OSType =
  | "darwin"
  | "linux"
  | "windows"
  | "freebsd"
  | "netbsd"
  | "aix"
  | "solaris"
  | "illumos"
  | "android";

function getOsType(): OSType {
  // deno-lint-ignore no-explicit-any
  return (globalThis as any).Deno?.build.os ||
    (navigator.userAgent.includes("Win") ? "windows" : "linux");
}

export const isWindows: boolean = getOsType() === "windows";

// denoCacheMetadata={"headers":{"x-content-type-options":"nosniff","etag":"\"90bf67373430662ea363746fffe28355\"","access-control-expose-headers":"*","set-cookie":"__cf_bm=k.4dLxMT3NDio2ddr2hwyOHImjE57VODfbgvulMQIJY-1785241875.34191-1.0.1.1-MnjcP29_IKkiN5gCYsPqJWkJSb1Q.FkOoJDHgtrgGVx9HRdHSjz8O0hfivDbS5trg4ZvbdUoPMVvZzH2f2Q652IsfLtPt6svyi5gOmXMQlTBczf_G4BFCSAQVGizpuFj; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","cross-origin-resource-policy":"cross-origin","age":"38659","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=%2FvTq7IzKfuPVUnIqVi8GczroJpc44b8xcwV3OfquWPUyq4yHA3fPVdJtDrFwgOvZsmSZ6%2Fgkswz1s7NTard%2B7KWf4Z4qVx3ZQq7%2BA%2Bi7doJUAJ5OMiDq33A%3D\"}]}","cache-control":"public, max-age=31536000, immutable","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';","access-control-allow-origin":"*","content-length":"663","cf-ray":"a223e658cdae7db6-LAX","x-robots-tag":"noindex","alt-svc":"h3=\":443\"; ma=86400","server":"cloudflare","cf-cache-status":"HIT","vary":"Origin","content-type":"text/typescript","x-jsr-backend":"modules","accept-ranges":"bytes","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","date":"Tue, 28 Jul 2026 12:31:15 GMT"},"url":"https://jsr.io/@std/path/1.0.0-rc.2/_os.ts","time":1785241875}