1 | // Determine if the toggle button value matches, or is contained in, the
|
2 | // candidate group value.
|
3 | export default function isValueSelected(value, candidate) {
|
4 | if (candidate === undefined || value === undefined) {
|
5 | return false;
|
6 | }
|
7 |
|
8 | if (Array.isArray(candidate)) {
|
9 | return candidate.indexOf(value) >= 0;
|
10 | }
|
11 |
|
12 | return value === candidate;
|
13 | } |
\ | No newline at end of file |