UNPKG

@resk/core

Version:

An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla

12 lines (11 loc) 629 B
/** * Checks if the given object is a DOM element. * * This function performs a series of checks to determine if the object is a DOM element. * It first checks if the `window` and `document` objects are available, and if the `HTMLElement` constructor is defined. * Then, it checks if the object is an instance of `HTMLElement` or if it has the characteristics of a DOM element (e.g., `nodeType` equals 1 and `nodeName` is defined). * * @param element The object to check. * @returns `true` if the object is a DOM element, `false` otherwise. */ export default function isDOMElement(element: any): element is HTMLElement;