From 2851a980723f27c245e6e3790a53dd26136f225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 29 Aug 2022 19:15:20 +0200 Subject: fix(npm): conditional exports with wildcards (#15652) --- ext/node/resolution.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/node') diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index b839d4144..b77e6f690 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -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(), ); } -- cgit v1.2.3