@putout/printer 11.13.0 → 11.14.0
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
|
@@ -10,8 +10,8 @@ const {maybeParens} = require('../../maybe/maybe-parens');
|
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
isUnaryExpression,
|
|
13
|
-
isArrowFunctionExpression,
|
|
14
13
|
isIfStatement,
|
|
14
|
+
isCallExpression,
|
|
15
15
|
} = types;
|
|
16
16
|
|
|
17
17
|
const isArgOfCall = (path) => path.parentPath.isCallExpression() && path.parentPath.get('arguments.0') === path;
|
|
@@ -68,11 +68,13 @@ module.exports.OptionalMemberExpression = maybeParens((path, {print, maybe}) =>
|
|
|
68
68
|
|
|
69
69
|
const isCall = (a) => a.type === 'CallExpression';
|
|
70
70
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
const isPathGet = (property) => {
|
|
72
|
+
return isCallExpression(property, {
|
|
73
|
+
name: 'get',
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const isExcludedFromChain = satisfy([isUnaryExpression, isIfStatement]);
|
|
76
78
|
|
|
77
79
|
const isIfUp = (path) => {
|
|
78
80
|
const ifPath = path.find(isIfStatement);
|
|
@@ -102,6 +104,9 @@ function likeChain(path) {
|
|
|
102
104
|
if (isExcludedFromChain(root))
|
|
103
105
|
return false;
|
|
104
106
|
|
|
107
|
+
if (properties.find(isPathGet))
|
|
108
|
+
return false;
|
|
109
|
+
|
|
105
110
|
if (path.find(isIfUp))
|
|
106
111
|
return false;
|
|
107
112
|
|
package/package.json
CHANGED