Projekt

Obecné

Profil

Stáhnout (289 Bajtů) Statistiky
| Větev: | Revize:
1 3a515b92 cagy
// @flow
2
// This file is not actually executed
3
// It is just used by flow for typing
4
5
const prefix: string = 'Invariant failed';
6
7
export default function invariant(condition: mixed, message?: string) {
8
  if (condition) {
9
    return;
10
  }
11
  throw new Error(`${prefix}: ${message || ''}`);
12
}