This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs-blog-newsletter/backend/node_modules/bson/lib/utils/global.js

18 lines
791 B
JavaScript
Raw Normal View History

2024-05-26 22:54:55 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGlobal = void 0;
function checkForMath(potentialGlobal) {
// eslint-disable-next-line eqeqeq
return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal;
}
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
function getGlobal() {
return (checkForMath(typeof globalThis === 'object' && globalThis) ||
checkForMath(typeof window === 'object' && window) ||
checkForMath(typeof self === 'object' && self) ||
checkForMath(typeof global === 'object' && global) ||
// eslint-disable-next-line @typescript-eslint/no-implied-eval
Function('return this')());
}
exports.getGlobal = getGlobal;
//# sourceMappingURL=global.js.map