deprecatejs
Advanced tools
Comparing version 1.0.6 to 1.0.7
24
index.js
'use strict'; | ||
var isProduction = false; | ||
var deprecate = function(callback, message) { | ||
if (deprecate.production) { | ||
return callback; | ||
} | ||
if(isProduction) { | ||
return callback; | ||
} | ||
return function deprecateFn() { | ||
console.error('- Deprecation Warning! ' + ( message || '')); | ||
return callback.apply(null, arguments); | ||
}; | ||
}; | ||
return function deprecateFn () { | ||
console.error('- Deprecation Warning! ' + ( message || '')); | ||
return callback.apply(null, arguments); | ||
}; | ||
deprecate.inProduction = function() { | ||
deprecate.production = true; | ||
}; | ||
deprecate.inProduction = function () { | ||
isProduction = true; | ||
} | ||
deprecate.production = false; | ||
module.exports = deprecate; |
{ | ||
"name": "deprecatejs", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Wrapper to deprecate JavaScript functions. Displays a custom error message if consumers call a function you've marked as deprecated", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"lint": "./node_modules/eslint/bin/eslint.js *.js", | ||
"test": "./node_modules/mocha/bin/_mocha" | ||
}, | ||
@@ -21,3 +22,12 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/porchdotcom/deprecatejs#readme" | ||
"homepage": "https://github.com/porchdotcom/deprecatejs#readme", | ||
"devDependencies": { | ||
"babel-eslint": "^4.0.5", | ||
"chai": "^3.2.0", | ||
"eslint": "^0.24.1", | ||
"jasmine": "^2.3.1", | ||
"mocha": "^2.2.5", | ||
"sinon": "^1.15.4", | ||
"sinon-chai": "^2.8.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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
13664
7
79
1
7