babel-plugin-demand-importer
Advanced tools
Comparing version 1.0.2 to 1.0.4
{ | ||
"name": "babel-plugin-demand-importer", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,14 +9,6 @@ const types = require('babel-types'); | ||
if (opts.libraryName == node.source.value && !types.isImportDeclaration(specifiers[0])) { | ||
let libraryDirectory = opts.libraryDirectory; | ||
let libraryDirectory = (opts.libraryDirectory || '').split('/').filter((v) => v).join('/'); | ||
if (libraryDirectory) { | ||
if (libraryDirectory.startsWith('/')) { | ||
libraryDirectory = libraryDirectory.replace(/^\//, ''); | ||
} | ||
if (!libraryDirectory.endsWith('/')) { | ||
libraryDirectory += '/'; | ||
} | ||
libraryDirectory += '/'; | ||
} | ||
if (libraryDirectory === '/') { | ||
libraryDirectory = ''; | ||
} | ||
let newImport = specifiers.map((specifier) => { | ||
@@ -23,0 +15,0 @@ return types.importDeclaration( |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
2092
3
23
1