Commit 8e1dd64 1 parent 08c3a04 commit 8e1dd64 Copy full SHA for 8e1dd64
File tree 2 files changed +13
-1
lines changed
packages/utils/node-resolver-rs/src
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1226,6 +1226,14 @@ mod tests {
1226
1226
. 0 ,
1227
1227
Resolution :: Path ( root( ) . join( "bar.js" ) )
1228
1228
) ;
1229
+ assert_eq ! (
1230
+ test_resolver( )
1231
+ . resolve( ".///bar.js" , & root( ) . join( "foo.js" ) , SpecifierType :: Esm )
1232
+ . result
1233
+ . unwrap( )
1234
+ . 0 ,
1235
+ Resolution :: Path ( root( ) . join( "bar.js" ) )
1236
+ ) ;
1229
1237
assert_eq ! (
1230
1238
test_resolver( )
1231
1239
. resolve( "./bar" , & root( ) . join( "foo.js" ) , SpecifierType :: Esm )
Original file line number Diff line number Diff line change @@ -59,7 +59,11 @@ impl<'a> Specifier<'a> {
59
59
60
60
Ok ( match specifier. as_bytes ( ) [ 0 ] {
61
61
b'.' => {
62
- let specifier = specifier. strip_prefix ( "./" ) . unwrap_or ( specifier) ;
62
+ let specifier = if let Some ( specifier) = specifier. strip_prefix ( "./" ) {
63
+ specifier. trim_start_matches ( '/' )
64
+ } else {
65
+ specifier
66
+ } ;
63
67
let ( path, query) = decode_path ( specifier, specifier_type) ;
64
68
( Specifier :: Relative ( path) , query)
65
69
}
You can’t perform that action at this time.
0 commit comments