Download react-hook-form/src/logic/unsetEmptyArray.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 208 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/unsetEmptyArray.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/unsetEmptyArray.ts
-
curl -L -o unsetEmptyArray.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/unsetEmptyArray.ts
208 Bytes
| import compact from '../utils/compact'; | |
| import get from '../utils/get'; | |
| import unset from '../utils/unset'; | |
| export default <T>(ref: T, name: string) => | |
| !compact(get(ref, name)).length && unset(ref, name); | |