MCPcopy
hub / github.com/t4t5/sweetalert / invariant

Function invariant

docs/assets/js/index.js:50512–50535  ·  view source on GitHub ↗
(condition, format, a, b, c, d, e, f)

Source from the content-addressed store, hash-verified

50510 */
50511
50512 var invariant = function invariant(condition, format, a, b, c, d, e, f) {
50513 if (false) {
50514 if (format === undefined) {
50515 throw new Error('invariant requires an error message argument');
50516 }
50517 }
50518
50519 if (!condition) {
50520 var error;
50521 if (format === undefined) {
50522 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
50523 } else {
50524 var args = [a, b, c, d, e, f];
50525 var argIndex = 0;
50526 error = new Error(format.replace(/%s/g, function () {
50527 return args[argIndex++];
50528 }));
50529 error.name = 'Invariant Violation';
50530 }
50531
50532 error.framesToPop = 1; // we don't care about invariant's own frame
50533 throw error;
50534 }
50535 };
50536
50537 module.exports = invariant;
50538

Callers 15

toArrayFunction · 0.70
createNodesFromMarkupFunction · 0.70
getMarkupWrapFunction · 0.70
checkPropTypesFunction · 0.70
checkTypeFunction · 0.70
index.jsFile · 0.70
recomputePluginOrderingFunction · 0.70
publishEventForPluginFunction · 0.70
publishRegistrationNameFunction · 0.70
executeDirectDispatchFunction · 0.70
_assertSingleLinkFunction · 0.70
_assertValueLinkFunction · 0.70

Calls 1

validateFormatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…