ICT30016-Assignment-3/node_modules/motion-utils/dist/es/errors.mjs
dlawler489 a79a6afd34 intial
intial
2025-09-16 12:09:52 +10:00

18 lines
540 B
JavaScript

import { formatErrorMessage } from './format-error-message.mjs';
let warning = () => { };
let invariant = () => { };
if (process.env.NODE_ENV !== "production") {
warning = (check, message, errorCode) => {
if (!check && typeof console !== "undefined") {
console.warn(formatErrorMessage(message, errorCode));
}
};
invariant = (check, message, errorCode) => {
if (!check) {
throw new Error(formatErrorMessage(message, errorCode));
}
};
}
export { invariant, warning };