From 0ac0c7f2a58cce24cb8396ab652e120581aedb67 Mon Sep 17 00:00:00 2001 From: smeng9 <38666763+smeng9@users.noreply.github.com> Date: Mon, 2 Jan 2023 22:26:57 -0600 Subject: [PATCH] fix undefined global in some environments --- build/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/files.js b/build/files.js index 96d5210947..1494a2a480 100644 --- a/build/files.js +++ b/build/files.js @@ -133,7 +133,7 @@ const headRegexp = /(^module.exports = \w+;?)/m /(?:var|const) (?:{ )Buffer(?: }) = require\('buffer'\)(?:\.Buffer)?;/g , ` const Buffer = require('buffer').Buffer - const OurUint8Array = global.Uint8Array || function () {} + const OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {} function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); }