mirror of
https://github.com/emn178/js-sha256.git
synced 2026-08-12 20:32:16 +08:00
fix recognize environment is node when use browserfs (#53)
Co-authored-by: zerenzhang <zerenzhang@trip.com>
This commit is contained in:
co-authored by
zerenzhang
parent
da84f28777
commit
36d8fc4609
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
WINDOW = false;
|
WINDOW = false;
|
||||||
}
|
}
|
||||||
var WEB_WORKER = !WINDOW && typeof self === 'object';
|
var WEB_WORKER = !WINDOW && typeof self === 'object';
|
||||||
var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node && process.type != 'renderer';
|
var NODE_JS = !root.JS_SHA256_NO_NODE_JS && !WINDOW && typeof process === 'object' && process.versions && process.versions.node && process.type != 'renderer';
|
||||||
if (NODE_JS) {
|
if (NODE_JS) {
|
||||||
root = global;
|
root = global;
|
||||||
} else if (WEB_WORKER) {
|
} else if (WEB_WORKER) {
|
||||||
|
|||||||
Reference in New Issue
Block a user