invariant.js 429 B

1234567891011121314
  1. /**
  2. * Throws an error if the condition is not met in development mode.
  3. * This is used to make development a better experience to provide guidance as
  4. * to where the error comes from.
  5. */
  6. export function invariant(condition, message) {
  7. if (!(process.env.NODE_ENV !== 'production')) {
  8. return;
  9. }
  10. if (!condition) {
  11. throw new Error("[Autocomplete] ".concat(typeof message === 'function' ? message() : message));
  12. }
  13. }