/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/globalthis/shim.js
29 строк
715 B
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
'use strict'; var define = require('define-properties'); var gOPD = require('gopd'); var getPolyfill = require('./polyfill'); module.exports = function shimGlobal() { var polyfill = getPolyfill(); if (define.supportsDescriptors) { var descriptor = gOPD(polyfill, 'globalThis'); if ( !descriptor || ( descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill) ) ) { Object.defineProperty(polyfill, 'globalThis', { configurable: true, enumerable: false, value: polyfill, writable: true }); } } else if (typeof globalThis !== 'object' || globalThis !== polyfill) { polyfill.globalThis = polyfill; } return polyfill; };