@softchef/cdk-iot-device-management
Version:
IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.
30 lines (26 loc) • 769 B
JavaScript
;
var div = typeof document !== "undefined" && document.createElement("div");
/**
* Returns `true` when `object` is a DOM element node.
*
* Unlike Underscore.js/lodash, this function will return `false` if `object`
* is an *element-like* object, i.e. a regular object with a `nodeType`
* property that holds the value `1`.
*
* @alias module:samsam.isElement
* @param {object} object The object to examine
* @returns {boolean} Returns `true` for DOM element nodes
*/
function isElement(object) {
if (!object || object.nodeType !== 1 || !div) {
return false;
}
try {
object.appendChild(div);
object.removeChild(div);
} catch (e) {
return false;
}
return true;
}
module.exports = isElement;