From e530ea3d365df6c5c501460c1bdc6f0f59dc3e77 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 8 Feb 2024 19:46:09 +0800 Subject: [PATCH 1/2] fix: specifier with multiple `?` (#83) relates https://github.com/web-infra-dev/rspack/issues/5644 --- src/specifier.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/specifier.rs b/src/specifier.rs index e9105550..28fe4e4b 100644 --- a/src/specifier.rs +++ b/src/specifier.rs @@ -38,7 +38,7 @@ impl<'a> Specifier<'a> { let mut prev = specifier.chars().next().unwrap(); let mut escaped_indexes = vec![]; for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' { + if c == '?' && query_start.is_none() { query_start = Some(i); } if c == '#' { @@ -150,7 +150,10 @@ mod tests { let data = [ ("a?", Some("?"), None), ("a?query", Some("?query"), None), + ("a?query1?query2", Some("?query1?query2"), None), + ("a?query1?query2?query3", Some("?query1?query2?query3"), None), ("a#", None, Some("#")), + ("a#b#c", None, Some("#b#c")), ("a#fragment", None, Some("#fragment")), ("a?#", Some("?"), Some("#")), ("a?#fragment", Some("?"), Some("#fragment")), From c1ab4622c33f13a6513f0fa8c538cdf9e9eb5d91 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 8 Feb 2024 19:49:24 +0800 Subject: [PATCH 2/2] Publish crate v1.5.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28ef16a0..dce76fc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -465,7 +465,7 @@ dependencies = [ [[package]] name = "oxc_resolver" -version = "1.4.0" +version = "1.5.0" dependencies = [ "codspeed-criterion-compat", "criterion", diff --git a/Cargo.toml b/Cargo.toml index 768f5cad..1acd3174 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -version = "1.4.0" +version = "1.5.0" name = "oxc_resolver" authors = ["Boshen "] categories = ["development-tools"]