MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / invariant

Function invariant

code/higher-order-components/public/app.js:458–477  ·  view source on GitHub ↗
(condition, format, a, b, c, d, e, f)

Source from the content-addressed store, hash-verified

456}
457
458function invariant(condition, format, a, b, c, d, e, f) {
459 validateFormat(format);
460
461 if (!condition) {
462 var error;
463 if (format === undefined) {
464 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
465 } else {
466 var args = [a, b, c, d, e, f];
467 var argIndex = 0;
468 error = new Error(format.replace(/%s/g, function () {
469 return args[argIndex++];
470 }));
471 error.name = 'Invariant Violation';
472 }
473
474 error.framesToPop = 1; // we don't care about invariant's own frame
475 throw error;
476 }
477}
478
479module.exports = invariant;
480}).call(this,require('_process'))

Callers 15

checkPropTypesFunction · 0.70
shimFunction · 0.70
checkTypeFunction · 0.70
app.jsFile · 0.70
invokeGuardedCallbackDevFunction · 0.70
recomputePluginOrderingFunction · 0.70
publishEventForPluginFunction · 0.70
publishRegistrationNameFunction · 0.70
injectEventPluginOrderFunction · 0.70
injectEventPluginsByNameFunction · 0.70
accumulateIntoFunction · 0.70
getListenerFunction · 0.70

Calls 1

validateFormatFunction · 0.70

Tested by

no test coverage detected