@putout/printer 1.92.0 → 1.92.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,8 @@
1
+ 2023.05.10, v1.92.1
2
+
3
+ feature:
4
+ - d6c9e2a @putout/printer: add support of comments inside ObjectExpression
5
+
1
6
  2023.05.10, v1.92.0
2
7
 
3
8
  feature:
@@ -12,13 +12,14 @@ const {
12
12
  } = require('../is');
13
13
 
14
14
  const {isFunction} = require('@babel/types');
15
+ const {parseComments} = require('../comments');
15
16
 
16
17
  const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
17
18
  const isLogical = (path) => path.get('argument').isLogicalExpression();
18
19
  const isValue = (path) => path.get('properties.0.value').node;
19
20
  const isParentExpression = (path) => path.parentPath.isExpressionStatement();
20
21
 
21
- module.exports.ObjectExpression = (path, {print, maybe, indent}) => {
22
+ module.exports.ObjectExpression = (path, {print, maybe, indent, write}) => {
22
23
  indent.inc();
23
24
 
24
25
  const properties = path.get('properties');
@@ -28,6 +29,7 @@ module.exports.ObjectExpression = (path, {print, maybe, indent}) => {
28
29
 
29
30
  maybe.print(parens, '(');
30
31
  print('{');
32
+ parseComments(path, {write});
31
33
  maybe.print.newline(manyLines);
32
34
 
33
35
  for (const property of properties) {
@@ -136,3 +138,4 @@ function isParens(path) {
136
138
 
137
139
  return false;
138
140
  }
141
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.92.0",
3
+ "version": "1.92.1",
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",