mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
c3b113d7a9
* Refactored to get rid of unnecessary function. All that needs to be done here is to check if the version is windows. Handling each combination of runtime and operating system will make the existing osType difficult to test and maintain. * Changed browser version of isWindows. It was using a deprecated web API. * Refactored getIsWindows. * Added node/bun version of isWindows. * Got cross platform os module working. * Handled Deno error. * Fixed type errors. * Removed node:os import. This is how NodeJS checks to see if the underlying OS is windows. * tweaks * fix * cleanup * tweak * fix * Added support for node. --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
11 lines
454 B
TypeScript
11 lines
454 B
TypeScript
// deno-lint-ignore-file no-explicit-any
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
// Check Deno, then the remaining runtimes (e.g. Node, Bun and the browser)
|
|
export const isWindows: boolean =
|
|
(globalThis as any).Deno?.build.os === "windows" ||
|
|
(globalThis as any).navigator?.platform?.startsWith("Win") ||
|
|
(globalThis as any).process?.platform?.startsWith("win") ||
|
|
false;
|