Skip to content

Commit

Permalink
Merge pull request #129 from unyt-org/deno_2.0
Browse files Browse the repository at this point in the history
Deno 2.0
  • Loading branch information
benStre authored Sep 10, 2024
2 parents 41e2514 + ea8cc2a commit f6bb89f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utils/global_values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion utils/sha256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f6bb89f

Please sign in to comment.