MCPcopy
hub / github.com/MoonHighway/learning-react / invariant

Function invariant

chapter-12/server-render-recipes/assets/bundle.js:334–353  ·  view source on GitHub ↗
(condition, format, a, b, c, d, e, f)

Source from the content-addressed store, hash-verified

332}
333
334function invariant(condition, format, a, b, c, d, e, f) {
335 validateFormat(format);
336
337 if (!condition) {
338 var error;
339 if (format === undefined) {
340 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
341 } else {
342 var args = [a, b, c, d, e, f];
343 var argIndex = 0;
344 error = new Error(format.replace(/%s/g, function () {
345 return args[argIndex++];
346 }));
347 error.name = 'Invariant Violation';
348 }
349
350 error.framesToPop = 1; // we don't care about invariant's own frame
351 throw error;
352 }
353}
354
355module.exports = invariant;
356/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))

Callers 15

checkPropTypesFunction · 0.85
bundle.jsFile · 0.85
traverseAllChildrenImplFunction · 0.85
onlyChildFunction · 0.85
recomputePluginOrderingFunction · 0.85
publishEventForPluginFunction · 0.85
publishRegistrationNameFunction · 0.85
precacheChildNodesFunction · 0.85
getNodeFromInstanceFunction · 0.85
assertIsMountedFunction · 0.85
executeDirectDispatchFunction · 0.85

Calls 1

validateFormatFunction · 0.85

Tested by

no test coverage detected