@lifaon/rx-js-light
Version:
Blazing fast Observables
26 lines (25 loc) • 617 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGlobalThis = exports.inferGlobalThis = void 0;
var GLOBAL_THIS;
function inferGlobalThis() {
Object.defineProperty(Object.prototype, '__magic__', {
get: function () {
return this;
},
configurable: true
});
var globalThis = __magic__;
delete Object.prototype['__magic__'];
return globalThis;
}
exports.inferGlobalThis = inferGlobalThis;
function getGlobalThis() {
if (GLOBAL_THIS === void 0) {
GLOBAL_THIS = inferGlobalThis();
}
return GLOBAL_THIS;
}
exports.getGlobalThis = getGlobalThis;