@ungap/global-this
Version:
A cross engine globalThis.
17 lines (16 loc) • 365 B
JavaScript
(function (Object) {
typeof globalThis !== 'object' && (
this ?
get() :
(Object.defineProperty(Object.prototype, '_T_', {
configurable: true,
get: get
}), _T_)
);
function get() {
var global = this || self;
global.globalThis = global;
delete Object.prototype._T_;
}
}(Object));
module.exports = globalThis;