(condition, format, a, b, c, d, e, f)
| 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 |
no test coverage detected
searching dependent graphs…