invariant.js.flow 241 B

12345678
  1. // @flow strict
  2. export default function invariant(condition: mixed, message?: string): void {
  3. const booleanCondition = Boolean(condition);
  4. if (!booleanCondition) {
  5. throw new Error(message || 'Unexpected invariant triggered');
  6. }
  7. }