Skip to content

Instantly share code, notes, and snippets.

@oznakn
Created July 31, 2022 22:51
Show Gist options
  • Save oznakn/a831147418d2d132d0a0d0c5f3ecf6e3 to your computer and use it in GitHub Desktop.
Save oznakn/a831147418d2d132d0a0d0c5f3ecf6e3 to your computer and use it in GitHub Desktop.
'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