esrap 1.3.2 → 1.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/handlers.js +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esrap",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Parse in reverse",
5
5
  "repository": {
6
6
  "type": "git",
package/src/handlers.js CHANGED
@@ -556,6 +556,12 @@ function handle_type_annotation(node, state) {
556
556
  state.commands.push(' : ');
557
557
  handle_type_annotation(node.falseType, state);
558
558
  break;
559
+ case 'TSIndexedAccessType':
560
+ handle_type_annotation(node.objectType, state);
561
+ state.commands.push('[');
562
+ handle_type_annotation(node.indexType, state);
563
+ state.commands.push(']');
564
+ break;
559
565
  default:
560
566
  throw new Error(`Not implemented type annotation ${node.type}`);
561
567
  }
@@ -934,7 +940,12 @@ const handlers = {
934
940
  },
935
941
 
936
942
  ExportAllDeclaration(node, state) {
937
- state.commands.push('export * from ');
943
+ state.commands.push('export * ');
944
+ if (node.exported) {
945
+ state.commands.push('as ');
946
+ handle(node.exported, state);
947
+ }
948
+ state.commands.push(' from ');
938
949
  handle(node.source, state);
939
950
  state.commands.push(';');
940
951
  },