esrap 1.4.3 → 1.4.4

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 +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esrap",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Parse in reverse",
5
5
  "repository": {
6
6
  "type": "git",
package/src/handlers.js CHANGED
@@ -1506,6 +1506,22 @@ const handlers = {
1506
1506
  state.commands.push(dedent, newline, '}', newline);
1507
1507
  },
1508
1508
 
1509
+ TSModuleBlock(node, state) {
1510
+ state.commands.push(' {', indent, newline);
1511
+ sequence(node.body, state, false, handle);
1512
+ state.commands.push(dedent, newline, '}');
1513
+ },
1514
+
1515
+ TSModuleDeclaration(node, state) {
1516
+ if (node.declare) state.commands.push('declare ');
1517
+ else state.commands.push('namespace ');
1518
+
1519
+ handle(node.id, state);
1520
+
1521
+ if (!node.body) return;
1522
+ handle(node.body, state);
1523
+ },
1524
+
1509
1525
  TSNonNullExpression(node, state) {
1510
1526
  handle(node.expression, state);
1511
1527
  state.commands.push('!');