doc.yeswiki.pro/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js

14 lines
429 B
JavaScript
Raw Normal View History

2023-05-20 16:37:42 +00:00
/**
* Throws an error if the condition is not met in development mode.
* This is used to make development a better experience to provide guidance as
* to where the error comes from.
*/
export function invariant(condition, message) {
if (!(process.env.NODE_ENV !== 'production')) {
return;
}
if (!condition) {
throw new Error("[Autocomplete] ".concat(typeof message === 'function' ? message() : message));
}
}