(condition: boolean, message: () => string)
| 10 | |
| 11 | const isProduction = typeof process === 'object' && process.env.NODE_ENV === 'production'; |
| 12 | export function invariant(condition: boolean, message: () => string) { |
| 13 | if (!condition) { |
| 14 | /* istanbul ignore next */ |
| 15 | if (isProduction) { |
| 16 | throw new Error('Invariant failed'); |
| 17 | } |
| 18 | throw new Error(message()); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | const hasOwnProperty = Object.prototype.hasOwnProperty; |
| 23 | const splice = Array.prototype.splice; |
no outgoing calls
no test coverage detected
searching dependent graphs…