@putout/printer 9.5.0 → 9.6.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
+ 2024.07.11, v9.6.0
2
+
3
+ feature:
4
+ - 0d1f296 @putout/printer: MemberExpression: object used as AssignProperty
5
+
1
6
  2024.06.16, v9.5.0
2
7
 
3
8
  feature:
@@ -12,13 +12,13 @@ const {satisfy} = require('../../is');
12
12
  const isArgOfCall = (path) => path.parentPath.isCallExpression() && path.parentPath.get('arguments.0') === path;
13
13
 
14
14
  module.exports.MemberExpression = (path, {print, maybe, traverse}) => {
15
- const {computed} = path.node;
16
15
  const object = path.get('object');
17
- const isObjectAwait = object.isAwaitExpression();
16
+ const isParens = object.isAwaitExpression() || object.isAssignmentExpression();
17
+ const {computed} = path.node;
18
18
 
19
- maybe.print(isObjectAwait, '(');
19
+ maybe.print(isParens, '(');
20
20
  traverse(object);
21
- maybe.print(isObjectAwait, ')');
21
+ maybe.print(isParens, ')');
22
22
 
23
23
  if (computed) {
24
24
  print('[');
@@ -109,3 +109,4 @@ function likeChain(path) {
109
109
 
110
110
  return calls.length > 1;
111
111
  }
112
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "9.5.0",
3
+ "version": "9.6.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",