Comparing version
@@ -1,6 +0,21 @@ | ||
module.exports = function(value){ | ||
return value !== undefined | ||
&& typeof HTMLElement !== 'undefined' | ||
&& value instanceof HTMLElement | ||
&& value.nodeType === 1; | ||
} | ||
(function(root) { | ||
function isElement(value) { | ||
return (value && value.nodeType === 1) && | ||
(value && typeof value == 'object') && | ||
(Object.prototype.toString.call(value).indexOf('Element') > -1); | ||
} | ||
if (typeof exports !== 'undefined') { | ||
if (typeof module !== 'undefined' && module.exports) { | ||
exports = module.exports = isElement; | ||
} | ||
exports.isElement = isElement; | ||
} else if (typeof define === 'function' && define.amd) { | ||
define([], function() { | ||
return isElement; | ||
}); | ||
} else { | ||
root.isElement = isElement; | ||
} | ||
})(this); |
{ | ||
"name": "is-element", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Returns true if dom element", | ||
@@ -5,0 +5,0 @@ "repository": { |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1971
64.52%5
25%36
620%0
-100%