@teleporthq/teleport-plugin-import-statements
Advanced tools
Comparing version
@@ -100,2 +100,3 @@ "use strict"; | ||
.forEach(function (key) { | ||
var _a, _b, _c, _d; | ||
var dep = dependencies[key]; | ||
@@ -106,3 +107,6 @@ // Should not be the case at this point | ||
} | ||
if (!result[dep.path]) { | ||
if ((_a = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _a === void 0 ? void 0 : _a.importAlias) { | ||
result[dep.meta.importAlias] = []; | ||
} | ||
if (!((_b = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _b === void 0 ? void 0 : _b.importAlias) && !result[dep.path]) { | ||
result[dep.path] = []; // Initialize the dependencies from this path | ||
@@ -113,3 +117,3 @@ } | ||
var originalName = dep.meta && dep.meta.originalName ? dep.meta.originalName : key; | ||
result[dep.path].push({ | ||
result[(_d = (_c = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _c === void 0 ? void 0 : _c.importAlias) !== null && _d !== void 0 ? _d : dep.path].push({ | ||
identifierName: key, | ||
@@ -116,0 +120,0 @@ namedImport: namedImport, |
@@ -96,2 +96,3 @@ var __assign = (this && this.__assign) || function () { | ||
.forEach(function (key) { | ||
var _a, _b, _c, _d; | ||
var dep = dependencies[key]; | ||
@@ -102,3 +103,6 @@ // Should not be the case at this point | ||
} | ||
if (!result[dep.path]) { | ||
if ((_a = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _a === void 0 ? void 0 : _a.importAlias) { | ||
result[dep.meta.importAlias] = []; | ||
} | ||
if (!((_b = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _b === void 0 ? void 0 : _b.importAlias) && !result[dep.path]) { | ||
result[dep.path] = []; // Initialize the dependencies from this path | ||
@@ -109,3 +113,3 @@ } | ||
var originalName = dep.meta && dep.meta.originalName ? dep.meta.originalName : key; | ||
result[dep.path].push({ | ||
result[(_d = (_c = dep === null || dep === void 0 ? void 0 : dep.meta) === null || _c === void 0 ? void 0 : _c.importAlias) !== null && _d !== void 0 ? _d : dep.path].push({ | ||
identifierName: key, | ||
@@ -112,0 +116,0 @@ namedImport: namedImport, |
{ | ||
"name": "@teleporthq/teleport-plugin-import-statements", | ||
"version": "0.22.0", | ||
"version": "0.23.0", | ||
"description": "A plugin for handling import statements in JavaScript code", | ||
@@ -27,6 +27,6 @@ "author": "teleportHQ", | ||
"dependencies": { | ||
"@teleporthq/teleport-plugin-common": "^0.22.0", | ||
"@teleporthq/teleport-types": "^0.22.0" | ||
"@teleporthq/teleport-plugin-common": "^0.23.0", | ||
"@teleporthq/teleport-types": "^0.23.0" | ||
}, | ||
"gitHead": "d89d91377a8a2bd5e2771d12b713567cba5a04c1" | ||
"gitHead": "8d528aa48896a0163a42ebadd7df3fe6e5f47d41" | ||
} |
@@ -88,3 +88,7 @@ import { ASTBuilders } from '@teleporthq/teleport-plugin-common' | ||
if (!result[dep.path]) { | ||
if (dep?.meta?.importAlias) { | ||
result[dep.meta.importAlias] = [] | ||
} | ||
if (!dep?.meta?.importAlias && !result[dep.path]) { | ||
result[dep.path] = [] // Initialize the dependencies from this path | ||
@@ -97,3 +101,3 @@ } | ||
result[dep.path].push({ | ||
result[dep?.meta?.importAlias ?? dep.path].push({ | ||
identifierName: key, | ||
@@ -100,0 +104,0 @@ namedImport, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73902
2.26%451
2.5%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed