reports/frontend/node_modules/es-toolkit/dist/compat/predicate/isElement.mjs
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

18 lines
556 B
JavaScript

import { isPlainObject } from "./isPlainObject.mjs";
import { isObjectLike } from "./isObjectLike.mjs";
//#region src/compat/predicate/isElement.ts
/**
* Checks if `value` is likely a DOM element.
*
* @param value The value to check.
* @returns Returns `true` if `value` is a DOM element, else `false`.
*
* @example
* console.log(isElement(document.body)); // true
* console.log(isElement('<body>')); // false
*/
function isElement(value) {
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
}
//#endregion
export { isElement };