@putout/printer 18.1.6 → 18.1.7

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.03.07, v18.1.7
2
+
3
+ feature:
4
+ - 221c04e @putout/printer: ArrayExpression: one string
5
+
1
6
  2026.03.07, v18.1.6
2
7
 
3
8
  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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.1.6",
3
+ "version": "18.1.7",
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",