@@ -441,16 +441,16 @@ class ValueStore {
441
441
return true ;
442
442
}
443
443
getOriginalProps ( ) {
444
- return Object . assign ( { } , this . props ) ;
444
+ return { ... this . props } ;
445
445
}
446
446
getDirtyProps ( ) {
447
- return Object . assign ( { } , this . dirtyProps ) ;
447
+ return { ... this . dirtyProps } ;
448
448
}
449
449
getUpdatedPropsFromParent ( ) {
450
- return Object . assign ( { } , this . updatedPropsFromParent ) ;
450
+ return { ... this . updatedPropsFromParent } ;
451
451
}
452
452
flushDirtyPropsToPending ( ) {
453
- this . pendingProps = Object . assign ( { } , this . dirtyProps ) ;
453
+ this . pendingProps = { ... this . dirtyProps } ;
454
454
this . dirtyProps = { } ;
455
455
}
456
456
reinitializeAllProps ( props ) {
@@ -459,7 +459,7 @@ class ValueStore {
459
459
this . pendingProps = { } ;
460
460
}
461
461
pushPendingPropsBackToDirty ( ) {
462
- this . dirtyProps = Object . assign ( Object . assign ( { } , this . pendingProps ) , this . dirtyProps ) ;
462
+ this . dirtyProps = { ... this . pendingProps , ... this . dirtyProps } ;
463
463
this . pendingProps = { } ;
464
464
}
465
465
storeNewPropsFromParent ( props ) {
@@ -1905,11 +1905,10 @@ class Component {
1905
1905
this . id = id ;
1906
1906
this . listeners = new Map ( ) ;
1907
1907
listeners . forEach ( ( listener ) => {
1908
- var _a ;
1909
1908
if ( ! this . listeners . has ( listener . event ) ) {
1910
1909
this . listeners . set ( listener . event , [ ] ) ;
1911
1910
}
1912
- ( _a = this . listeners . get ( listener . event ) ) === null || _a === void 0 ? void 0 : _a . push ( listener . action ) ;
1911
+ this . listeners . get ( listener . event ) ? .push ( listener . action ) ;
1913
1912
} ) ;
1914
1913
this . valueStore = new ValueStore ( props ) ;
1915
1914
this . unsyncedInputsTracker = new UnsyncedInputsTracker ( this , elementDriver ) ;
@@ -2040,14 +2039,13 @@ class Component {
2040
2039
this . valueStore . flushDirtyPropsToPending ( ) ;
2041
2040
this . isRequestPending = false ;
2042
2041
this . backendRequest . promise . then ( async ( response ) => {
2043
- var _a ;
2044
2042
const backendResponse = new BackendResponse ( response ) ;
2045
2043
const html = await backendResponse . getBody ( ) ;
2046
2044
for ( const input of Object . values ( this . pendingFiles ) ) {
2047
2045
input . value = '' ;
2048
2046
}
2049
2047
const headers = backendResponse . response . headers ;
2050
- if ( ! ( ( _a = headers . get ( 'Content-Type' ) ) === null || _a === void 0 ? void 0 : _a . includes ( 'application/vnd.live-component+html' ) ) && ! headers . get ( 'X-Live-Redirect' ) ) {
2048
+ if ( ! headers . get ( 'Content-Type' ) ? .includes ( 'application/vnd.live-component+html' ) && ! headers . get ( 'X-Live-Redirect' ) ) {
2051
2049
const controls = { displayError : true } ;
2052
2050
this . valueStore . pushPendingPropsBackToDirty ( ) ;
2053
2051
this . hooks . triggerHook ( 'response:error' , backendResponse , controls ) ;
@@ -2427,9 +2425,8 @@ class LoadingPlugin {
2427
2425
targetedModels . push ( modifier . value ) ;
2428
2426
} ) ;
2429
2427
directive . modifiers . forEach ( ( modifier ) => {
2430
- var _a ;
2431
2428
if ( validModifiers . has ( modifier . name ) ) {
2432
- const callable = ( _a = validModifiers . get ( modifier . name ) ) !== null && _a !== void 0 ? _a : ( ( ) => { } ) ;
2429
+ const callable = validModifiers . get ( modifier . name ) ?? ( ( ) => { } ) ;
2433
2430
callable ( modifier ) ;
2434
2431
return ;
2435
2432
}
@@ -2764,7 +2761,7 @@ function toQueryString(data) {
2764
2761
}
2765
2762
else if ( null !== iValue ) {
2766
2763
if ( typeof iValue === 'object' ) {
2767
- entries = Object . assign ( Object . assign ( { } , entries ) , buildQueryStringEntries ( iValue , entries , key ) ) ;
2764
+ entries = { ... entries , ... buildQueryStringEntries ( iValue , entries , key ) } ;
2768
2765
}
2769
2766
else {
2770
2767
entries [ key ] = encodeURIComponent ( iValue )
@@ -2913,16 +2910,14 @@ class LazyPlugin {
2913
2910
this . intersectionObserver = null ;
2914
2911
}
2915
2912
attachToComponent ( component ) {
2916
- var _a ;
2917
- if ( 'lazy' !== ( ( _a = component . element . attributes . getNamedItem ( 'loading' ) ) === null || _a === void 0 ? void 0 : _a . value ) ) {
2913
+ if ( 'lazy' !== component . element . attributes . getNamedItem ( 'loading' ) ?. value ) {
2918
2914
return ;
2919
2915
}
2920
2916
component . on ( 'connect' , ( ) => {
2921
2917
this . getObserver ( ) . observe ( component . element ) ;
2922
2918
} ) ;
2923
2919
component . on ( 'disconnect' , ( ) => {
2924
- var _a ;
2925
- ( _a = this . intersectionObserver ) === null || _a === void 0 ? void 0 : _a . unobserve ( component . element ) ;
2920
+ this . intersectionObserver ?. unobserve ( component . element ) ;
2926
2921
} ) ;
2927
2922
}
2928
2923
getObserver ( ) {
@@ -2976,7 +2971,7 @@ class LiveControllerDefault extends Controller {
2976
2971
throw new Error ( `No action name provided on element: ${ getElementAsTagText ( event . currentTarget ) } . Did you forget to add the "data-live-action-param" attribute?` ) ;
2977
2972
}
2978
2973
const rawAction = params . action ;
2979
- const actionArgs = Object . assign ( { } , params ) ;
2974
+ const actionArgs = { ... params } ;
2980
2975
delete actionArgs . action ;
2981
2976
const directives = parseDirectives ( rawAction ) ;
2982
2977
let debounce = false ;
@@ -3003,9 +2998,8 @@ class LiveControllerDefault extends Controller {
3003
2998
}
3004
2999
} ) ;
3005
3000
directive . modifiers . forEach ( ( modifier ) => {
3006
- var _a ;
3007
3001
if ( validModifiers . has ( modifier . name ) ) {
3008
- const callable = ( _a = validModifiers . get ( modifier . name ) ) !== null && _a !== void 0 ? _a : ( ( ) => { } ) ;
3002
+ const callable = validModifiers . get ( modifier . name ) ?? ( ( ) => { } ) ;
3009
3003
callable ( modifier ) ;
3010
3004
return ;
3011
3005
}
@@ -3056,7 +3050,7 @@ class LiveControllerDefault extends Controller {
3056
3050
throw new Error ( `No event name provided on element: ${ getElementAsTagText ( event . currentTarget ) } . Did you forget to add the "data-live-event-param" attribute?` ) ;
3057
3051
}
3058
3052
const eventInfo = params . event ;
3059
- const eventArgs = Object . assign ( { } , params ) ;
3053
+ const eventArgs = { ... params } ;
3060
3054
delete eventArgs . event ;
3061
3055
const directives = parseDirectives ( eventInfo ) ;
3062
3056
const emits = [ ] ;
@@ -3133,7 +3127,6 @@ class LiveControllerDefault extends Controller {
3133
3127
this . updateModelFromElementEvent ( target , 'change' ) ;
3134
3128
}
3135
3129
updateModelFromElementEvent ( element , eventName ) {
3136
- var _a ;
3137
3130
if ( ! elementBelongsToThisComponent ( element , this . component ) ) {
3138
3131
return ;
3139
3132
}
@@ -3142,7 +3135,7 @@ class LiveControllerDefault extends Controller {
3142
3135
}
3143
3136
if ( element instanceof HTMLInputElement && element . type === 'file' ) {
3144
3137
const key = element . name ;
3145
- if ( ( _a = element . files ) === null || _a === void 0 ? void 0 : _a . length ) {
3138
+ if ( element . files ? .length ) {
3146
3139
this . pendingFiles [ key ] = element ;
3147
3140
}
3148
3141
else if ( this . pendingFiles [ key ] ) {
0 commit comments