@putout/printer 18.47.2 → 18.47.3

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
+ 2026.10.03, v18.47.3
2
+
3
+ feature:
4
+ - 8be3bb39 @putout/printer: CallExpression: isCommaAfterArg
5
+
1
6
  2026.10.03, v18.47.2
2
7
 
3
8
  feature:
@@ -70,6 +70,12 @@ const isBreaklineAfterArg = createTypeChecker([
70
70
  ['+: parentPath.node.arguments.length', '>', 1],
71
71
  ]);
72
72
 
73
+ const isCommaAfterArg = createTypeChecker([
74
+ ['+', isMaxArgs],
75
+ ['-: node.arguments.length', '<=', 1],
76
+ ['+', isMultiline],
77
+ ]);
78
+
73
79
  function printArgs(path, printer, semantics) {
74
80
  const args = parseArgs(path);
75
81
  const maxArgs = isMaxArgs(path, semantics);
@@ -94,7 +100,7 @@ function printArgs(path, printer, semantics) {
94
100
 
95
101
  print(arg);
96
102
 
97
- if (multiline && (n || maxArgs)) {
103
+ if (isCommaAfterArg(path, semantics)) {
98
104
  print(',');
99
105
  continue;
100
106
  }
@@ -122,3 +128,4 @@ function tooLong(path) {
122
128
 
123
129
  return false;
124
130
  }
131
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.47.2",
3
+ "version": "18.47.3",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",