deprecatejs
Advanced tools
Comparing version 1.0.5 to 1.0.6
10
index.js
'use strict'; | ||
module.exports = function (callback, message, isProduction) { | ||
var isProduction = false; | ||
var deprecate = function(callback, message) { | ||
if(isProduction) { | ||
@@ -15,1 +17,7 @@ return callback; | ||
}; | ||
deprecate.inProduction = function () { | ||
isProduction = true; | ||
} | ||
module.exports = deprecate; |
{ | ||
"name": "deprecatejs", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Wrapper to deprecate JavaScript functions. Displays a custom error message if consumers call a function you've marked as deprecated", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,8 +35,13 @@ # DeprecateJS | ||
var deprecate = require('deprecatejs'); | ||
var environment = process.env.NODE_ENV; | ||
var environment = process.env.NODE_ENV; | ||
// Disable logging in production. | ||
if (environment === 'production') { | ||
deprecate.inProduction(); | ||
} | ||
module.exports = { | ||
oldFunc: deprecate(function (str) { | ||
console.log(str); | ||
}, 'Please use newFunc instead', environment === 'production'), | ||
}, 'Please use newFunc instead'), | ||
newFunc: function (str) { | ||
@@ -43,0 +48,0 @@ ... |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2122
15
59
0