Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deprecatejs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecatejs - npm Package Compare versions

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;

2

package.json
{
"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 @@ ...

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc