@putout/plugin-putout 18.6.0 → 19.0.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.
|
@@ -11,6 +11,7 @@ const {
|
|
|
11
11
|
ArrayPattern,
|
|
12
12
|
BlockStatement,
|
|
13
13
|
ObjectExpression,
|
|
14
|
+
ObjectPattern,
|
|
14
15
|
} = types;
|
|
15
16
|
|
|
16
17
|
module.exports = (rootPath, key) => {
|
|
@@ -91,8 +92,8 @@ function createVarStore(path) {
|
|
|
91
92
|
|
|
92
93
|
function objectify(path) {
|
|
93
94
|
const {parentPath} = path;
|
|
94
|
-
|
|
95
95
|
const isAssign = parentPath.isAssignmentExpression();
|
|
96
|
+
const isVar = parentPath.isVariableDeclarator();
|
|
96
97
|
|
|
97
98
|
if (path.parentPath.isExportDeclaration())
|
|
98
99
|
return replaceWith(path, ObjectExpression([]));
|
|
@@ -102,4 +103,7 @@ function objectify(path) {
|
|
|
102
103
|
|
|
103
104
|
if (isAssign && parentPath.get('right') === path)
|
|
104
105
|
return replaceWith(path, ObjectExpression([]));
|
|
106
|
+
|
|
107
|
+
if (isVar && parentPath.get('id') === path)
|
|
108
|
+
return replaceWith(path, ObjectPattern([]));
|
|
105
109
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
findFile: 'const {findFile} = operator',
|
|
5
5
|
renameFile: 'const {renameFile} = operator',
|
|
6
|
+
renameFiles: 'const {renameFiles} = operator',
|
|
6
7
|
removeFile: 'const {removeFile} = operator',
|
|
7
8
|
moveFile: 'const {moveFile} = operator',
|
|
8
9
|
createFile: 'const {createFile} = operator',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin helps with plugins development",
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@putout/plugin-tape": "*",
|
|
41
|
-
"@putout/test": "^
|
|
41
|
+
"@putout/test": "^9.0.0",
|
|
42
42
|
"c8": "^9.0.0",
|
|
43
|
-
"eslint": "^9.0.0
|
|
44
|
-
"eslint-plugin-n": "^
|
|
43
|
+
"eslint": "^9.0.0",
|
|
44
|
+
"eslint-plugin-n": "^17.0.0-0",
|
|
45
45
|
"eslint-plugin-putout": "^22.0.0",
|
|
46
46
|
"lerna": "^6.0.1",
|
|
47
47
|
"madrun": "^10.0.0",
|
|
48
48
|
"montag": "^1.2.1",
|
|
49
49
|
"nodemon": "^3.0.1",
|
|
50
|
-
"supertape": "^
|
|
50
|
+
"supertape": "^10.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"putout": ">=
|
|
53
|
+
"putout": ">=35"
|
|
54
54
|
},
|
|
55
55
|
"license": "MIT",
|
|
56
56
|
"engines": {
|