UNPKG

react-native-modalfy

Version:
46 lines (34 loc) 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.InvariantError = void 0; exports.invariant = invariant; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // s/o https://www.npmjs.com/package/ts-invariant /* eslint-disable no-proto */ const genericMessage = 'Invariant Violation'; const { setPrototypeOf = function (obj, proto) { obj.__proto__ = proto; return obj; } } = Object; class InvariantError extends Error { constructor() { let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : genericMessage; super(typeof message === 'number' ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)` : message); _defineProperty(this, "framesToPop", 1); _defineProperty(this, "name", genericMessage); setPrototypeOf(this, InvariantError.prototype); } } exports.InvariantError = InvariantError; function invariant(condition, message) { if (!condition) { throw new InvariantError(message); } } var _default = invariant; exports.default = _default; //# sourceMappingURL=invariant.js.map