esrap 1.4.6 → 1.4.7
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/package.json +1 -1
- package/src/handlers.js +22 -0
package/package.json
CHANGED
package/src/handlers.js
CHANGED
|
@@ -1165,12 +1165,34 @@ const handlers = {
|
|
|
1165
1165
|
|
|
1166
1166
|
state.commands.push(' from ');
|
|
1167
1167
|
handle(node.source, state);
|
|
1168
|
+
if (node.attributes) {
|
|
1169
|
+
state.commands.push(' with { ');
|
|
1170
|
+
for (let index = 0; index < node.attributes.length; index++) {
|
|
1171
|
+
const { key, value } = node.attributes[index];
|
|
1172
|
+
handle(key, state);
|
|
1173
|
+
state.commands.push(': ');
|
|
1174
|
+
handle(value, state);
|
|
1175
|
+
if (index + 1 !== node.attributes.length) {
|
|
1176
|
+
state.commands.push(', ');
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
state.commands.push(' }');
|
|
1180
|
+
}
|
|
1168
1181
|
state.commands.push(';');
|
|
1169
1182
|
},
|
|
1170
1183
|
|
|
1171
1184
|
ImportExpression(node, state) {
|
|
1172
1185
|
state.commands.push('import(');
|
|
1173
1186
|
handle(node.source, state);
|
|
1187
|
+
//@ts-expect-error for some reason the types haven't been updated
|
|
1188
|
+
if (node.arguments) {
|
|
1189
|
+
//@ts-expect-error
|
|
1190
|
+
for (let index = 0; index < node.arguments.length; index++) {
|
|
1191
|
+
state.commands.push(', ');
|
|
1192
|
+
//@ts-expect-error
|
|
1193
|
+
handle(node.arguments[index], state);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1174
1196
|
state.commands.push(')');
|
|
1175
1197
|
},
|
|
1176
1198
|
|