summaryrefslogtreecommitdiff
path: root/alarm/node_modules/graphql/jsutils/invariant.js.flow
blob: 6268571388bb3c4f1e80fb1b82ebdf42602e6053 (plain)
1
2
3
4
5
6
7
8
9
10
// @flow strict
export default function invariant(condition: mixed, message?: string): void {
  const booleanCondition = Boolean(condition);
  // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
  if (!booleanCondition) {
    throw new Error(
      message != null ? message : 'Unexpected invariant triggered.',
    );
  }
}