]> zoso.dev Git - buffer.git/commitdiff
Remove `global` accesses. See #347 (#354)
authorChristopher Jeffrey (JJ) <chjjeffrey@gmail.com>
Fri, 1 Mar 2024 12:14:42 +0000 (07:14 -0500)
committerGitHub <noreply@github.com>
Fri, 1 Mar 2024 12:14:42 +0000 (23:14 +1100)
index.js

index 32f290fb926e2e4fe8fbd86e7120c9d4b4eefee5..bdea604869ce05977ce68cf9f8d66dfdcd503b46 100644 (file)
--- a/index.js
+++ b/index.js
@@ -38,10 +38,10 @@ exports.constants = {
   MAX_STRING_LENGTH: K_STRING_MAX_LENGTH
 }
 
-exports.Blob = global.Blob
-exports.File = global.File
-exports.atob = global.atob
-exports.btoa = global.btoa
+exports.Blob = typeof Blob !== 'undefined' ? Blob : undefined
+exports.File = typeof File !== 'undefined' ? File : undefined
+exports.atob = typeof atob !== 'undefined' ? atob : undefined
+exports.btoa = typeof btoa !== 'undefined' ? btoa : undefined
 
 /**
  * If `Buffer.TYPED_ARRAY_SUPPORT`: