Skip to content

Commit edc3347

Browse files
authored
Merge pull request #65 from paoloricciuti/fix-import-attributes
fix: only push `with` clause if attributes length is gt 0
2 parents 31e5a40 + 61c9902 commit edc3347

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/nice-carrots-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'esrap': patch
3+
---
4+
5+
fix: only push `with` clause if attributes length is gt 0

src/handlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ const handlers = {
11651165

11661166
state.commands.push(' from ');
11671167
handle(node.source, state);
1168-
if (node.attributes) {
1168+
if (node.attributes && node.attributes.length > 0) {
11691169
state.commands.push(' with { ');
11701170
for (let index = 0; index < node.attributes.length; index++) {
11711171
const { key, value } = node.attributes[index];

0 commit comments

Comments
 (0)