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

babel-plugin-import

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-import - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

32

lib/Plugin.js

@@ -10,2 +10,4 @@ "use strict";

var _babelHelperModuleImports = require("babel-helper-module-imports");
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

@@ -62,19 +64,19 @@

// disable selectedMethods cache, it don't work in babel7
if (true
/* !this.selectedMethods[methodName] */
) {
var libraryDirectory = this.libraryDirectory;
var style = this.style;
var transformedMethodName = this.camel2UnderlineComponentName // eslint-disable-line
? camel2Underline(methodName) : this.camel2DashComponentName ? camel2Dash(methodName) : methodName;
var path = winPath(this.customName ? this.customName(transformedMethodName) : (0, _path.join)(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
);
this.selectedMethods[methodName] = file.addImport(path, 'default');
if (!this.selectedMethods[methodName]) {
var libraryDirectory = this.libraryDirectory;
var style = this.style;
var transformedMethodName = this.camel2UnderlineComponentName // eslint-disable-line
? camel2Underline(methodName) : this.camel2DashComponentName ? camel2Dash(methodName) : methodName;
var path = winPath(this.customName ? this.customName(transformedMethodName) : (0, _path.join)(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
);
this.selectedMethods[methodName] = (0, _babelHelperModuleImports.addDefault)(file.path, path, {
nameHint: methodName
});
if (style === true) {
file.addImport("".concat(path, "/style"), 'style');
} else if (style === 'css') {
file.addImport("".concat(path, "/style/css"), 'style');
}
if (style === true) {
(0, _babelHelperModuleImports.addSideEffect)(file.path, "".concat(path, "/style"));
} else if (style === 'css') {
(0, _babelHelperModuleImports.addSideEffect)(file.path, "".concat(path, "/style/css"));
}
}

@@ -81,0 +83,0 @@ return this.selectedMethods[methodName];

{
"name": "babel-plugin-import",
"version": "1.6.1",
"version": "1.6.2",
"description": "Component modular import plugin for babel.",

@@ -31,2 +31,3 @@ "repository": {

"babel-plugin-add-module-exports": "^0.1.2",
"babel-polyfill": "^7.0.0-beta.3",
"babel-preset-es2015": "^7.0.0-beta.2",

@@ -58,3 +59,6 @@ "babel-preset-react": "^7.0.0-beta.2",

"README.md"
]
],
"dependencies": {
"babel-helper-module-imports": "^7.0.0-beta.3"
}
}
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