UNPKG

440 BJavaScriptView Raw
1/**
2 * If `condition` is true it throws error with `msg` in dev and `console.error`s `msg` otherwise
3 * @param condition
4 * @param msg
5 */
6export default function throwErrorInDev(condition, msg, info = 'n/a') {
7 if (process.env.NODE_ENV !== 'production') {
8 if (!condition) {
9 return;
10 }
11 console.error(msg, 'Info:', info);
12 throw new Error(msg);
13 }
14}
15//# sourceMappingURL=throwErrorInDev.js.map
\No newline at end of file