@putout/printer 2.71.0 → 2.73.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,14 @@
1
+ 2023.07.14, v2.73.0
2
+
3
+ feature:
4
+ - 528a1aa @putout/printer: ConditionalExpression: braces
5
+ - 28eb512 @putout/printer: ConditionalExpression: braces
6
+
7
+ 2023.07.14, v2.72.0
8
+
9
+ feature:
10
+ - c81de01 TSTypeParameterDeclaration inside ArrowExpression
11
+
1
12
  2023.07.14, v2.71.0
2
13
 
3
14
  feature:
@@ -1,13 +1,25 @@
1
1
  'use strict';
2
2
 
3
- module.exports.ConditionalExpression = (path, {print}) => {
4
- print('__test');
5
- print.space();
6
- print('?');
7
- print.space();
8
- print('__consequent');
9
- print.space();
10
- print(':');
11
- print.space();
12
- print('__alternate');
3
+ const isParens = (path) => path.node.extra?.parenthesized;
4
+
5
+ module.exports.ConditionalExpression = {
6
+ beforeSatisfy: () => [isParens],
7
+ before(path, {print}) {
8
+ print('(');
9
+ },
10
+ print(path, {print}) {
11
+ print('__test');
12
+ print.space();
13
+ print('?');
14
+ print.space();
15
+ print('__consequent');
16
+ print.space();
17
+ print(':');
18
+ print.space();
19
+ print('__alternate');
20
+ },
21
+ afterSatisfy: () => [isParens],
22
+ after(path, {print}) {
23
+ print(')');
24
+ },
13
25
  };
@@ -20,6 +20,8 @@ module.exports.ArrowFunctionExpression = {
20
20
 
21
21
  const {async} = path.node;
22
22
 
23
+ print('__typeParameters');
24
+
23
25
  maybe.print(async, 'async ');
24
26
 
25
27
  printParams(path, printer, semantics);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.71.0",
3
+ "version": "2.73.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",