@putout/printer 1.97.1 → 1.98.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.12, v1.98.0
2
+
3
+ feature:
4
+ - fd1a43d @putout/printer: ObjectProperty: space formatting support
5
+
6
+ 2023.05.12, v1.97.2
7
+
8
+ feature:
9
+ - 420a677 @putout/printer: TSModuleDeclaration: improve newline support
10
+
1
11
  2023.05.11, v1.97.1
2
12
 
3
13
  feature:
@@ -100,7 +100,8 @@ module.exports.ObjectProperty = (path, {print, maybe}) => {
100
100
  maybe.print(computed, ']');
101
101
 
102
102
  if (!shorthand) {
103
- print(': ');
103
+ print(':');
104
+ print.space();
104
105
  print('__value');
105
106
  }
106
107
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const {isNext} = require('../is');
4
+
4
5
  module.exports.TSInterfaceDeclaration = {
5
6
  print(path, {print}) {
6
7
  print('interface ');
@@ -15,4 +16,3 @@ module.exports.TSInterfaceDeclaration = {
15
16
  print.breakline();
16
17
  },
17
18
  };
18
-
@@ -1,5 +1,23 @@
1
1
  'use strict';
2
2
 
3
+ const {isNext} = require('../is');
4
+
5
+ module.exports.TSModuleDeclaration = {
6
+ print(path, {print}) {
7
+ print('declare namespace ');
8
+ print('__id');
9
+ print.space();
10
+ print('__body');
11
+ },
12
+ afterSatisfy: () => [
13
+ isNext,
14
+ ],
15
+ after(path, {print}) {
16
+ print.newline();
17
+ print.newline();
18
+ },
19
+ };
20
+
3
21
  module.exports.TSModuleBlock = (path, {print, traverse, indent}) => {
4
22
  print('{');
5
23
  print.breakline();
@@ -11,10 +29,3 @@ module.exports.TSModuleBlock = (path, {print, traverse, indent}) => {
11
29
  indent.dec();
12
30
  print('}');
13
31
  };
14
-
15
- module.exports.TSModuleDeclaration = (path, {print}) => {
16
- print('declare namespace ');
17
- print('__id');
18
- print.space();
19
- print('__body');
20
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.97.1",
3
+ "version": "1.98.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",