File tree Expand file tree Collapse file tree 6 files changed +16
-20
lines changed
Expand file tree Collapse file tree 6 files changed +16
-20
lines changed Original file line number Diff line number Diff line change 8585 "test" : " vitest run"
8686 },
8787 "type" : " module" ,
88- "version" : " 2.13.1 "
88+ "version" : " 2.13.2 "
8989}
Original file line number Diff line number Diff line change 11const src = globalThis . location ?. href || ''
22
3- export const APP_VERSION = '2.13.1 '
3+ export const APP_VERSION = '2.13.2 '
44export const IS_LOCAL = src . includes ( 'localhost' ) || src . includes ( '127.0.0.1' )
55export const ENV = IS_LOCAL ? 'local' : 'ic'
66export const APP_ORIGIN = IS_LOCAL
Original file line number Diff line number Diff line change @@ -13,14 +13,12 @@ export function joinURL(
1313 params ?: URLSearchParamsInit
1414) {
1515 const url = new URL ( baseURL )
16- const search1 = url . search
17- url . search = ''
18- url . href += path === '' || path . startsWith ( '?' ) ? path : '/' + path
19- const search2 = url . search
20- url . search = search1
21- toURLSearchParams ( search2 ) . forEach ( ( value , key ) => {
22- url . searchParams . set ( key , value )
23- } )
16+ if ( path ) {
17+ if ( ! url . pathname . endsWith ( '/' ) ) url . pathname += '/'
18+ if ( path . startsWith ( '/' ) ) path = path . slice ( 1 )
19+ url . pathname += path
20+ }
21+
2422 toURLSearchParams ( params ?? { } ) . forEach ( ( value , key ) => {
2523 url . searchParams . set ( key , value )
2624 } )
Original file line number Diff line number Diff line change 7878 "test" : " vitest run"
7979 },
8080 "type" : " module" ,
81- "version" : " 2.13.1 "
81+ "version" : " 2.13.2 "
8282}
Original file line number Diff line number Diff line change 11const src = globalThis . location ?. href || ''
22
3- export const APP_VERSION = '2.13.1 '
3+ export const APP_VERSION = '2.13.2 '
44export const IS_LOCAL = src . includes ( 'localhost' ) || src . includes ( '127.0.0.1' )
55export const ENV = IS_LOCAL ? 'local' : 'ic'
66export const APP_ORIGIN = IS_LOCAL
Original file line number Diff line number Diff line change @@ -11,14 +11,12 @@ export function joinURL(
1111 params ?: URLSearchParamsInit
1212) {
1313 const url = new URL ( baseURL )
14- const search1 = url . search
15- url . search = ''
16- url . href += path === '' || path . startsWith ( '?' ) ? path : '/' + path
17- const search2 = url . search
18- url . search = search1
19- toURLSearchParams ( search2 ) . forEach ( ( value , key ) => {
20- url . searchParams . set ( key , value )
21- } )
14+ if ( path ) {
15+ if ( ! url . pathname . endsWith ( '/' ) ) url . pathname += '/'
16+ if ( path . startsWith ( '/' ) ) path = path . slice ( 1 )
17+ url . pathname += path
18+ }
19+
2220 toURLSearchParams ( params ?? { } ) . forEach ( ( value , key ) => {
2321 url . searchParams . set ( key , value )
2422 } )
You can’t perform that action at this time.
0 commit comments