Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Nov 7, 2024
1 parent 34fa2fb commit d6b54d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions crates/rspack_core/src/dependency/runtime_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,16 @@ mod test_items_to_regexp {
),
"[1234a]".to_string()
);

assert_eq!(
items_to_regexp(
vec!["foo_js", "_js"]
.into_iter()
.map(String::from)
.collect::<Vec<_>>(),
),
"(|foo)_js".to_string()
);
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions crates/rspack_core/src/utils/compile_boolean_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ fn get_common_suffix<'a, I: Iterator<Item = &'a str>>(mut items: I) -> &'a str {
let item_byte = item[p - 1];
if suffix_byte == item_byte {
p -= 1;
} else {
suffix = &suffix[s + 1..];
break;
continue;
}
}
suffix = &suffix[s + 1..];
break;
}
}

Expand Down

0 comments on commit d6b54d9

Please sign in to comment.