File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ export function resolvePath (
55 base : string ,
66 append ?: boolean
77) : string {
8- if ( relative . charAt ( 0 ) === '/' ) {
8+ const firstChar = relative . charAt ( 0 )
9+ if ( firstChar === '/' ) {
910 return relative
1011 }
1112
12- if ( relative . charAt ( 0 ) === '?' || relative . charAt ( 0 ) === '#' ) {
13+ if ( firstChar === '?' || firstChar === '#' ) {
1314 return base + relative
1415 }
1516
@@ -26,11 +27,9 @@ export function resolvePath (
2627 const segments = relative . replace ( / ^ \/ / , '' ) . split ( '/' )
2728 for ( let i = 0 ; i < segments . length ; i ++ ) {
2829 const segment = segments [ i ]
29- if ( segment === '.' ) {
30- continue
31- } else if ( segment === '..' ) {
30+ if ( segment === '..' ) {
3231 stack . pop ( )
33- } else {
32+ } else if ( segment !== '.' ) {
3433 stack . push ( segment )
3534 }
3635 }
You can’t perform that action at this time.
0 commit comments