mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-10 19:54:57 +02:00
21 lines
361 B
JavaScript
21 lines
361 B
JavaScript
var isProduction = process.env.NODE_ENV === 'production';
|
|
function warning(condition, message) {
|
|
if (!isProduction) {
|
|
if (condition) {
|
|
return;
|
|
}
|
|
|
|
var text = "Warning: " + message;
|
|
|
|
if (typeof console !== 'undefined') {
|
|
console.warn(text);
|
|
}
|
|
|
|
try {
|
|
throw Error(text);
|
|
} catch (x) {}
|
|
}
|
|
}
|
|
|
|
export default warning;
|