UNPKG

@uppy/utils

Version:

Shared utility functions for Uppy Core and plugins maintained by the Uppy team.

9 lines (8 loc) 297 B
/** * Check if an object is a DOM element. Duck-typing based on `nodeType`. */ export default function isDOMElement(obj: unknown): obj is Element { if (typeof obj !== 'object' || obj === null) return false if (!('nodeType' in obj)) return false return obj.nodeType === Node.ELEMENT_NODE }