@putout/printer 17.7.3 → 17.8.1

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
+ 2026.02.22, v17.8.1
2
+
3
+ feature:
4
+ - 89ae686 tokenize: rm useless round
5
+
6
+ 2026.02.22, v17.8.0
7
+
8
+ feature:
9
+ - e4edea2 @putout/printer: comments: improve support
10
+
1
11
  2026.02.18, v17.7.3
2
12
 
3
13
  feature:
@@ -1,5 +1,7 @@
1
1
  import {isNext} from '#is';
2
2
 
3
+ const isEmptyBody = ({node}) => !node.body.length;
4
+
3
5
  export const parseComments = (path, {write, maybe}, semantics) => {
4
6
  if (!semantics.comments)
5
7
  return;
@@ -18,7 +20,7 @@ export const parseComments = (path, {write, maybe}, semantics) => {
18
20
  write('//');
19
21
  write(value);
20
22
 
21
- if (program) {
23
+ if (program && isEmptyBody(path)) {
22
24
  maybe.write.newline(i < n);
23
25
  continue;
24
26
  }
@@ -7,7 +7,7 @@ import {
7
7
  printTrailingCommentLine,
8
8
  } from './import-declaration-comments.js';
9
9
 
10
- export {ImportAttribute} from './import-attribute.js';
10
+ export {ImportAttribute} from '#import-attributes';
11
11
 
12
12
  export const ImportDeclaration = {
13
13
  print(path, printer, semantics) {
@@ -16,7 +16,6 @@ import {
16
16
  import {parseOverrides} from './overrides/overrides.js';
17
17
 
18
18
  const isObject = (a) => a && typeof a === 'object';
19
- const {round} = Math;
20
19
  const isString = (a) => typeof a === 'string';
21
20
  const {assign, freeze} = Object;
22
21
 
@@ -193,10 +192,7 @@ export const tokenize = (ast, overrides) => {
193
192
  traverse,
194
193
  });
195
194
 
196
- assign(print, write, {
197
- space,
198
- round,
199
- });
195
+ assign(print, write);
200
196
 
201
197
  const printer = {
202
198
  ...mainPrinter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "17.7.3",
3
+ "version": "17.8.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",