summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_util/os.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_util/os.ts')
-rw-r--r--ext/node/polyfills/_util/os.ts18
1 files changed, 3 insertions, 15 deletions
diff --git a/ext/node/polyfills/_util/os.ts b/ext/node/polyfills/_util/os.ts
index 66d18534c..a3cb396bd 100644
--- a/ext/node/polyfills/_util/os.ts
+++ b/ext/node/polyfills/_util/os.ts
@@ -1,22 +1,10 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-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;
- }
+const { ops } = globalThis.__bootstrap.core;
- // deno-lint-ignore no-explicit-any
- const { navigator } = globalThis as any;
- if (navigator?.appVersion?.includes?.("Win")) {
- return "windows";
- }
+export type OSType = "windows" | "linux" | "darwin" | "freebsd";
- return "linux";
-})();
+export const osType: OSType = ops.op_node_build_os();
export const isWindows = osType === "windows";
export const isLinux = osType === "linux";