@putout/printer 1.106.1 → 1.107.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,13 @@
1
+ 2023.05.23, v1.107.0
2
+
3
+ feature:
4
+ - 2ee5b24 @putout/printer: BinaryExpression: instanceOf: spaces (putoutjs/minify#4)
5
+
6
+ 2023.05.22, v1.106.2
7
+
8
+ fix:
9
+ - a7776e6 @putout/printer: comma in ObjectExpression: (coderaiser/minify#101)
10
+
1
11
  2023.05.22, v1.106.1
2
12
 
3
13
  feature:
@@ -13,9 +13,20 @@ const BinaryExpression = {
13
13
  print('(');
14
14
  },
15
15
  print(path, {write, traverse}) {
16
+ const {operator} = path.node;
16
17
  const left = path.get('left');
17
18
  const right = path.get('right');
18
19
 
20
+ if (operator === 'instanceof') {
21
+ traverse(left);
22
+ write(' ');
23
+ write(operator);
24
+ write(' ');
25
+ traverse(right);
26
+
27
+ return;
28
+ }
29
+
19
30
  traverse(left);
20
31
  write.space();
21
32
  write(path.node.operator);
@@ -11,7 +11,6 @@ const {
11
11
  exists,
12
12
  } = require('../is');
13
13
 
14
- const {isFunction} = require('@babel/types');
15
14
  const {parseComments} = require('../comments');
16
15
 
17
16
  const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
@@ -123,9 +122,6 @@ function isOneLine(path) {
123
122
  if (isIf(path))
124
123
  return ONE_LINE;
125
124
 
126
- if (path.parentPath.isCallExpression() && isFunction(path.parentPath.node.arguments[1]))
127
- return ONE_LINE;
128
-
129
125
  if (isCoupleLines(path))
130
126
  return MANY_LINES;
131
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.106.1",
3
+ "version": "1.107.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",