Socket
Socket
Sign inDemoInstall

@talend/babel-plugin-import-from-index

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@talend/babel-plugin-import-from-index - npm Package Compare versions

Comparing version 1.4.0-alpha.2 to 1.4.0-alpha.3

2

package.json
{
"name": "@talend/babel-plugin-import-from-index",
"version": "1.4.0-alpha.2",
"version": "1.4.0-alpha.3",
"description": "Transform default imports from specific path to named import from index",

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

@@ -80,3 +80,3 @@ const PACKAGES = ['@talend/react-components', 'lodash', 'react-bootstrap', 'redux-saga'];

first = true;
addConst[packageName] = [];
addConst[packageName] = {};
}

@@ -88,3 +88,3 @@ if (!addConst[packageName][lastName]) {

// only one default
if (first) {
if (!first) {
return types.importSpecifier(

@@ -101,5 +101,5 @@ types.identifier(lastName),

return types.importSpecifier(
types.identifier(localName),
types.identifier(importedName),
);
types.identifier(localName),
types.identifier(importedName),
);
}),

@@ -106,0 +106,0 @@ );

@@ -10,28 +10,30 @@ import pluginTester from 'babel-plugin-tester';

code: `
import { take, put } from 'redux-saga/effects';`,
import { take, put } from 'redux-saga/effects';
import { createMockTask } from 'redux-saga/utils';`,
output: `
import { effects } from 'redux-saga';
const { take, put } = effects;`
import { effects, utils } from 'redux-saga';
const { createMockTask } = utils;
const { take, put } = effects;`,
},
{
code: `
import get from 'lodash/get';`,
import get from 'lodash/get';`,
output: `
import { get } from 'lodash';`
import { get } from 'lodash';`,
},
{
code: `
import _get from 'lodash/get';`,
import _get from 'lodash/get';`,
output: `
import { get as _get } from 'lodash';`
import { get as _get } from 'lodash';`,
},
{
code: `
import React from 'react';
import { SidePanel } from '@talend/react-components';
import Actions, { ActionButton, ActionDropdown } from '@talend/react-components/lib/actions';
import List from '@talend/react-components/lib/List';`,
import React from 'react';
import { SidePanel } from '@talend/react-components';
import Actions, { ActionButton, ActionDropdown } from '@talend/react-components/lib/actions';
import List from '@talend/react-components/lib/List';`,
output: `
import React from 'react';
import { SidePanel, Actions, ActionButton, ActionDropdown, List } from '@talend/react-components';`,
import React from 'react';
import { SidePanel, Actions, ActionButton, ActionDropdown, List } from '@talend/react-components';`,
},

@@ -44,8 +46,8 @@ {

code: `
import React from 'react';
import { SidePanel } from '@talend/react-components';
import { ModelViewer as ModelViewerComponent } from '@talend/react-components';`,
import React from 'react';
import { SidePanel } from '@talend/react-components';
import { ModelViewer as ModelViewerComponent } from '@talend/react-components';`,
output: `
import React from 'react';
import { SidePanel, ModelViewer as ModelViewerComponent } from '@talend/react-components';`,
import React from 'react';
import { SidePanel, ModelViewer as ModelViewerComponent } from '@talend/react-components';`,
},

@@ -72,9 +74,10 @@ {

code: "import ResourcePickerComponent from '@talend/react-components/lib/ResourcePicker';",
output: "import { ResourcePicker as ResourcePickerComponent } from '@talend/react-components';"
output:
"import { ResourcePicker as ResourcePickerComponent } from '@talend/react-components';",
},
{
code: "import Foo from '@talend/react-components/lib/Bar/Foo';",
output: "import Foo from '@talend/react-components/lib/Bar/Foo';"
output: "import Foo from '@talend/react-components/lib/Bar/Foo';",
},
],
});
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