Socket
Socket
Sign inDemoInstall

babel-plugin-debug-macros

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-debug-macros - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

36

dist/lib/utils/macros.js

@@ -115,20 +115,26 @@ 'use strict';

Object.keys(svelteMap[source]).forEach(function (flag) {
path.scope.getBinding(flag).referencePaths.forEach(function (p) {
if (envFlags.DEBUG) {
if (!svelteMap[source][flag]) {
var t = builder.t;
var binding = path.scope.getBinding(flag);
if (binding !== undefined) {
binding.referencePaths.forEach(function (p) {
if (envFlags.DEBUG) {
if (svelteMap[source][flag] === false) {
var t = builder.t;
var consequent = p.parentPath.get('consequent');
consequent.unshiftContainer('body', builder.t.throwStatement(t.newExpression(t.identifier('Error'), [t.stringLiteral(`You indicated you don't have any deprecations, however you are relying on ${flag}.`)])));
if (!p.parentPath.isIfStatement()) {
return;
}
var consequent = p.parentPath.get('consequent');
consequent.unshiftContainer('body', builder.t.throwStatement(t.newExpression(t.identifier('Error'), [t.stringLiteral(`You indicated you don't have any deprecations, however you are relying on ${flag}.`)])));
}
} else {
if (p.parentPath.isIfStatement()) {
p.replaceWith(builder.t.booleanLiteral(svelteMap[source][flag]));
}
}
} else {
var binding = path.scope.getBinding(flag);
if (binding) {
binding.referencePaths.forEach(function (p) {
return p.replaceWith(builder.t.booleanLiteral(svelteMap[source][flag]));
});
binding.path.remove();
}
});
if (!envFlags.DEBUG && binding) {
binding.path.remove();
}
});
}
});

@@ -135,0 +141,0 @@ });

@@ -13,3 +13,3 @@ {

"name": "babel-plugin-debug-macros",
"version": "0.1.1",
"version": "0.1.2",
"description": "Debug macros and feature flag stripping",

@@ -16,0 +16,0 @@ "main": "dist/index.js",

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