"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const isDOMNode_1 = __importDefault(require("./isDOMNode")); /** * Is the given object a DOM element node and optionally of a given type * * @param obj - The object to check * @param tags - Tag name to match * @return Is it a DOM element node or not and optionally of the right type */ function isDOMElement(obj, tags) { if (!isDOMNode_1.default(obj)) { return false; } const isElm = obj.nodeType === Node.ELEMENT_NODE; if (!isElm || !tags) { return isElm; } if (!Array.isArray(tags)) { tags = [tags]; } const { tagName } = obj; return tags.some((tag) => tag.toUpperCase() === tagName); } exports.default = isDOMElement;