@putout/printer 15.9.1 → 15.10.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
@@ -1,3 +1,8 @@
1
+ 2025.07.04, v15.10.0
2
+
3
+ feature:
4
+ - 38782c7 @putout/printer: MemberExpresison: both identifiers inside nested MemberExpression call
5
+
1
6
  2025.07.03, v15.9.1
2
7
 
3
8
  feature:
@@ -88,4 +88,3 @@ module.exports.printTrailingComments = (path, printer, semantics, {currentTraver
88
88
  });
89
89
  }
90
90
  };
91
-
@@ -8,6 +8,7 @@ const {
8
8
  isUnaryExpression,
9
9
  isIfStatement,
10
10
  isCallExpression,
11
+ isIdentifier,
11
12
  } = types;
12
13
 
13
14
  const isArgOfCall = (path) => path.parentPath?.isCallExpression() && path.parentPath.get('arguments.0') === path;
@@ -16,9 +17,22 @@ const isCall = (a) => a.type === 'CallExpression';
16
17
  const isExcludedFromChain = satisfy([isUnaryExpression, isIfStatement]);
17
18
  const hasComment = ({type}) => type === 'CommentLine';
18
19
 
20
+ const isInsideMemberCall = (path) => {
21
+ if (!isIdentifier(path.node.object))
22
+ return false;
23
+
24
+ if (!isIdentifier(path.node.property))
25
+ return false;
26
+
27
+ return isCallExpression(path.parentPath.parentPath);
28
+ };
29
+
19
30
  module.exports.isLooksLikeChain = (path) => {
20
31
  const [root, properties] = chain(path);
21
32
 
33
+ if (isInsideMemberCall(path))
34
+ return false;
35
+
22
36
  if (isExcludedFromChain(root))
23
37
  return false;
24
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "15.9.1",
3
+ "version": "15.10.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",