Files
Basilosaurusrex f027651f9b main repo
2025-11-24 18:09:40 +01:00

19 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 };