@putout/printer 3.0.1 → 3.1.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,17 @@
1
+ 2023.08.09, v3.1.0
2
+
3
+ feature:
4
+ - f008b95 ObjectExpression: nested call
5
+
6
+ 2023.08.09, v3.0.2
7
+
8
+ fix:
9
+ - d3af233 @putout/printer: generator
10
+
11
+ feature:
12
+ - b7ce82b 2putout/printer: TSFunctionType: parens
13
+ - ef67c67 @putout/printer: drop support of Babel < 8
14
+
1
15
  2023.08.05, v3.0.1
2
16
 
3
17
  feature:
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isLast} = require('../is');
3
+ const {isLast, isCoupleLines} = require('../is');
4
4
 
5
5
  function isSameLine(path, loc) {
6
6
  return path.node.loc?.start.line === loc.start.line || path.node.loc?.end.line === loc.end.line;
@@ -33,7 +33,7 @@ module.exports.parseTrailingComments = (path, {write, maybe}, semantics) => {
33
33
  if (type === 'CommentBlock') {
34
34
  maybe.write.space(sameLine);
35
35
  write(`/*${value}*/`);
36
- maybe.write.newline(!sameLine);
36
+ maybe.write.newline(!sameLine || isCoupleLines(path.parentPath));
37
37
  }
38
38
  }
39
39
  };
@@ -15,8 +15,14 @@ module.exports.FunctionDeclaration = {
15
15
 
16
16
  maybe.print(async, 'async ');
17
17
 
18
- print('function ');
19
- maybe.print(generator, '*');
18
+ print('function');
19
+
20
+ if (!generator) {
21
+ print(' ');
22
+ } else {
23
+ print('*');
24
+ print.space();
25
+ }
20
26
 
21
27
  print('__id');
22
28
  print('__typeParameters');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "3.0.1",
3
+ "version": "3.1.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",