UNPKG

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