@putout/printer 16.3.0 → 16.4.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.12.11, v16.4.0
2
+
3
+ feature:
4
+ - 34371e9 @putout/printer: MemberExpression: chain: improve support
5
+
1
6
  2025.12.09, v16.3.0
2
7
 
3
8
  feature:
@@ -24,9 +24,21 @@ const isInsideMemberCall = (path) => {
24
24
  if (!isIdentifier(path.node.property))
25
25
  return false;
26
26
 
27
+ if (isLastArgInCall(path))
28
+ return true;
29
+
27
30
  return isCallExpression(path.parentPath.parentPath);
28
31
  };
29
32
 
33
+ function isLastArgInCall(path) {
34
+ const {parentPath} = path;
35
+
36
+ if (!isCallExpression(parentPath))
37
+ return false;
38
+
39
+ return path === parentPath.get('arguments').at(-1);
40
+ }
41
+
30
42
  module.exports.isLooksLikeChain = (path) => {
31
43
  const [root, properties] = chain(path);
32
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "16.3.0",
3
+ "version": "16.4.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",