1 | ;
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = isValueSelected;
|
7 |
|
8 | // Determine if the toggle button value matches, or is contained in, the
|
9 | // candidate group value.
|
10 | function isValueSelected(value, candidate) {
|
11 | if (candidate === undefined || value === undefined) {
|
12 | return false;
|
13 | }
|
14 |
|
15 | if (Array.isArray(candidate)) {
|
16 | return candidate.indexOf(value) >= 0;
|
17 | }
|
18 |
|
19 | return value === candidate;
|
20 | } |
\ | No newline at end of file |