@putout/printer 11.5.0 → 11.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.12.16, v11.6.0
2
+
3
+ feature:
4
+ - 77f529d @putout/printer: AwaitExpressions: parens
5
+
1
6
  2024.12.15, v11.5.0
2
7
 
3
8
  feature:
@@ -23,7 +23,7 @@ module.exports.MemberExpression = (path, printer) => {
23
23
 
24
24
  const object = path.get('object');
25
25
  const property = path.get('property');
26
- const isParens = object.isAwaitExpression() || object.isAssignmentExpression();
26
+ const isParens = object.isAssignmentExpression();
27
27
  const {computed} = path.node;
28
28
 
29
29
  maybe.print(isParens, '(');
@@ -20,11 +20,11 @@ const unaryExpression = maybeParens((path, printer) => {
20
20
  module.exports.UnaryExpression = unaryExpression;
21
21
  module.exports.UpdateExpression = unaryExpression;
22
22
 
23
- module.exports.AwaitExpression = (path, {print}) => {
23
+ module.exports.AwaitExpression = maybeParens((path, {print}) => {
24
24
  printUnary(path, 'await', {
25
25
  print,
26
26
  });
27
- };
27
+ });
28
28
 
29
29
  module.exports.YieldExpression = maybeParens((path, {print, maybe}) => {
30
30
  const {delegate} = path.node;
@@ -51,3 +51,4 @@ function printUnary(path, name, {print}) {
51
51
  print(`${name} `);
52
52
  print('__argument');
53
53
  }
54
+
@@ -24,5 +24,6 @@ const maybeParensPrint = (print) => ({
24
24
 
25
25
  const maybeParensCondition = ({print, condition}) => ({
26
26
  ...maybeParensPrint(print),
27
- condition: (path) => condition(path) || isParens(path),
27
+ condition: (path) => condition?.(path) || isParens(path),
28
28
  });
29
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "11.5.0",
3
+ "version": "11.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",