Use nullish checks instead of coercing to booleans.

This commit is contained in:
John-David Dalton
2016-09-10 10:48:36 -07:00
parent 8176d56c72
commit 8fa23a94a0

View File

@@ -11271,7 +11271,7 @@
* // => false
*/
function isElement(value) {
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
return value != null && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
}
/**
@@ -11566,7 +11566,7 @@
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
return value != null && (type == 'object' || type == 'function');
}
/**
@@ -11594,7 +11594,7 @@
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
return value != null && typeof value == 'object';
}
/**