@putout/printer 2.58.0 → 2.59.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
+ 2023.07.09, v2.59.0
2
+
3
+ feature:
4
+ - abfbddf @putout/printer: MemberExpression: nested call
5
+
1
6
  2023.07.08, v2.58.0
2
7
 
3
8
  feature:
@@ -10,6 +10,8 @@ const {
10
10
  const {chain} = require('./chain');
11
11
  const {satisfy} = require('../../is');
12
12
 
13
+ const isArgOfCall = (path) => path.parentPath.isCallExpression() && path.parentPath.get('arguments.0') === path;
14
+
13
15
  module.exports.MemberExpression = (path, {print, maybe, traverse}) => {
14
16
  const {computed} = path.node;
15
17
  const object = path.get('object');
@@ -80,5 +82,9 @@ function likeChain(path) {
80
82
  if (calls.length === 2 && !firstCall.name)
81
83
  return false;
82
84
 
85
+ if (isArgOfCall(path)) {
86
+ return false;
87
+ }
88
+
83
89
  return calls.length > 1;
84
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.58.0",
3
+ "version": "2.59.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",