File tree Expand file tree Collapse file tree 8 files changed +30
-25
lines changed Expand file tree Collapse file tree 8 files changed +30
-25
lines changed Original file line number Diff line number Diff line change @@ -121,12 +121,12 @@ export const DEFAULT_CONFIGURATION = {
121
121
export const getTheme = ( options ?: Options , configuration ?: Configuration ) : Theme => {
122
122
const mergedOptions = {
123
123
...DEFAULT_OPTIONS ,
124
- ...( options ? options : { } ) ,
124
+ ...( options ?? { } ) ,
125
125
} ;
126
126
127
127
const mergedConfiguration = {
128
128
...DEFAULT_CONFIGURATION ,
129
- ...( configuration ? configuration : { } ) ,
129
+ ...( configuration ?? { } ) ,
130
130
} ;
131
131
132
132
return getZipTheme ( mergedOptions , mergedConfiguration ) ;
Original file line number Diff line number Diff line change @@ -150,12 +150,12 @@ export const DEFAULT_CONFIGURATION: ConfigurationSound = {
150
150
export const getTheme = ( options ?: Options , configuration ?: Configuration ) : Theme => {
151
151
const mergedOptions = {
152
152
...DEFAULT_OPTIONS ,
153
- ...( options ? options : { } ) ,
153
+ ...( options ?? { } ) ,
154
154
} ;
155
155
156
156
const mergedConfiguration = {
157
157
...DEFAULT_CONFIGURATION ,
158
- ...( configuration ? configuration : { } ) ,
158
+ ...( configuration ?? { } ) ,
159
159
} ;
160
160
161
161
return getZipTheme ( mergedOptions , mergedConfiguration ) ;
Original file line number Diff line number Diff line change @@ -149,12 +149,12 @@ export const DEFAULT_CONFIGURATION = {
149
149
export const getTheme = ( options ?: Options , configuration ?: Configuration ) : Theme => {
150
150
const mergedOptions = {
151
151
...DEFAULT_OPTIONS ,
152
- ...( options ? options : { } ) ,
152
+ ...( options ?? { } ) ,
153
153
} ;
154
154
155
155
const mergedConfiguration = {
156
156
...DEFAULT_CONFIGURATION ,
157
- ...( configuration ? configuration : { } ) ,
157
+ ...( configuration ?? { } ) ,
158
158
} ;
159
159
160
160
return getZipTheme ( mergedOptions , mergedConfiguration ) ;
Original file line number Diff line number Diff line change @@ -44,9 +44,10 @@ const usePagination = <T extends TableNode>(
44
44
options ?: PaginationOptions ,
45
45
context ?: any ,
46
46
) : Pagination < T > => {
47
- const controlledState : State = primary ?. state
48
- ? { ...DEFAULT_STATE , ...primary . state }
49
- : { ...DEFAULT_STATE } ;
47
+ const controlledState : State = {
48
+ ...DEFAULT_STATE ,
49
+ ...( primary ?. state ?? { } ) ,
50
+ } ;
50
51
51
52
const onChange = primary ?. onChange ? primary . onChange : ( ) => { } ;
52
53
@@ -129,7 +130,7 @@ const usePagination = <T extends TableNode>(
129
130
130
131
const mergedOptions = {
131
132
...DEFAULT_OPTIONS ,
132
- ...( options ? options : { } ) ,
133
+ ...( options ?? { } ) ,
133
134
} ;
134
135
135
136
const stateAndGetters = {
Original file line number Diff line number Diff line change @@ -110,9 +110,10 @@ const useRowSelect = <T extends TableNode>(
110
110
options ?: SelectOptions ,
111
111
context ?: any ,
112
112
) : Select < T > => {
113
- const controlledState : State = primary ?. state
114
- ? { ...DEFAULT_STATE , ...primary . state }
115
- : { ...DEFAULT_STATE } ;
113
+ const controlledState : State = {
114
+ ...DEFAULT_STATE ,
115
+ ...( primary ?. state ?? { } ) ,
116
+ } ;
116
117
117
118
const onChange = primary ?. onChange ? primary . onChange : ( ) => { } ;
118
119
@@ -122,7 +123,7 @@ const useRowSelect = <T extends TableNode>(
122
123
123
124
const mergedOptions = {
124
125
...DEFAULT_OPTIONS ,
125
- ...( options ? options : { } ) ,
126
+ ...( options ?? { } ) ,
126
127
} ;
127
128
128
129
return {
Original file line number Diff line number Diff line change @@ -89,9 +89,10 @@ const useSort = <T extends TableNode>(
89
89
options : SortOptions ,
90
90
context ?: any ,
91
91
) : Sort < T > => {
92
- const controlledState : State = primary ?. state
93
- ? { ...DEFAULT_STATE , ...primary . state }
94
- : { ...DEFAULT_STATE } ;
92
+ const controlledState : State = {
93
+ ...DEFAULT_STATE ,
94
+ ...( primary . state ?? { } ) ,
95
+ } ;
95
96
96
97
const onChange = primary ?. onChange ? primary . onChange : ( ) => { } ;
97
98
Original file line number Diff line number Diff line change @@ -35,9 +35,10 @@ const useCustom = <T extends TableNode>(
35
35
primary : StateAndChange | Nullish ,
36
36
context ?: any ,
37
37
) => {
38
- const controlledState : State = primary ?. state
39
- ? { ...DEFAULT_STATE , ...primary . state }
40
- : { ...DEFAULT_STATE } ;
38
+ const controlledState : State = {
39
+ ...DEFAULT_STATE ,
40
+ ...( primary ?. state ?? { } ) ,
41
+ } ;
41
42
42
43
const onChange = primary ?. onChange ? primary . onChange : ( ) => { } ;
43
44
Original file line number Diff line number Diff line change @@ -105,9 +105,10 @@ const useTree = <T extends TableNode>(
105
105
options ?: TreeOptions < T > ,
106
106
context ?: any ,
107
107
) : Tree < T > => {
108
- const controlledState : State = primary ?. state
109
- ? { ...DEFAULT_STATE , ...primary . state }
110
- : { ...DEFAULT_STATE } ;
108
+ const controlledState : State = {
109
+ ...DEFAULT_STATE ,
110
+ ...( primary ?. state ?? { } ) ,
111
+ } ;
111
112
112
113
const onChange = primary ?. onChange ? primary . onChange : ( ) => { } ;
113
114
@@ -117,10 +118,10 @@ const useTree = <T extends TableNode>(
117
118
118
119
const mergedOptions = {
119
120
...DEFAULT_OPTIONS ,
120
- ...( options ? options : { } ) ,
121
+ ...( options ?? { } ) ,
121
122
treeIcon : {
122
123
...DEFAULT_TREE_ICON ,
123
- ...( options ? options . treeIcon : { } ) ,
124
+ ...( options ? .treeIcon ?? { } ) ,
124
125
} ,
125
126
} ;
126
127
You can’t perform that action at this time.
0 commit comments