@oazmi/build-tools
Version:
general deno build tool scripts which I practically use in all of my typescript repos
23 lines (22 loc) • 784 B
JavaScript
// 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}.
*/
import * as dntShim from "../../../../../_dnt.shims.js";
export const osType = (() => {
// deno-lint-ignore no-explicit-any
const { Deno } = dntShim.dntGlobalThis;
if (typeof Deno?.build?.os === "string") {
return Deno.build.os;
}
// deno-lint-ignore no-explicit-any
const { navigator } = dntShim.dntGlobalThis;
if (navigator?.appVersion?.includes?.("Win")) {
return "windows";
}
return "linux";
})();
export const isWindows = osType === "windows";