esrap 1.4.8 → 1.4.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/handlers.js +20 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esrap",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Parse in reverse",
5
5
  "repository": {
6
6
  "type": "git",
package/src/handlers.js CHANGED
@@ -475,6 +475,15 @@ function handle_type_annotation(node, state) {
475
475
  case 'TSNeverKeyword':
476
476
  state.commands.push('never');
477
477
  break;
478
+ case 'TSSymbolKeyword':
479
+ state.commands.push('symbol');
480
+ break;
481
+ case 'TSNullKeyword':
482
+ state.commands.push('null');
483
+ break;
484
+ case 'TSUndefinedKeyword':
485
+ state.commands.push('undefined');
486
+ break;
478
487
  case 'TSArrayType':
479
488
  handle_type_annotation(node.elementType, state);
480
489
  state.commands.push('[]');
@@ -1273,7 +1282,11 @@ const handlers = {
1273
1282
 
1274
1283
  state.commands.push('(');
1275
1284
  sequence(node.value.params, state, false, handle);
1276
- state.commands.push(') ');
1285
+ state.commands.push(')');
1286
+
1287
+ if (node.value.returnType) handle_type_annotation(node.value.returnType, state);
1288
+
1289
+ state.commands.push(' ');
1277
1290
 
1278
1291
  if (node.value.body) handle(node.value.body, state);
1279
1292
  },
@@ -1352,6 +1365,12 @@ const handlers = {
1352
1365
  },
1353
1366
 
1354
1367
  PropertyDefinition(node, state) {
1368
+ if (node.decorators) {
1369
+ for (const decorator of node.decorators) {
1370
+ handle(decorator, state);
1371
+ }
1372
+ }
1373
+
1355
1374
  if (node.accessibility) {
1356
1375
  state.commands.push(node.accessibility, ' ');
1357
1376
  }