@putout/plugin-destructuring 1.4.2 → 2.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.
- package/README.md +1 -1
- package/lib/merge-properties/index.js +8 -0
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @putout/plugin-destructuring [![NPM version][NPMIMGURL]][NPMURL]
|
|
2
2
|
|
|
3
3
|
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-destructuring.svg?style=flat&longCache=true
|
|
4
|
-
[NPMURL]: https://npmjs.org/package/@putout/plugin-destructuring"npm"
|
|
4
|
+
[NPMURL]: https://npmjs.org/package/@putout/plugin-destructuring "npm"
|
|
5
5
|
|
|
6
6
|
> The **destructuring** assignment syntax is a **JavaScript** expression that makes it possible to unpack values from `arrays`, or `properties` from `objects`, into distinct `variables`.
|
|
7
7
|
>
|
|
@@ -108,6 +108,14 @@ const addVariable = ({store}) => (path, node) => {
|
|
|
108
108
|
if (parentPath.removed || !parentPath.node)
|
|
109
109
|
return;
|
|
110
110
|
|
|
111
|
+
const {left} = split(path);
|
|
112
|
+
const {left: currentLeft} = split(currentPath);
|
|
113
|
+
const [leftProperty] = left.properties;
|
|
114
|
+
const [currentLeftProperty] = currentLeft.properties;
|
|
115
|
+
|
|
116
|
+
if (leftProperty.key.name === currentLeftProperty.key.name)
|
|
117
|
+
return;
|
|
118
|
+
|
|
111
119
|
const name = RIGHT[type];
|
|
112
120
|
|
|
113
121
|
if (isAssignmentExpression(currentPath) && compare(currentPath.node[name], node))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-destructuring",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds ability to transform destructuring",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"destructuring"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@putout/eslint-flat": "^4.0.0",
|
|
34
35
|
"@putout/plugin-declare": "*",
|
|
35
36
|
"@putout/plugin-declare-before-reference": "*",
|
|
36
37
|
"@putout/plugin-esm": "*",
|
|
@@ -40,20 +41,20 @@
|
|
|
40
41
|
"@putout/plugin-putout": "*",
|
|
41
42
|
"@putout/plugin-tape": "*",
|
|
42
43
|
"@putout/plugin-variables": "*",
|
|
43
|
-
"@putout/test": "^
|
|
44
|
+
"@putout/test": "^15.0.0",
|
|
44
45
|
"c8": "^10.0.0",
|
|
45
|
-
"eslint": "^10.0.0
|
|
46
|
+
"eslint": "^10.0.0",
|
|
46
47
|
"eslint-plugin-n": "^17.0.0",
|
|
47
|
-
"eslint-plugin-putout": "^
|
|
48
|
-
"madrun": "^
|
|
48
|
+
"eslint-plugin-putout": "^31.0.0",
|
|
49
|
+
"madrun": "^13.0.0",
|
|
49
50
|
"nodemon": "^3.0.1"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"putout": ">=
|
|
53
|
+
"putout": ">=42"
|
|
53
54
|
},
|
|
54
55
|
"license": "MIT",
|
|
55
56
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
57
|
+
"node": ">=22"
|
|
57
58
|
},
|
|
58
59
|
"publishConfig": {
|
|
59
60
|
"access": "public"
|