@@ -20,14 +20,16 @@ export function toInnerValue(
20
20
value : DefaultValueType ,
21
21
{ labelInValue, combobox } : { labelInValue : boolean ; combobox : boolean } ,
22
22
) : RawValueType [ ] {
23
- if ( value === undefined || value === null || ( value === '' && combobox ) ) {
23
+ if ( value === undefined || ( value === '' && combobox ) ) {
24
24
return [ ] ;
25
25
}
26
26
27
27
const values = Array . isArray ( value ) ? value : [ value ] ;
28
28
29
29
if ( labelInValue ) {
30
- return values . map ( ( { key, value : val } : LabelValueType ) => ( val !== undefined ? val : key ) ) ;
30
+ return ( values as LabelValueType [ ] ) . map (
31
+ ( { key, value : val } : LabelValueType ) => ( val !== undefined ? val : key ) ,
32
+ ) ;
31
33
}
32
34
33
35
return values as RawValueType [ ] ;
@@ -56,7 +58,12 @@ export function toOuterValues<FOT extends FlattenOptionsType>(
56
58
57
59
if ( labelInValue ) {
58
60
values = values . map ( val =>
59
- getLabeledValue ( val , { options, prevValue, labelInValue, optionLabelProp } ) ,
61
+ getLabeledValue ( val , {
62
+ options,
63
+ prevValue,
64
+ labelInValue,
65
+ optionLabelProp,
66
+ } ) ,
60
67
) ;
61
68
}
62
69
@@ -70,7 +77,11 @@ export function removeLastEnabledValue<
70
77
const newValues = [ ...values ] ;
71
78
72
79
let removeIndex : number ;
73
- for ( removeIndex = measureValues . length - 1 ; removeIndex >= 0 ; removeIndex -= 1 ) {
80
+ for (
81
+ removeIndex = measureValues . length - 1 ;
82
+ removeIndex >= 0 ;
83
+ removeIndex -= 1
84
+ ) {
74
85
if ( ! measureValues [ removeIndex ] . disabled ) {
75
86
break ;
76
87
}
@@ -90,7 +101,9 @@ export function removeLastEnabledValue<
90
101
}
91
102
92
103
export const isClient =
93
- typeof window !== 'undefined' && window . document && window . document . documentElement ;
104
+ typeof window !== 'undefined' &&
105
+ window . document &&
106
+ window . document . documentElement ;
94
107
95
108
/** Is client side and not jsdom */
96
109
export const isBrowserClient = process . env . NODE_ENV !== 'test' && isClient ;
0 commit comments