Created
October 12, 2017 13:52
-
-
Save AudyOdi/4f54ce49d9df9d15c6b008b5622a7b58 to your computer and use it in GitHub Desktop.
updated ensureElement from marketwurks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| const ELEMENT_NODE = 1; | |
| export default function ensureElement(el: Element | Text | null): ?Element { | |
| if (!el || el.nodeType !== ELEMENT_NODE) { | |
| return; | |
| } | |
| let element: any = el; | |
| return (element: Element); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment