Download react-hook-form/src/logic/isWatched.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/isWatched.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/logic/isWatched.ts
-
curl -L -o isWatched.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/isWatched.ts
368 Bytes
| import type { InternalFieldName, Names } from '../types'; | |
| export default ( | |
| name: InternalFieldName, | |
| _names: Names, | |
| isBlurEvent?: boolean, | |
| ) => | |
| !isBlurEvent && | |
| (_names.watchAll || | |
| _names.watch.has(name) || | |
| [..._names.watch].some( | |
| (watchName) => | |
| name.startsWith(watchName) && | |
| /^\.\w+/.test(name.slice(watchName.length)), | |
| )); | |