/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/ToggleButtonGroup/isValueSelected.js
13 строк
347 B
Eng Zer Jun
[core] Replace more `indexOf` with `includes` (#43694)
12 сен 2024, 15:15
Не верифицирован
12 сен 2024, 15:15
092e100
Код
Авторство
О чём код?
// 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.includes(value); } return value === candidate; }