( condition: unknown, message?: string, )
| 14 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 15 | export function invariant(condition: any, message?: string): asserts condition; |
| 16 | export function invariant( |
| 17 | condition: unknown, |
| 18 | message?: string, |
| 19 | ): asserts condition { |
| 20 | if (condition) { |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | if (isProduction) { |
| 25 | // In production we strip the message but still throw |
| 26 | throw new RbdInvariant(prefix); |
| 27 | } else { |
| 28 | // When not in production we allow the message to pass through |
| 29 | // *This block will be removed in production builds* |
| 30 | throw new RbdInvariant(`${prefix}: ${message || ''}`); |
| 31 | } |
| 32 | } |
no outgoing calls
searching dependent graphs…