/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/logic/getEventValue.ts
14 строк
483 B
Ivan Ulloque
🍖 enhance getEventValue to handle file inputs (#13289)
18 июл 2026, 08:57
Не верифицирован
18 июл 2026, 08:57
2ebc8d0
Код
Авторство
О чём код?
import isCheckBoxInput from '../utils/isCheckBoxInput'; import isFileInput from '../utils/isFileInput'; import isObject from '../utils/isObject'; type Event = { target: any }; export default (event: unknown) => isObject(event) && (event as Event).target ? isCheckBoxInput((event as Event).target) ? (event as Event).target.checked : isFileInput((event as Event).target) ? (event as Event).target.files : (event as Event).target.value : event;