diff --git a/fs/copy.ts b/fs/copy.ts index c481c0223..b4602ff6a 100644 --- a/fs/copy.ts +++ b/fs/copy.ts @@ -8,7 +8,8 @@ import { getFileInfoType } from "./_get_file_info_type.ts"; import { toPathString } from "./_to_path_string.ts"; import { isSubdir } from "./_is_subdir.ts"; -const isWindows = Deno.build.os === "windows"; +// deno-lint-ignore no-explicit-any +const isWindows = (globalThis as any).Deno?.build.os === "windows"; /** Options for {@linkcode copy} and {@linkcode copySync}. */ export interface CopyOptions { diff --git a/fs/ensure_symlink.ts b/fs/ensure_symlink.ts index 8e27d6c43..f2dec2cd9 100644 --- a/fs/ensure_symlink.ts +++ b/fs/ensure_symlink.ts @@ -5,7 +5,8 @@ import { ensureDir, ensureDirSync } from "./ensure_dir.ts"; import { getFileInfoType, type PathType } from "./_get_file_info_type.ts"; import { toPathString } from "./_to_path_string.ts"; -const isWindows = Deno.build.os === "windows"; +// deno-lint-ignore no-explicit-any +const isWindows = (globalThis as any).Deno?.build.os === "windows"; function resolveSymlinkTarget(target: string | URL, linkName: string | URL) { if (typeof target !== "string") return target; // URL is always absolute path diff --git a/fs/eol.ts b/fs/eol.ts index 25218f579..dfa0d4bba 100644 --- a/fs/eol.ts +++ b/fs/eol.ts @@ -16,7 +16,9 @@ export const CRLF = "\r\n" as const; * EOL; // "\n" on POSIX platforms and "\r\n" on Windows * ``` */ -export const EOL: "\n" | "\r\n" = Deno?.build.os === "windows" ? CRLF : LF; +export const EOL: "\n" | "\r\n" = + // deno-lint-ignore no-explicit-any + (globalThis as any).Deno?.build.os === "windows" ? CRLF : LF; const regDetect = /(?:\r?\n)/g; diff --git a/fs/expand_glob.ts b/fs/expand_glob.ts index fb0b24d3d..5cffba1bb 100644 --- a/fs/expand_glob.ts +++ b/fs/expand_glob.ts @@ -15,7 +15,8 @@ import { export type { GlobOptions, WalkEntry }; -const isWindows = Deno.build.os === "windows"; +// deno-lint-ignore no-explicit-any +const isWindows = (globalThis as any).Deno?.build.os === "windows"; /** Options for {@linkcode expandGlob} and {@linkcode expandGlobSync}. */ export interface ExpandGlobOptions extends Omit {