Files
ServiceManager/frontend/node_modules/tiny-invariant/src/tiny-invariant.flow.js
2026-01-01 17:40:53 +01: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 || ''}`);
}