@putout/printer 6.5.0 → 6.7.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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.11.29, v6.7.0
2
+
3
+ feature:
4
+ - 0e3a3cc @putout/printer: nested arrays
5
+
6
+ 2023.11.28, v6.6.0
7
+
8
+ fix:
9
+ - 954cda8 @putout/printer: ArrayExpression: array inside array
10
+
1
11
  2023.11.28, v6.5.0
2
12
 
3
13
  feature:
@@ -21,7 +21,13 @@ const {
21
21
  } = types;
22
22
 
23
23
  const isNextObject = (a) => a.getNextSibling().isObjectExpression();
24
- const isArrayInsideArray = (path) => path.isArrayExpression() && path.parentPath.isArrayExpression();
24
+
25
+ const isArrayInsideArray = (path) => {
26
+ if (!path.isArrayExpression() || !path.parentPath.isArrayExpression())
27
+ return false;
28
+
29
+ return path.parentPath.node.elements.length <= 3;
30
+ };
25
31
 
26
32
  const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1;
27
33
  const isInsideArray = (path) => path.parentPath.isArrayExpression();
@@ -132,3 +138,4 @@ module.exports.ArrayExpression = {
132
138
  indent.inc();
133
139
  },
134
140
  };
141
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "6.5.0",
3
+ "version": "6.7.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",