Socket
Socket
Sign inDemoInstall

babel-plugin-feature-flags

Package Overview
Dependencies
0
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

test/fixtures/preserves-other-imports/expected.js

16

index.js

@@ -53,4 +53,18 @@ module.exports = function(options) {

if (removeImportDeclarations) {
var importName = options.import.name;
importDeclarations.forEach(function(node) {
node.dangerouslyRemove();
node.get('specifiers').forEach(function(specifier) {
if (specifier.isImportDefaultSpecifier() && importName === 'default') {
specifier.dangerouslyRemove();
} else if (specifier.isImportNamespaceSpecifier() && importName === '*') {
specifier.dangerouslyRemove();
} else if (specifier.isImportSpecifier() && importName === specifier.node.imported.name) {
specifier.dangerouslyRemove();
}
});
if (node.get('specifiers').length === 0) {
node.dangerouslyRemove();
}
});

@@ -57,0 +71,0 @@ }

2

package.json
{
"name": "babel-plugin-feature-flags",
"version": "0.1.0",
"version": "0.1.1",
"description": "A babel transform for managing feature flags",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -51,2 +51,3 @@ var assert = require('assert');

testFixture('nested/skipped-skipped', options);
testFixture('preserves-other-imports', options);
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc