@putout/printer 1.92.2 → 1.92.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,8 @@
1
+ 2023.05.11, v1.92.3
2
+
3
+ feature:
4
+ - 4518b45 @putout/printer: statements: SwitchStatement: add support of fall
5
+
1
6
  2023.05.10, v1.92.2
2
7
 
3
8
  feature:
@@ -32,14 +32,16 @@ module.exports.SwitchStatement = {
32
32
 
33
33
  print(':');
34
34
 
35
+ const consequents = switchCase.get('consequent');
36
+
35
37
  const isBlock = switchCase
36
38
  .get('consequent.0')
37
- .isBlockStatement();
39
+ ?.isBlockStatement();
38
40
 
39
41
  maybe.indent.inc(!isBlock);
40
- maybe.print.newline(!isBlock);
42
+ maybe.print.newline(!isBlock && consequents.length);
41
43
 
42
- for (const consequent of switchCase.get('consequent')) {
44
+ for (const consequent of consequents) {
43
45
  if (!consequent.isBlockStatement()) {
44
46
  print(consequent);
45
47
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.92.2",
3
+ "version": "1.92.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 for 🐊Putout",