From: Christopher Jeffrey (JJ) Date: Fri, 1 Mar 2024 12:14:42 +0000 (-0500) Subject: Remove `global` accesses. See #347 (#354) X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=e3c6f06239accc95e8b54b0d33093f6be29bef25;p=buffer.git Remove `global` accesses. See #347 (#354) --- diff --git a/index.js b/index.js index 32f290f..bdea604 100644 --- 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`: