From a59f5eadd86e85bf662b37ec40ceb6f80cb207c4 Mon Sep 17 00:00:00 2001 From: Behnam Mohammadi Date: Sat, 14 Nov 2020 02:51:11 +0330 Subject: refactor(std): add std/_util/os.ts module (#8370) This commit adds "std/_util/os.ts" module which contains common os detection logic and is browser compatible. Co-authored-by: Nayeem Rahman --- std/path/_constants.ts | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'std/path/_constants.ts') diff --git a/std/path/_constants.ts b/std/path/_constants.ts index d26334b55..78755529b 100644 --- a/std/path/_constants.ts +++ b/std/path/_constants.ts @@ -46,17 +46,3 @@ export const CHAR_EQUAL = 61; /* = */ // Digits export const CHAR_0 = 48; /* 0 */ export const CHAR_9 = 57; /* 9 */ - -let NATIVE_OS: typeof Deno.build.os = "linux"; -// deno-lint-ignore no-explicit-any -const navigator = (globalThis as any).navigator; -if (globalThis.Deno != null) { - NATIVE_OS = Deno.build.os; -} else if (navigator?.appVersion?.includes?.("Win") ?? false) { - NATIVE_OS = "windows"; -} -// TODO(nayeemrmn): Improve OS detection in browsers beyond Windows. - -export const isWindows = NATIVE_OS == "windows"; - -export { NATIVE_OS }; -- cgit v1.2.3