@putout/printer 8.29.0 → 8.30.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
+ 2024.05.02, v8.30.0
2
+
3
+ feature:
4
+ - 9a3ea75 @putout/printer: ArrayExpression: tuple: call
5
+
1
6
  2024.05.02, v8.29.0
2
7
 
3
8
  feature:
@@ -27,6 +27,7 @@ const {
27
27
  isStringLiteral,
28
28
  isIdentifier,
29
29
  isArrayExpression,
30
+ isCallExpression,
30
31
  } = types;
31
32
 
32
33
  const isNextString = (path) => isStringLiteral(path.getNextSibling());
@@ -44,10 +45,20 @@ const isObjectAfterArray = (a) => {
44
45
  return isNextObject(a);
45
46
  };
46
47
 
48
+ const isObjectAfterCall = (a) => {
49
+ if (!isCallExpression(a))
50
+ return false;
51
+
52
+ return isNextObject(a);
53
+ };
54
+
47
55
  const isObjectAfterSimple = (a) => {
48
56
  if (isObjectAfterArray(a))
49
57
  return true;
50
58
 
59
+ if (isObjectAfterCall(a))
60
+ return true;
61
+
51
62
  return isObjectAfterSpread(a) || isObjectAfterIdentifier(a);
52
63
  };
53
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "8.29.0",
3
+ "version": "8.30.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",