Skip to content

Instantly share code, notes, and snippets.

@AudyOdi
Created October 12, 2017 13:52
Show Gist options
  • Select an option

  • Save AudyOdi/4f54ce49d9df9d15c6b008b5622a7b58 to your computer and use it in GitHub Desktop.

Select an option

Save AudyOdi/4f54ce49d9df9d15c6b008b5622a7b58 to your computer and use it in GitHub Desktop.
updated ensureElement from marketwurks
// @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