esrap 1.3.2 → 1.3.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.
- package/LICENSE +1 -1
- package/package.json +2 -2
- package/src/handlers.js +12 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2023 [these people](https://github.com/
|
|
1
|
+
Copyright (c) 2023-2025 [these people](https://github.com/sveltejs/esrap/graphs/contributors)
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esrap",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Parse in reverse",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/
|
|
7
|
+
"url": "git+https://github.com/sveltejs/esrap.git"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
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 *
|
|
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
|
},
|