UNPKG

451 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = isValueSelected;
7
8// Determine if the toggle button value matches, or is contained in, the
9// candidate group value.
10function 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