( currentValue: any[] | any, compareValue: any, compareWith?: string | CompareFn | null )
| 29 | * @param compareWith The function or property name to use to compare values. |
| 30 | */ |
| 31 | export const isOptionSelected = ( |
| 32 | currentValue: any[] | any, |
| 33 | compareValue: any, |
| 34 | compareWith?: string | CompareFn | null |
| 35 | ) => { |
| 36 | if (currentValue === undefined) { |
| 37 | return false; |
| 38 | } |
| 39 | if (Array.isArray(currentValue)) { |
| 40 | return currentValue.some((val) => compareOptions(val, compareValue, compareWith)); |
| 41 | } else { |
| 42 | return compareOptions(currentValue, compareValue, compareWith); |
| 43 | } |
| 44 | }; |
no test coverage detected