(condition, format, a, b, c, d, e, f)
| 12819 | */ |
| 12820 | |
| 12821 | var invariant = function(condition, format, a, b, c, d, e, f) { |
| 12822 | if ("production" !== process.env.NODE_ENV) { |
| 12823 | if (format === undefined) { |
| 12824 | throw new Error('invariant requires an error message argument'); |
| 12825 | } |
| 12826 | } |
| 12827 | |
| 12828 | if (!condition) { |
| 12829 | var error; |
| 12830 | if (format === undefined) { |
| 12831 | error = new Error( |
| 12832 | 'Minified exception occurred; use the non-minified dev environment ' + |
| 12833 | 'for the full error message and additional helpful warnings.' |
| 12834 | ); |
| 12835 | } else { |
| 12836 | var args = [a, b, c, d, e, f]; |
| 12837 | var argIndex = 0; |
| 12838 | error = new Error( |
| 12839 | 'Invariant Violation: ' + |
| 12840 | format.replace(/%s/g, function() { return args[argIndex++]; }) |
| 12841 | ); |
| 12842 | } |
| 12843 | |
| 12844 | error.framesToPop = 1; // we don't care about invariant's own frame |
| 12845 | throw error; |
| 12846 | } |
| 12847 | }; |
| 12848 | |
| 12849 | module.exports = invariant; |
| 12850 |
no outgoing calls
no test coverage detected