(condition, format, a, b, c, d, e, f)
| 753 | } |
| 754 | |
| 755 | function invariant(condition, format, a, b, c, d, e, f) { |
| 756 | validateFormat(format); |
| 757 | |
| 758 | if (!condition) { |
| 759 | var error; |
| 760 | if (format === undefined) { |
| 761 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); |
| 762 | } else { |
| 763 | var args = [a, b, c, d, e, f]; |
| 764 | var argIndex = 0; |
| 765 | error = new Error(format.replace(/%s/g, function () { |
| 766 | return args[argIndex++]; |
| 767 | })); |
| 768 | error.name = 'Invariant Violation'; |
| 769 | } |
| 770 | |
| 771 | error.framesToPop = 1; // we don't care about invariant's own frame |
| 772 | throw error; |
| 773 | } |
| 774 | } |
| 775 | |
| 776 | module.exports = invariant; |
| 777 |
no test coverage detected