File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ export function resolvePath (
5
5
base : string ,
6
6
append ?: boolean
7
7
) : string {
8
- if ( relative . charAt ( 0 ) === '/' ) {
8
+ const firstChar = relative . charAt ( 0 )
9
+ if ( firstChar === '/' ) {
9
10
return relative
10
11
}
11
12
12
- if ( relative . charAt ( 0 ) === '?' || relative . charAt ( 0 ) === '#' ) {
13
+ if ( firstChar === '?' || firstChar === '#' ) {
13
14
return base + relative
14
15
}
15
16
@@ -26,11 +27,9 @@ export function resolvePath (
26
27
const segments = relative . replace ( / ^ \/ / , '' ) . split ( '/' )
27
28
for ( let i = 0 ; i < segments . length ; i ++ ) {
28
29
const segment = segments [ i ]
29
- if ( segment === '.' ) {
30
- continue
31
- } else if ( segment === '..' ) {
30
+ if ( segment === '..' ) {
32
31
stack . pop ( )
33
- } else {
32
+ } else if ( segment !== '.' ) {
34
33
stack . push ( segment )
35
34
}
36
35
}
You can’t perform that action at this time.
0 commit comments