From ae187b6d75c8079da0be1dc288613bad8466fe61 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Tue, 24 Oct 2023 17:43:37 +0200 Subject: Initial commit --- desktop/node_modules/globalthis/shim.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 desktop/node_modules/globalthis/shim.js (limited to 'desktop/node_modules/globalthis/shim.js') diff --git a/desktop/node_modules/globalthis/shim.js b/desktop/node_modules/globalthis/shim.js new file mode 100644 index 0000000..7ccf455 --- /dev/null +++ b/desktop/node_modules/globalthis/shim.js @@ -0,0 +1,22 @@ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimGlobal() { + var polyfill = getPolyfill(); + if (define.supportsDescriptors) { + var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis'); + if (!descriptor || (descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len + Object.defineProperty(polyfill, 'globalThis', { + configurable: true, + enumerable: false, + value: polyfill, + writable: true + }); + } + } else if (typeof globalThis !== 'object' || globalThis !== polyfill) { + polyfill.globalThis = polyfill; + } + return polyfill; +}; -- cgit