Skip to content

Commit

Permalink
fix: avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed May 6, 2024
1 parent 0385930 commit 418f3c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/helpers/module_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'a> ModuleImports<'a> {
.entry(ImportType::new(ImportKind::Require, source))
.or_default()
.push(import);
if front {
if front && len > 0 {
self.imports.borrow_mut().move_index(len, 0);
}
}
Expand Down

0 comments on commit 418f3c2

Please sign in to comment.