github-pages-deploy-action/node_modules/graphql/jsutils/invariant.js.flow
2020-03-06 22:45:40 -05:00

12 lines
363 B
Plaintext

// @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.',
);
}
}