You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
const DEV = process.env.NODE_ENV !== "production";
|
|
|
|
const warnings = new Set();
|
|
|
|
function warnOnce(condition, ...rest) {
|
|
if (DEV && condition) {
|
|
const key = rest.join(" ");
|
|
|
|
if (warnings.has(key)) {
|
|
return;
|
|
}
|
|
|
|
warnings.add(key);
|
|
console.warn(...rest);
|
|
}
|
|
}
|
|
|
|
module.exports = warnOnce;
|