@putout/printer 1.80.1 → 1.80.3

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.03, v1.80.3
2
+
3
+ feature:
4
+ - 564e885 @putout/printer: improve support of SequenceExpression
5
+
6
+ 2023.05.03, v1.80.2
7
+
8
+ feature:
9
+ - 07be461 @putout/printer: BreakStatement: apply afterSatisfy
10
+
1
11
  2023.05.03, v1.80.1
2
12
 
3
13
  feature:
@@ -27,4 +27,3 @@ module.exports.SequenceExpression = {
27
27
  write(')');
28
28
  },
29
29
  };
30
-
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const {isLast} = require('../is');
3
4
  module.exports.UnaryExpression = unaryExpression;
4
5
  module.exports.UpdateExpression = unaryExpression;
5
6
 
@@ -15,7 +16,7 @@ module.exports.YieldExpression = (path, {print}) => {
15
16
  });
16
17
  };
17
18
 
18
- module.exports.ThrowStatement = (path, {print, indent}) => {
19
+ module.exports.ThrowStatement = (path, {print, indent, maybe}) => {
19
20
  indent();
20
21
 
21
22
  printUnary(path, 'throw', {
@@ -23,7 +24,7 @@ module.exports.ThrowStatement = (path, {print, indent}) => {
23
24
  });
24
25
 
25
26
  print(';');
26
- print.newline();
27
+ maybe.print.newline(!isLast(path));
27
28
  };
28
29
 
29
30
  function printUnary(path, name, {print}) {
@@ -49,3 +50,4 @@ function unaryExpression(path, {maybe, traverse}) {
49
50
  maybe.print(round, ')');
50
51
  maybe.print(!prefix, operator);
51
52
  }
53
+
@@ -15,13 +15,9 @@ module.exports.BreakStatement = {
15
15
  indent();
16
16
  print('break;');
17
17
  },
18
- afterIf(path) {
19
- if (isParentBlock(path))
20
- return true;
21
-
22
- if (isNextParent(path))
23
- return true;
24
-
25
- return insideCase(path);
26
- },
18
+ afterSatisfy: () => [
19
+ isParentBlock,
20
+ isNextParent,
21
+ insideCase,
22
+ ],
27
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.80.1",
3
+ "version": "1.80.3",
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 fro 🐊Putout",