Download react-hook-form/src/logic/appendErrors.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/appendErrors.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/logic/appendErrors.ts
-
curl -L -o appendErrors.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/appendErrors.ts
476 Bytes
| import type { | |
| InternalFieldErrors, | |
| InternalFieldName, | |
| ValidateResult, | |
| } from '../types'; | |
| export default ( | |
| name: InternalFieldName, | |
| validateAllFieldCriteria: boolean, | |
| errors: InternalFieldErrors, | |
| type: string, | |
| message: ValidateResult, | |
| ) => | |
| validateAllFieldCriteria | |
| ? { | |
| ...errors[name], | |
| types: { | |
| ...(errors[name] && errors[name]!.types ? errors[name]!.types : {}), | |
| [type]: message || true, | |
| }, | |
| } | |
| : {}; | |