github-pages-deploy-action/node_modules/graphql/jsutils/invariant.js.flow

12 lines
363 B
Plaintext
Raw Normal View History

2020-03-07 11:45:40 +08:00
// @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.',
);
}
}