@putout/printer 6.5.0 → 6.6.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,8 @@
1
+ 2023.11.28, v6.6.0
2
+
3
+ fix:
4
+ - 954cda8 @putout/printer: ArrayExpression: array inside array
5
+
1
6
  2023.11.28, v6.5.0
2
7
 
3
8
  feature:
@@ -21,7 +21,12 @@ const {
21
21
  } = types;
22
22
 
23
23
  const isNextObject = (a) => a.getNextSibling().isObjectExpression();
24
- const isArrayInsideArray = (path) => path.isArrayExpression() && path.parentPath.isArrayExpression();
24
+ const isArrayInsideArray = (path) => {
25
+ if (!path.isArrayExpression() || !path.parentPath.isArrayExpression())
26
+ return false;
27
+
28
+ return path === path.parentPath.get('elements').at(-1);
29
+ };
25
30
 
26
31
  const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1;
27
32
  const isInsideArray = (path) => path.parentPath.isArrayExpression();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "6.5.0",
3
+ "version": "6.6.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",