Files
3dverse-testtask/vendor/deno.land/std@0.188.0/_util/os.ts
T
didier amyot 0d627c9051 Added a very complicated AsyncIterableReader class.
The class was already implemented in
"https://deno.land/std@0.144.0/streams/conversion.ts".  So, I litterally
lost 1 day of work!  I hate myself.
2023-06-12 12:02:15 -04:00

24 lines
644 B
TypeScript

// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
export type OSType = "windows" | "linux" | "darwin" | "freebsd";
export const osType: OSType = (() => {
// deno-lint-ignore no-explicit-any
const { Deno } = globalThis as any;
if (typeof Deno?.build?.os === "string") {
return Deno.build.os;
}
// deno-lint-ignore no-explicit-any
const { navigator } = globalThis as any;
if (navigator?.appVersion?.includes?.("Win")) {
return "windows";
}
return "linux";
})();
export const isWindows = osType === "windows";
export const isLinux = osType === "linux";