New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-rename-import

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-rename-import - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

12

lib/index.js

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -9,3 +9,3 @@ Object.defineProperty(exports, "__esModule", {

function isModule(value, original) {
var pattern = new RegExp('^(' + original + '|' + original + '/.*)$');
var pattern = new RegExp("^(" + original + "|" + original + "/.*)$");
return pattern.test(value);

@@ -15,3 +15,3 @@ }

function replace(value, original, replacement) {
var pattern = new RegExp('^' + original);
var pattern = new RegExp("^" + original);
return value.replace(pattern, replacement);

@@ -40,4 +40,4 @@ }

replacement = _ref2.replacement;
var value = path.node.source.value;
var value = path.node.source.value;
if (isModule(value, original)) {

@@ -53,5 +53,5 @@ path.node.source = source(value, original, replacement);

replacement = _ref3.replacement;
var node = path.node;
var node = path.node;
if (node.callee.name === 'require' && node.arguments && node.arguments.length === 1 && t.isStringLiteral(node.arguments[0]) && isModule(node.arguments[0].value, original)) {
if (node.callee.name === "require" && node.arguments && node.arguments.length === 1 && t.isStringLiteral(node.arguments[0]) && isModule(node.arguments[0].value, original)) {
path.node.arguments = [source(node.arguments[0].value, original, replacement)];

@@ -58,0 +58,0 @@ }

{
"name": "babel-plugin-transform-rename-import",
"version": "2.1.0",
"version": "2.1.1",
"description": "Replace import sources",

@@ -12,3 +12,4 @@ "main": "lib/index",

"lint": "eslint src",
"prepublish": "npm run build"
"prepublish": "npm run build",
"precommit": "lint-staged"
},

@@ -25,2 +26,5 @@ "author": {

},
"lint-staged": {
"*.{js,json,css}": ["prettier --write", "git add"]
},
"devDependencies": {

@@ -33,11 +37,13 @@ "assert-simple-tap": "^2.0.1",

"babel-traverse": "^6.7.3",
"eslint": "^4.0.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint": "^4.6.1",
"eslint-config-airbnb-base": "^12.0.0",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-import": "^2.3.0",
"husky": "^0.14.3",
"lint-staged": "^4.1.3",
"npm-run-all": "^4.0.2",
"prettier": "^1.6.1",
"readme-assert": "^5.0.0"
},
"files": [
"lib"
]
"files": ["lib"]
}
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