@lonu/stc
Version:
A tool for converting OpenApi/Swagger/Apifox into code.
15 lines (14 loc) • 617 B
JavaScript
// Copyright 2018-2026 the Deno authors. MIT license.
import * as dntShim from "../../../../../_dnt.shims.js";
export function checkWindows() {
// deno-lint-ignore no-explicit-any
const global = dntShim.dntGlobalThis;
// Check Node/Bun/Deno via `process.platform`, then the Deno global, then the browser
const platform = global.process?.platform;
if (typeof platform === "string")
return platform.startsWith("win");
const os = global.Deno?.build?.os;
if (typeof os === "string")
return os === "windows";
return global.navigator?.platform?.startsWith("Win") ?? false;
}