@putout/printer 18.1.3 → 18.1.4

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.06, v18.1.4
2
+
3
+ fix:
4
+ - 27872ca @putout/printer: ArrayExpression: newline: string and object
5
+
1
6
  2026.03.06, v18.1.3
2
7
 
3
8
  fix:
@@ -160,9 +160,17 @@ const isMoreThenMaxIdentifierLength = (path, {maxElementLengthInOneLine}) => {
160
160
  return first.name.length > maxElementLengthInOneLine;
161
161
  };
162
162
 
163
+ const hasObjects = (path) => {
164
+ const {elements} = path.node;
165
+ const literals = elements.filter(isObjectExpression);
166
+
167
+ return literals.length;
168
+ };
169
+
163
170
  const isMoreThenMaxElementLengthInOneLine = createTypeChecker([
164
171
  ['-', isEmptyArray],
165
172
  ['-: -> !', isInsideCall],
173
+ ['-', hasObjects],
166
174
  ['+', isMoreThenMaxLiteralLength],
167
175
  ['+', isMoreThenMaxIdentifierLength],
168
176
  ]);
@@ -1,7 +1,7 @@
1
1
  import {createTuple} from './create-tuple.js';
2
2
 
3
- const {isArray} = Array;
4
3
  const isString = (a) => typeof a === 'string';
4
+ const {isArray} = Array;
5
5
 
6
6
  export const parseOperation = (operation) => {
7
7
  const [result, command] = operation.split(':');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.1.3",
3
+ "version": "18.1.4",
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",