Created
July 31, 2022 22:51
-
-
Save oznakn/a831147418d2d132d0a0d0c5f3ecf6e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
Object.defineProperty(exports, '__esModule', {value: true}); | |
var tsInvariant = require('ts-invariant'); | |
var process$1 = require('@oznakn/ts-invariant-process'); | |
var graphql = require('graphql'); | |
function maybe(thunk) { | |
try { | |
return thunk(); | |
} | |
catch (_a) {} | |
} | |
var global$1 = (maybe(function () {return globalThis;}) || | |
maybe(function () {return window;}) || | |
maybe(function () {return self;}) || | |
maybe(function () {return global;}) || | |
maybe(function () {return maybe.constructor("return this")();})); | |
var __ = "__"; | |
var GLOBAL_KEY = [__, __].join("DEV"); | |
function getDEV() { | |
try { | |
return Boolean(__DEV__); | |
} | |
catch (_a) { | |
Object.defineProperty(global$1, GLOBAL_KEY, { | |
value: maybe(function () {return process.env.NODE_ENV;}) !== "production", | |
enumerable: false, | |
configurable: true, | |
writable: true, | |
}); | |
return global$1[GLOBAL_KEY]; | |
} | |
} | |
var DEV = getDEV(); | |
function removeTemporaryGlobals() { | |
return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove(); | |
} | |
function checkDEV() { | |
__DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 36); | |
} | |
removeTemporaryGlobals(); | |
checkDEV(); | |
exports.InvariantError = tsInvariant.InvariantError; | |
exports.invariant = tsInvariant.invariant; | |
exports.DEV = DEV; | |
exports.checkDEV = checkDEV; | |
exports.global = global$1; | |
exports.maybe = maybe; | |
//# sourceMappingURL=globals.cjs.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment