@putout/plugin-esm 7.7.0 → 7.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ export const scan = (rootPath, {push, trackFile}) => {
63
63
 
64
64
  const importsTuples = getImports(file, content, ast);
65
65
 
66
- const [, privateImports] = getPrivateImports(file, {
66
+ const privateImports = getPrivateImports(file, {
67
67
  aliasBased: true,
68
68
  });
69
69
 
@@ -50,7 +50,7 @@ export const scan = (rootPath, {push, trackFile}) => {
50
50
  if (!content.includes('import'))
51
51
  continue;
52
52
 
53
- const [, privateImports] = getPrivateImports(file);
53
+ const privateImports = getPrivateImports(file);
54
54
 
55
55
  if (!privateImports.size)
56
56
  continue;
@@ -27,13 +27,13 @@ export const createGetPrivateImports = (importsCache = new Map(), emptyMap = new
27
27
  const {aliasBased = false} = options;
28
28
 
29
29
  if (importsCache.has(dir))
30
- return [dir, importsCache.get(dir)];
30
+ return importsCache.get(dir);
31
31
 
32
32
  const [packageDirectory, packagePath] = findFileUp(file, 'package.json');
33
33
 
34
34
  if (!packagePath) {
35
35
  importsCache.set(dir, emptyMap);
36
- return ['', emptyMap];
36
+ return emptyMap;
37
37
  }
38
38
 
39
39
  const packageContent = readFileContent(packagePath);
@@ -42,7 +42,7 @@ export const createGetPrivateImports = (importsCache = new Map(), emptyMap = new
42
42
  if (error) {
43
43
  importsCache.set(dir, emptyMap);
44
44
 
45
- return ['', emptyMap];
45
+ return emptyMap;
46
46
  }
47
47
 
48
48
  const {imports = {}} = packageJson;
@@ -62,9 +62,9 @@ export const createGetPrivateImports = (importsCache = new Map(), emptyMap = new
62
62
  });
63
63
  }
64
64
 
65
- importsCache.set(packageDirectory, importsEntries);
65
+ importsCache.set(dir, importsEntries);
66
66
 
67
- return [packageDirectory, importsEntries];
67
+ return importsEntries;
68
68
  };
69
69
 
70
70
  function parseProperty(property) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "7.7.0",
3
+ "version": "7.7.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin improves ability to transform ESM code",