@putout/printer 18.8.4 → 18.8.5

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.20, v18.8.5
2
+
3
+ feature:
4
+ - a9df5bc7 @putout/printer: ObjectPattern: shouldAddNewline: simplify
5
+
1
6
  2026.03.20, v18.8.4
2
7
 
3
8
  feature:
@@ -8,6 +8,7 @@ import {
8
8
  } from './has.js';
9
9
 
10
10
  const getMaxPropertiesInOneLine = (a, {maxPropertiesInOneLine}) => maxPropertiesInOneLine;
11
+ const getValue = (a) => a.value;
11
12
 
12
13
  const isMoreCountLessLength = createTypeChecker([
13
14
  ['-: node.properties.length', '>', getMaxPropertiesInOneLine],
@@ -67,21 +68,14 @@ function isCoupleAssigns(path) {
67
68
  if (isFunctionParam(path))
68
69
  return false;
69
70
 
70
- let assignsCount = 0;
71
-
72
- for (const property of path.node.properties) {
73
- if (!isObjectProperty(property))
74
- continue;
75
-
76
- if (isAssignmentPattern(property.value))
77
- ++assignsCount;
78
- }
71
+ const properties = path.node.properties
72
+ .filter(isObjectProperty)
73
+ .map(getValue)
74
+ .filter(isAssignmentPattern);
79
75
 
80
- return assignsCount > 1;
76
+ return properties.length > 1;
81
77
  }
82
78
 
83
- const getValue = (a) => a.value;
84
-
85
79
  function checkLength(path) {
86
80
  const identifiers = path
87
81
  .node
@@ -105,4 +99,3 @@ function hasComputed(path) {
105
99
 
106
100
  return false;
107
101
  }
108
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.8.4",
3
+ "version": "18.8.5",
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",