@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
|
@@ -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 {
|
|
36
|
-
|
|
37
|
-
|
|
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 =
|
|
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