UNPKG

@turbox3d/shared

Version:

turbox shared internal utility

21 lines (20 loc) 639 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OBFUSCATED_ERROR = void 0; exports.fail = fail; exports.invariant = invariant; exports.warn = warn; var OBFUSCATED_ERROR = exports.OBFUSCATED_ERROR = 'An invariant failed, however the error is obfuscated because this is an production build.'; function invariant(check, message) { if (!check) throw new Error("[turbox]: ".concat(message || OBFUSCATED_ERROR)); } function fail(message) { invariant(false, message); // eslint-disable-next-line no-throw-literal throw 'X'; } function warn(message) { console.warn("[turbox]: ".concat(message)); }