File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -20,29 +20,21 @@ export function formatStrategyValues(
20
20
if ( strategy === SHOW_CHILD ) {
21
21
return values . filter ( key => {
22
22
const entity = keyEntities [ key ] ;
23
-
24
- if (
25
- entity &&
26
- entity . children &&
27
- entity . children . some ( ( { node } ) => valueSet . has ( node [ fieldNames . value ] ) ) &&
28
- entity . children . every (
23
+ return (
24
+ ! entity ||
25
+ ! entity . children ||
26
+ ! entity . children . some ( ( { node } ) => valueSet . has ( node [ fieldNames . value ] ) ) ||
27
+ ! entity . children . every (
29
28
( { node } ) => isCheckDisabled ( node ) || valueSet . has ( node [ fieldNames . value ] ) ,
30
29
)
31
- ) {
32
- return false ;
33
- }
34
- return true ;
30
+ ) ;
35
31
} ) ;
36
32
}
37
33
if ( strategy === SHOW_PARENT ) {
38
34
return values . filter ( key => {
39
35
const entity = keyEntities [ key ] ;
40
36
const parent = entity ? entity . parent : null ;
41
-
42
- if ( parent && ! isCheckDisabled ( parent . node ) && valueSet . has ( parent . key ) ) {
43
- return false ;
44
- }
45
- return true ;
37
+ return ! parent || isCheckDisabled ( parent . node ) || ! valueSet . has ( parent . key ) ;
46
38
} ) ;
47
39
}
48
40
return values ;
You can’t perform that action at this time.
0 commit comments