diff --git a/utils/global_values.ts b/utils/global_values.ts index d3dd800..5bac6d4 100644 --- a/utils/global_values.ts +++ b/utils/global_values.ts @@ -2,7 +2,7 @@ import {Logger} from "./logger.ts"; // node not supported // @ts-ignore check if node environment -if (globalThis.process && !globalThis.window) throw new Error("node.js is currently not supported - use deno instead") +if (!globalThis.Deno) throw new Error("node.js is currently not supported - use deno instead") export const TypedArray:typeof Uint8Array|typeof Uint16Array|typeof Uint32Array|typeof Int8Array|typeof Int16Array|typeof Int32Array|typeof BigInt64Array|typeof BigUint64Array|typeof Float32Array|typeof Float64Array = Object.getPrototypeOf(Uint8Array); export type TypedArray = Uint8Array|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|BigInt64Array|BigUint64Array|Float32Array|Float64Array; diff --git a/utils/sha256.ts b/utils/sha256.ts index c9a776e..13b981c 100644 --- a/utils/sha256.ts +++ b/utils/sha256.ts @@ -16,7 +16,7 @@ if (root.JS_SHA256_NO_WINDOW) { WINDOW = false; } var WEB_WORKER = !WINDOW && typeof self === 'object'; -var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; +var NODE_JS = !globalThis.Deno && !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; if (NODE_JS) { root = global; } else if (WEB_WORKER) {