@putout/plugin-printer 8.13.0 → 8.14.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.
|
@@ -40,11 +40,13 @@ export const traverse = ({push}) => ({
|
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const isCountElementsTuple = (count) => (a) => {
|
|
44
44
|
if (!isArrayExpression(a))
|
|
45
45
|
return false;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
const {length} = a.node.elements;
|
|
48
|
+
|
|
49
|
+
return length === count;
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
function isConsistent(elements) {
|
|
@@ -58,5 +60,8 @@ function isConsistent(elements) {
|
|
|
58
60
|
if (elements.length === identifiersCount)
|
|
59
61
|
return true;
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
if (elements.filter(isCountElementsTuple(3)).length)
|
|
64
|
+
return true;
|
|
65
|
+
|
|
66
|
+
return elements.filter(isCountElementsTuple(2)).length;
|
|
62
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-printer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds support of transformations for @putout/printer",
|