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

babel-plugin-debug-macros

Package Overview
Dependencies
Maintainers
2
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.2.0-beta.6 to 0.2.0

2

package.json

@@ -15,3 +15,3 @@ {

"name": "babel-plugin-debug-macros",
"version": "0.2.0-beta.6",
"version": "0.2.0",
"description": "Debug macros and feature flag stripping",

@@ -18,0 +18,0 @@ "main": "src/index.js",

@@ -9,3 +9,2 @@ 'use strict';

let t = babel.types;
let options;

@@ -31,5 +30,5 @@ function buildIdentifier(value, name) {

visitor: {
ImportSpecifier(path) {
ImportSpecifier(path, state) {
let importPath = path.parent.source.value;
let flagsForImport = options.flags[importPath];
let flagsForImport = state.opts.flags[importPath];

@@ -63,5 +62,5 @@ if (flagsForImport) {

ImportDeclaration: {
exit(path) {
exit(path, state) {
let importPath = path.node.source.value;
let flagsForImport = options.flags[importPath];
let flagsForImport = state.opts.flags[importPath];

@@ -77,4 +76,4 @@ // remove flag source imports when no specifiers are left

enter(path, state) {
options = normalizeOptions(state.opts);
this.macroBuilder = new Macros(babel, options);
state.opts = normalizeOptions(state.opts);
this.macroBuilder = new Macros(babel, state.opts);

@@ -87,6 +86,10 @@ let body = path.get('body');

let debugToolsImport = options.debugTools.debugToolsImport;
let debugToolsImport = state.opts.debugTools.debugToolsImport;
if (debugToolsImport && debugToolsImport === importPath) {
this.macroBuilder.collectDebugToolsSpecifiers(item.get('specifiers'));
if (!item.node.specifiers.length) {
item.remove();
} else {
this.macroBuilder.collectDebugToolsSpecifiers(item.get('specifiers'));
}
}

@@ -93,0 +96,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