@@ -745,15 +745,14 @@ export class JsonServiceClient {
745
745
static toBase64 ;
746
746
constructor ( baseUrl = "/" ) {
747
747
this . baseUrl = baseUrl ;
748
- this . replyBaseUrl = combinePaths ( baseUrl , "json" , "reply" ) + "/" ;
749
- this . oneWayBaseUrl = combinePaths ( baseUrl , "json" , "oneway" ) + "/" ;
750
748
this . mode = "cors" ;
751
749
this . credentials = "include" ;
752
750
this . headers = new Headers ( ) ;
753
751
this . headers . set ( "Content-Type" , "application/json" ) ;
754
752
this . manageCookies = typeof document == "undefined" ; //because node-fetch doesn't
755
753
this . cookies = { } ;
756
754
this . enableAutoRefreshToken = true ;
755
+ this . basePath = 'api' ;
757
756
}
758
757
setCredentials ( userName , password ) {
759
758
this . userName = userName ;
@@ -769,9 +768,6 @@ export class JsonServiceClient {
769
768
this . oneWayBaseUrl = combinePaths ( this . baseUrl , "json" , "oneway" ) + "/" ;
770
769
}
771
770
else {
772
- if ( path [ 0 ] != '/' ) {
773
- path = '/' + path ;
774
- }
775
771
this . replyBaseUrl = combinePaths ( this . baseUrl , path ) + "/" ;
776
772
this . oneWayBaseUrl = combinePaths ( this . baseUrl , path ) + "/" ;
777
773
}
@@ -1767,7 +1763,7 @@ export function $1(sel, el) {
1767
1763
}
1768
1764
export function $$ ( sel , el ) {
1769
1765
if ( typeof sel === "string" )
1770
- return Array . from ( ( el || document ) . querySelectorAll ( sel ) ) ;
1766
+ return Array . from ( ( el || typeof document != "undefined" ? document : null ) ? .querySelectorAll ( sel ) ?? [ ] ) ;
1771
1767
if ( Array . isArray ( sel ) )
1772
1768
return sel . flatMap ( x => $$ ( x , el ) ) ;
1773
1769
return [ sel ] ;
@@ -2251,30 +2247,34 @@ export function safeVarName(s) {
2251
2247
}
2252
2248
export function pick ( o , keys ) {
2253
2249
const to = { } ;
2254
- for ( const k in o ) {
2255
- if ( o . hasOwnProperty ( k ) && keys . indexOf ( k ) >= 0 ) {
2250
+ Object . keys ( o ) . forEach ( k => {
2251
+ if ( keys . indexOf ( k ) >= 0 ) {
2256
2252
to [ k ] = o [ k ] ;
2257
2253
}
2258
- }
2254
+ } ) ;
2259
2255
return to ;
2260
2256
}
2261
2257
export function omit ( o , keys ) {
2262
2258
const to = { } ;
2263
- for ( const k in o ) {
2264
- if ( o . hasOwnProperty ( k ) && keys . indexOf ( k ) < 0 ) {
2259
+ if ( ! o )
2260
+ return to ;
2261
+ Object . keys ( o ) . forEach ( k => {
2262
+ if ( keys . indexOf ( k ) < 0 ) {
2265
2263
to [ k ] = o [ k ] ;
2266
2264
}
2267
- }
2265
+ } ) ;
2268
2266
return to ;
2269
2267
}
2270
2268
export function omitEmpty ( o ) {
2271
2269
const to = { } ;
2272
- for ( const k in o ) {
2270
+ if ( ! o )
2271
+ return to ;
2272
+ Object . keys ( o ) . forEach ( k => {
2273
2273
const v = o [ k ] ;
2274
2274
if ( v != null && v !== '' ) {
2275
2275
to [ k ] = v ;
2276
2276
}
2277
- }
2277
+ } ) ;
2278
2278
return to ;
2279
2279
}
2280
2280
export function apply ( x , fn ) {
0 commit comments