Files
cannaiq/frontend/node_modules/tiny-invariant/src/tiny-invariant.flow.js
2025-11-28 19:45:44 -07:00

13 lines
306 B
JavaScript

// @flow
// This file is not actually executed
// It is just used by flow for typing
const prefix: string = 'Invariant failed';
export default function invariant(condition: mixed, message?: string | (() => string)) {
if (condition) {
return;
}
throw new Error(`${prefix}: ${message || ''}`);
}