@putout/plugin-for-of 6.1.1 → 7.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/lib/for-entries-n/index.js +8 -2
- package/lib/for-n/index.js +1 -1
- package/package.json +5 -5
|
@@ -35,6 +35,14 @@ module.exports.filter = (path) => {
|
|
|
35
35
|
const [first] = body.body;
|
|
36
36
|
const {__i, __n} = getTemplateValues(path, forLoopToN);
|
|
37
37
|
|
|
38
|
+
const {
|
|
39
|
+
constantViolations,
|
|
40
|
+
references,
|
|
41
|
+
} = path.scope.bindings[__i.name];
|
|
42
|
+
|
|
43
|
+
if (constantViolations.length > 1)
|
|
44
|
+
return false;
|
|
45
|
+
|
|
38
46
|
if (!compare(first, assignIterable(__i)))
|
|
39
47
|
return false;
|
|
40
48
|
|
|
@@ -46,8 +54,6 @@ module.exports.filter = (path) => {
|
|
|
46
54
|
if (nBinding.references > 1)
|
|
47
55
|
return false;
|
|
48
56
|
|
|
49
|
-
const {references} = path.scope.bindings[__i.name];
|
|
50
|
-
|
|
51
57
|
return references > 3;
|
|
52
58
|
};
|
|
53
59
|
|
package/lib/for-n/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-for-of",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds ability to apply for...of",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"changelog": false,
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "git://github.com/coderaiser/putout.git"
|
|
14
|
+
"url": "git+https://github.com/coderaiser/putout.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "madrun test",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"@putout/plugin-remove-unused-variables": "*",
|
|
41
41
|
"@putout/plugin-remove-useless-arguments": "*",
|
|
42
42
|
"@putout/plugin-remove-useless-continue": "*",
|
|
43
|
-
"@putout/test": "^
|
|
43
|
+
"@putout/test": "^11.0.0",
|
|
44
44
|
"c8": "^10.0.0",
|
|
45
45
|
"eslint": "^9.0.0",
|
|
46
46
|
"eslint-plugin-n": "^17.0.0",
|
|
47
|
-
"eslint-plugin-putout": "^
|
|
47
|
+
"eslint-plugin-putout": "^23.0.0",
|
|
48
48
|
"lerna": "^6.0.1",
|
|
49
49
|
"madrun": "^10.0.0",
|
|
50
50
|
"montag": "^1.2.1",
|
|
51
51
|
"nodemon": "^3.0.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"putout": ">=
|
|
54
|
+
"putout": ">=37"
|
|
55
55
|
},
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"engines": {
|