@putout/printer 2.78.0 → 2.79.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
+ 2023.07.20, v2.79.0
2
+
3
+ feature:
4
+ - 036d9b0 @putout/printer: TSImportEqualsDeclaration
5
+
1
6
  2023.07.20, v2.78.0
2
7
 
3
8
  feature:
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {exists} = require('../is');
3
+ const {exists} = require('../../is');
4
4
 
5
5
  module.exports.ClassProperty = ClassProperty;
6
6
 
@@ -16,9 +16,23 @@ module.exports.PrivateName = (path, {print}) => {
16
16
  };
17
17
 
18
18
  function ClassProperty(path, {print}) {
19
+ const {accessibility} = path.node;
19
20
  const value = path.get('value');
21
+ const typeAnnotation = path.get('typeAnnotation');
22
+
23
+ if (accessibility) {
24
+ print(accessibility);
25
+ print(' ');
26
+ }
27
+
20
28
  print('__key');
21
29
 
30
+ if (exists(typeAnnotation)) {
31
+ print(':');
32
+ print.space();
33
+ print(typeAnnotation);
34
+ }
35
+
22
36
  if (exists(value)) {
23
37
  print.space();
24
38
  print('=');
@@ -24,7 +24,7 @@ const {
24
24
  ClassProperty,
25
25
  ClassPrivateProperty,
26
26
  PrivateName,
27
- } = require('./class-property');
27
+ } = require('./class/class-property');
28
28
 
29
29
  const {AssignmentExpression} = require('./assignment-expression');
30
30
  const {ArrayExpression} = require('./array-expression/array-expression');
@@ -19,4 +19,3 @@ module.exports.TSEnumDeclaration = (path, {print, traverse, indent}) => {
19
19
  indent.dec();
20
20
  print('}');
21
21
  };
22
-
@@ -243,4 +243,14 @@ module.exports = {
243
243
  },
244
244
  TSEnumDeclaration,
245
245
  TSEnumMember,
246
+ TSImportEqualsDeclaration(path, {print}) {
247
+ print('import ');
248
+ print('__id');
249
+ print.space();
250
+ print('=');
251
+ print.space();
252
+ print('__moduleReference');
253
+ print(';');
254
+ print.newline();
255
+ },
246
256
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.78.0",
3
+ "version": "2.79.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",