mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
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;
|
||||
isPlainObject = require('./isPlainObject');
|
||||
|
||||
/**
|
||||
* Checks if `value` is a DOM element.
|
||||
@@ -28,14 +18,7 @@ var objToString = objectProto.toString;
|
||||
* // => 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);
|
||||
};
|
||||
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
|
||||
}
|
||||
|
||||
module.exports = isElement;
|
||||
|
||||
Reference in New Issue
Block a user