MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / isOptionSelected

Function isOptionSelected

core/src/utils/forms/compare-with-utils.ts:31–44  ·  view source on GitHub ↗
(
  currentValue: any[] | any,
  compareValue: any,
  compareWith?: string | CompareFn | null
)

Source from the content-addressed store, hash-verified

29 * @param compareWith The function or property name to use to compare values.
30 */
31export 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};

Callers 4

RadioClass · 0.90
createAlertInputsMethod · 0.90

Calls 1

compareOptionsFunction · 0.85

Tested by

no test coverage detected