@putout/printer 18.7.5 → 18.7.7
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
|
@@ -15,7 +15,6 @@ const isPathGet = ([property]) => {
|
|
|
15
15
|
const {
|
|
16
16
|
isIfStatement,
|
|
17
17
|
isCallExpression,
|
|
18
|
-
isIdentifier,
|
|
19
18
|
} = types;
|
|
20
19
|
|
|
21
20
|
const isPathFirstArg = ({node, parentPath}) => {
|
|
@@ -48,18 +47,12 @@ const isExcludedFromChain = createTypeChecker([
|
|
|
48
47
|
|
|
49
48
|
const hasComment = ({type}) => type === 'CommentLine';
|
|
50
49
|
|
|
51
|
-
const isInsideMemberCall = (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (isLastArgInCall(path))
|
|
59
|
-
return true;
|
|
60
|
-
|
|
61
|
-
return isCallExpression(path.parentPath.parentPath);
|
|
62
|
-
};
|
|
50
|
+
const isInsideMemberCall = createTypeChecker([
|
|
51
|
+
['-: node.object -> !Identifier'],
|
|
52
|
+
['-: node.property -> !Identifier'],
|
|
53
|
+
['+', isLastArgInCall],
|
|
54
|
+
['+: parentPath.parentPath -> CallExpression'],
|
|
55
|
+
]);
|
|
63
56
|
|
|
64
57
|
const callWithProperties = (fn) => (a, {properties}) => fn(properties);
|
|
65
58
|
const isFindUpIf = (path) => path.find(isIfUp);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {types} from '@putout/babel';
|
|
2
1
|
import {maybeParens} from '#maybe-parens';
|
|
2
|
+
import {createTypeChecker} from '#type-checker';
|
|
3
3
|
import {maybePrintComputed} from '../object-expression/maybe-print-computed.js';
|
|
4
4
|
import {isLooksLikeChain} from './is-looks-like-chain.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const isObjectInsideArrow = createTypeChecker([
|
|
7
|
+
'-: node.object -> !ObjectExpression',
|
|
8
|
+
'+: parentPath -> ArrowFunctionExpression',
|
|
9
|
+
]);
|
|
10
10
|
|
|
11
11
|
export const MemberExpression = maybeParens({
|
|
12
12
|
checkParens: false,
|
|
@@ -56,10 +56,3 @@ export const OptionalMemberExpression = maybeParens((path, {print, maybe}) => {
|
|
|
56
56
|
|
|
57
57
|
print('__property');
|
|
58
58
|
});
|
|
59
|
-
|
|
60
|
-
const isObjectInsideArrow = ({node, parentPath}) => {
|
|
61
|
-
if (!isObjectExpression(node.object))
|
|
62
|
-
return false;
|
|
63
|
-
|
|
64
|
-
return isArrowFunctionExpression(parentPath);
|
|
65
|
-
};
|
package/package.json
CHANGED