Sha256: 1d08e9d93eca82edeaf7ad9881317b880a0bd103a89c9ac6cdb6b8da4f54647b

Contents?: true

Size: 722 Bytes

Versions: 27

Compression:

Stored size: 722 Bytes

Contents

'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;
};

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.11 node_modules/globalthis/shim.js
immosquare-cleaner-0.1.10 node_modules/globalthis/shim.js
immosquare-cleaner-0.1.9 node_modules/globalthis/shim.js
immosquare-cleaner-0.1.8 node_modules/globalthis/shim.js
immosquare-cleaner-0.1.7 node_modules/globalthis/shim.js
immosquare-cleaner-0.1.6 node_modules/globalthis/shim.js
decidim-0.26.8 packages/eslint-config/node_modules/globalthis/shim.js