@putout/printer 18.0.14 → 18.0.15

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.0.15
2
+
3
+ feature:
4
+ - 22d510e @putout/printer: ObjectExpression: isLogicalArgument
5
+
1
6
  2026.03.06, v18.0.14
2
7
 
3
8
  feature:
@@ -32,10 +32,12 @@ const notLastArgInsideCall = (path) => {
32
32
  const hasNoProperties = (path) => !path.node.properties.length;
33
33
  const hasValue = (path) => path.node.properties[0].value;
34
34
 
35
- const {isMemberExpression} = types;
36
-
37
- const isLogical = (path) => path.get('argument').isLogicalExpression();
35
+ const {
36
+ isMemberExpression,
37
+ isLogicalExpression,
38
+ } = types;
38
39
 
40
+ const isLogicalArgument = (path) => isLogicalExpression(path.node.argument);
39
41
  const isParens = createTypeChecker([isInsideBody, isInsideExpression]);
40
42
  const getCallee = (fn) => (a) => fn(a.get('callee'));
41
43
 
@@ -97,7 +99,7 @@ export const ObjectExpression = (path, printer, semantics) => {
97
99
 
98
100
  for (const [index, property] of properties.entries()) {
99
101
  if (property.isSpreadElement()) {
100
- const logical = isLogical(property);
102
+ const logical = isLogicalArgument(property);
101
103
 
102
104
  if (noLeadingComment(property))
103
105
  maybe.indent(length > 1 || logical || manyLines);
@@ -147,3 +149,4 @@ const hasNextLeadingComment = (path) => {
147
149
 
148
150
  return hasLeadingComment(next);
149
151
  };
152
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.0.14",
3
+ "version": "18.0.15",
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",