@putout/plugin-putout 24.3.1 → 24.4.0

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.
@@ -17,6 +17,7 @@ export const traverse = ({push, listStore, pathStore}) => ({
17
17
  pathStore,
18
18
  push,
19
19
  names: [
20
+ '@putout/plugin-',
20
21
  './index.js',
21
22
  '../lib/index.js',
22
23
  ],
@@ -64,7 +65,7 @@ const createImportVisitor = ({push, names, pathStore = noop}) => ({
64
65
  return;
65
66
 
66
67
  for (const name of names) {
67
- if (value === name || name === 'any') {
68
+ if (value === name || value.startsWith(name) || name === 'any') {
68
69
  push({
69
70
  path,
70
71
  first,
@@ -57,12 +57,16 @@ export const traverse = ({push, options}) => {
57
57
  };
58
58
 
59
59
  function getProperties(path) {
60
- const props = `body.properties`;
61
-
62
- if (path.isExportNamedDeclaration())
63
- return path.get(`declaration.declarations.0.init.${props}`);
60
+ if (path.isExportNamedDeclaration()) {
61
+ const bodyPath = path.get('declaration.declarations.0.init.body');
62
+
63
+ if (bodyPath.isObjectExpression())
64
+ return bodyPath.get(`properties`);
65
+
66
+ return [];
67
+ }
64
68
 
65
- return path.get(`right.${props}`);
69
+ return path.get(`right.body.properties`);
66
70
  }
67
71
 
68
72
  const createTraverseReplacer = ({once, push}) => (path) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "24.3.1",
3
+ "version": "24.4.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",
@@ -45,7 +45,7 @@
45
45
  "@putout/eslint-flat": "^3.0.0",
46
46
  "@putout/plugin-nodejs": "*",
47
47
  "@putout/plugin-tape": "*",
48
- "@putout/test": "^12.0.0",
48
+ "@putout/test": "^13.0.0",
49
49
  "c8": "^10.0.0",
50
50
  "chalk": "^5.3.0",
51
51
  "eslint": "^9.0.0",
@@ -54,7 +54,7 @@
54
54
  "madrun": "^11.0.0",
55
55
  "montag": "^1.2.1",
56
56
  "nodemon": "^3.0.1",
57
- "supertape": "^10.0.0"
57
+ "supertape": "^11.0.3"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "putout": ">=39"