@putout/printer 18.1.6 → 18.1.8

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
+ 2026.03.07, v18.1.8
2
+
3
+ feature:
4
+ - 35d83ea @putout/printer: type-checker: dsl inside array
5
+
6
+ 2026.03.07, v18.1.7
7
+
8
+ feature:
9
+ - 221c04e @putout/printer: ArrayExpression: one string
10
+
1
11
  2026.03.07, v18.1.6
2
12
 
3
13
  feature:
@@ -192,7 +192,16 @@ const isElementsMoreThenMaxWithFirstString = createTypeChecker([
192
192
  isElementsMoreThenMax,
193
193
  ]);
194
194
 
195
+ const isOne = (a) => a === 1;
196
+ const isBody = ({node, parentPath}) => node === parentPath.node.body;
197
+
198
+ const isBodyWithOneElement = createTypeChecker([
199
+ ['-: node.elements.length -> !', isOne],
200
+ ['+', isBody],
201
+ ]);
202
+
195
203
  export const isMultiLine = createTypeChecker([
204
+ ['+', isBodyWithOneElement],
196
205
  ['+', isMoreThenMaxElementLengthInOneLine],
197
206
  ['+', isElementsMoreThenMaxWithFirstString],
198
207
  isElementsMoreThenThreeWithNotFirstObject,
@@ -22,6 +22,14 @@ export function parseTypeNames(typeNames) {
22
22
 
23
23
  if (isArray(typeNames)) {
24
24
  for (const typeName of typeNames) {
25
+ if (isArray(typeName) && typeName.length === 1) {
26
+ const [first] = typeName;
27
+ const tuple = createTuple(first);
28
+
29
+ tuples.push(tuple);
30
+ continue;
31
+ }
32
+
25
33
  if (isArray(typeName)) {
26
34
  tuples.push(typeName);
27
35
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.1.6",
3
+ "version": "18.1.8",
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",