@putout/printer 1.101.0 → 1.101.2

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,13 @@
1
+ 2023.05.18, v1.101.2
2
+
3
+ fix:
4
+ - 3a35005 @putout/printer: SequenceExpression: space
5
+
6
+ 2023.05.18, v1.101.1
7
+
8
+ fix:
9
+ - 4aa709b @putout/printer: FunctionExpression: space
10
+
1
11
  2023.05.18, v1.101.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -89,6 +89,7 @@ print(ast, {
89
89
  },
90
90
  },
91
91
  });
92
+
92
93
  // returns
93
94
  'const {a/* [hello world] */= 5} = b;\n';
94
95
  ```
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const {exists} = require('../../is');
4
+
3
5
  module.exports.FunctionExpression = (path, {print, maybe, write, traverse}) => {
4
6
  const {node} = path;
5
7
 
@@ -14,8 +16,8 @@ module.exports.FunctionExpression = (path, {print, maybe, write, traverse}) => {
14
16
 
15
17
  const id = path.get('id');
16
18
 
17
- if (id.node) {
18
- write.space();
19
+ if (exists(id)) {
20
+ write(' ');
19
21
  traverse(id);
20
22
  }
21
23
 
@@ -9,7 +9,7 @@ module.exports.SequenceExpression = (path, {maybe, write, traverse}) => {
9
9
  for (const [index, expression] of expressions.entries()) {
10
10
  traverse(expression);
11
11
  maybe.write(index < n, ',');
12
- maybe.write(index < n, ' ');
12
+ maybe.write.space(index < n);
13
13
  }
14
14
 
15
15
  write(')');
@@ -213,7 +213,6 @@ module.exports.tokenize = (ast, overrides = {}) => {
213
213
 
214
214
  const currentIndent = i;
215
215
  parseLeadingComments(path, printer, format);
216
-
217
216
  // this is main thing
218
217
  maybePlugin(currentTraverse, path, printer);
219
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.101.0",
3
+ "version": "1.101.2",
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",