-
Notifications
You must be signed in to change notification settings - Fork 700
Closed
Labels
Description
rolldown/crates/rolldown_binding/src/options/binding_input_options/binding_resolve_options.rs
Lines 8 to 11 in c304a0d
| pub struct BindingResolveOptions { | |
| // FIXME: Using `HashMap<String, Vec<String>>` is wrong here. Rust's `HashMap` is not ordered, while JavaScript's `Object` is ordered. | |
| // We should use tuple array instead of object. | |
| pub alias: Option<HashMap<String, Vec<String>>>, |
Possible solutions
Use Option<Vec<(String, Vec<String>)>>>
The problem is that NAPI-RS so far doesn't support tuples
Define a temporary struct like
pub struct AliasItem {
pub name: String,
pub paths: Vec<String>,
}and write Option<Vec<AliasItem>>>.
I personally prefer using tuples on this case. However this requires discussing with NAPI-RS if this feature is really needed.
Reactions are currently unavailable