errors.mjs 390 B

12345678910111213141516
  1. let warning = () => { };
  2. let invariant = () => { };
  3. if (process.env.NODE_ENV !== "production") {
  4. warning = (check, message) => {
  5. if (!check && typeof console !== "undefined") {
  6. console.warn(message);
  7. }
  8. };
  9. invariant = (check, message) => {
  10. if (!check) {
  11. throw new Error(message);
  12. }
  13. };
  14. }
  15. export { invariant, warning };