tiny-warning
Advanced tools
Comparing version 0.0.1 to 0.0.2
'use strict'; | ||
var isProduction = process.env.NODE_ENV === 'production'; | ||
var index = (function (condition, message) { | ||
if (isProduction) { | ||
return; | ||
} | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (condition) { | ||
return; | ||
} | ||
if (condition) { | ||
return; | ||
console.warn(message); | ||
} | ||
console.warn(message); | ||
}); | ||
module.exports = index; |
var isProduction = process.env.NODE_ENV === 'production'; | ||
var index = (function (condition, message) { | ||
if (isProduction) { | ||
return; | ||
} | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (condition) { | ||
return; | ||
} | ||
if (condition) { | ||
return; | ||
console.warn(message); | ||
} | ||
console.warn(message); | ||
}); | ||
export default index; |
@@ -8,8 +8,9 @@ (function (global, factory) { | ||
var index = (function (condition, message) { | ||
{ | ||
if (condition) { | ||
return; | ||
} | ||
if (condition) { | ||
return; | ||
console.warn(message); | ||
} | ||
console.warn(message); | ||
}); | ||
@@ -16,0 +17,0 @@ |
@@ -1,1 +0,12 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.warning=n()}(this,function(){"use strict";return function(e,n){}}); | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.warning = factory()); | ||
}(this, (function () { 'use strict'; | ||
var index = (function (condition, message) { | ||
}); | ||
return index; | ||
}))); |
{ | ||
"name": "tiny-warning", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"keywords": [ | ||
@@ -30,16 +30,16 @@ "warning", | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"flow-bin": "^0.78.0", | ||
"jest": "^23.5.0", | ||
"prettier": "^1.14.2", | ||
"@babel/core": "^7.1.2", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-flow": "^7.0.0", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^23.6.0", | ||
"flow-bin": "^0.82.0", | ||
"jest": "^23.6.0", | ||
"prettier": "^1.14.3", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-babel": "^3.0.7", | ||
"rollup": "^0.66.2", | ||
"rollup-plugin-babel": "^4.0.3", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
"rollup-plugin-uglify": "^6.0.0" | ||
} | ||
} |
@@ -5,12 +5,11 @@ // @flow | ||
export default (condition: mixed, message: string) => { | ||
// in production: don't do anything | ||
if (isProduction) { | ||
return; | ||
// wrapping entire block for better dead code elimination | ||
if (process.env.NODE_ENV !== 'production') { | ||
// condition passed: do not log | ||
if (condition) { | ||
return; | ||
} | ||
// Condition not passed | ||
console.warn(message); | ||
} | ||
// condition passed: do not log | ||
if (condition) { | ||
return; | ||
} | ||
// Condition not passed | ||
console.warn(message); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3628
58