Download react-hook-form/src/utils/isHTMLElement.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 327 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/utils/isHTMLElement.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/utils/isHTMLElement.ts
-
curl -L -o isHTMLElement.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/utils/isHTMLElement.ts
327 Bytes
| import isWeb from './isWeb'; | |
| export default (value: unknown): value is HTMLElement => { | |
| if (!isWeb) { | |
| return false; | |
| } | |
| const owner = value ? ((value as HTMLElement).ownerDocument as Document) : 0; | |
| return ( | |
| value instanceof | |
| (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement) | |
| ); | |
| }; | |