mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
more work
This commit is contained in:
41
node_modules/lodash/lang/isElement.js
generated
vendored
Normal file
41
node_modules/lodash/lang/isElement.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
var isObjectLike = require('../internal/isObjectLike'),
|
||||
isPlainObject = require('./isPlainObject'),
|
||||
support = require('../support');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a DOM element.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isElement(document.body);
|
||||
* // => true
|
||||
*
|
||||
* _.isElement('<body>');
|
||||
* // => false
|
||||
*/
|
||||
function isElement(value) {
|
||||
return !!value && value.nodeType === 1 && isObjectLike(value) &&
|
||||
(objToString.call(value).indexOf('Element') > -1);
|
||||
}
|
||||
// Fallback for environments without DOM support.
|
||||
if (!support.dom) {
|
||||
isElement = function(value) {
|
||||
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = isElement;
|
Reference in New Issue
Block a user