package.internals.define-global-property.js Maven / Gradle / Ivy
The newest version!
'use strict';
var globalThis = require('../internals/global-this');
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
module.exports = function (key, value) {
try {
defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
} catch (error) {
globalThis[key] = value;
} return value;
};
© 2015 - 2024 Weber Informatics LLC | Privacy Policy