You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
348 B
JavaScript
11 lines
348 B
JavaScript
// Determine if the toggle button value matches, or is contained in, the
|
|
// candidate group value.
|
|
export default function isValueSelected(value, candidate) {
|
|
if (candidate === undefined || value === undefined) {
|
|
return false;
|
|
}
|
|
if (Array.isArray(candidate)) {
|
|
return candidate.indexOf(value) >= 0;
|
|
}
|
|
return value === candidate;
|
|
} |