mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
fix(npm): conditional exports with wildcards (#15652)
This commit is contained in:
parent
ea838d27a2
commit
2851a98072
10 changed files with 59 additions and 2 deletions
|
@ -451,7 +451,7 @@ pub fn package_exports_resolve(
|
|||
for key in package_exports.keys() {
|
||||
let pattern_index = key.find('*');
|
||||
if let Some(pattern_index) = pattern_index {
|
||||
let key_sub = &key[0..=pattern_index];
|
||||
let key_sub = &key[0..pattern_index];
|
||||
if package_subpath.starts_with(key_sub) {
|
||||
// When this reaches EOL, this can throw at the top of the whole function:
|
||||
//
|
||||
|
@ -472,7 +472,7 @@ pub fn package_exports_resolve(
|
|||
best_match = key;
|
||||
best_match_subpath = Some(
|
||||
package_subpath
|
||||
[pattern_index..=(package_subpath.len() - pattern_trailer.len())]
|
||||
[pattern_index..(package_subpath.len() - pattern_trailer.len())]
|
||||
.to_string(),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue