@putout/printer 8.36.0 → 8.37.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,8 @@
1
+ 2024.05.21, v8.37.0
2
+
3
+ feature:
4
+ - 97bcc9e @putout/printer: VariableDeclaration: add support of LabeledStatement
5
+
1
6
  2024.05.19, v8.36.0
2
7
 
3
8
  feature:
@@ -33,7 +33,6 @@ module.exports.IfStatement = {
33
33
  const alternate = path.get('alternate');
34
34
  const isConsequentBlock = consequent.isBlockStatement();
35
35
  const isVar = consequent.isVariableDeclaration();
36
- const isRet = consequent.isReturnStatement();
37
36
 
38
37
  if (isConsequentBlock) {
39
38
  print.space();
@@ -6,7 +6,7 @@ const {IfStatement} = require('./if-statement/if-statement');
6
6
  const {ForOfStatement} = require('./for-of-statement/for-of-statement');
7
7
  const {BlockStatement} = require('./block-statement/block-statement');
8
8
  const {ReturnStatement} = require('./return-statement/return-statement');
9
- const TryStatements = require('./try-statements');
9
+ const TryStatements = require('./try-statement/try-statements');
10
10
  const {DebuggerStatement} = require('./debugger-statement');
11
11
  const {ForStatement} = require('./for-statement');
12
12
  const importDeclarations = require('./import-declaration/import-declaration');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isNext} = require('../is');
3
+ const {isNext} = require('../../is');
4
4
 
5
5
  module.exports.TryStatement = {
6
6
  print(path, {print}) {
@@ -17,7 +17,7 @@ const {parseLeadingComments} = require('../../comment/comment');
17
17
  const {maybeDeclare} = require('../../maybe/maybe-declare');
18
18
 
19
19
  const isParentTSModuleBlock = (path) => path.parentPath.isTSModuleBlock();
20
- const isParentBlock = (path) => /Program|BlockStatement|Export/.test(path.parentPath.type);
20
+ const isParentBlock = (path) => /Program|BlockStatement|Export|LabeledStatement/.test(path.parentPath.type);
21
21
  const isInsideBlock = (path) => /^(Program|BlockStatement|TSModuleBlock|SwitchCase)$/.test(path.parentPath.type);
22
22
  const isParentSwitchCase = (path) => path.parentPath.isSwitchCase();
23
23
  const isFirstInSwitch = (path) => path.parentPath.get('consequent.0') === path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "8.36.0",
3
+ "version": "8.37.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",