{"version":3,"file":"index.mjs","sources":[""],"sourcesContent":["export type TIsNodeArgs = Parameters<typeof isNode>;\r\n\r\nexport type TIsNodeReturn = ReturnType<typeof isNode>;\r\n\r\n/**\r\n * Checks whether the specified object is a DOM element\r\n * @param el{any} source object\r\n * @returns {boolean}\r\n * @example\r\n * // How to check if an object is dom node?\r\n * const isMyElNode = isNode(document.getElementById(\"test\"));\n * console.log(isMyElNode) // => boolean\n * @example\n * // Guard an event target before using DOM Node methods\n * if (isNode(event.target) && container.contains(event.target)) {\n *   console.log(\"The event came from inside the container\");\n * }\n */\nexport const isNode = (el: any): boolean => {\r\n  if (typeof Element === \"undefined\" || typeof Document === \"undefined\") {\r\n    return el !== null && typeof el === \"object\" && el.nodeType === 1 && typeof el.style === \"object\" && typeof el.ownerDocument === \"object\";\r\n  } else {\r\n    return el instanceof Element || el instanceof Document;\r\n  }\r\n};\r\n"],"names":["isNode","el","Element","Document","nodeType","style","ownerDocument"],"mappings":"AAkBO,MAAMA,OAAUC,KACrB,UAAWC,UAAY,oBAAsBC,WAAa,YACxD,OAAOF,KAAO,aAAeA,KAAO,UAAYA,GAAGG,WAAa,UAAYH,GAAGI,QAAU,iBAAmBJ,GAAGK,gBAAkB,cAEjI,OAAOL,cAAcC,SAAWD,cAAcE"}