Minor code format tweak for _.isBoolean, _.isElement, _.isNumber, and _.isString.

This commit is contained in:
John-David Dalton
2014-09-22 09:44:54 -07:00
parent aaa840ebef
commit 277d91afce

View File

@@ -6758,8 +6758,8 @@
* // => false * // => false
*/ */
function isBoolean(value) { function isBoolean(value) {
return (value === true || value === false || return (value === true || value === false || value && typeof value == 'object' &&
value && typeof value == 'object' && toString.call(value) == boolClass) || false; toString.call(value) == boolClass) || false;
} }
/** /**
@@ -6805,8 +6805,7 @@
// fallback for environments without DOM support // fallback for environments without DOM support
if (!support.dom) { if (!support.dom) {
isElement = function(value) { isElement = function(value) {
return (value && typeof value == 'object' && value.nodeType === 1 && return (value && typeof value == 'object' && value.nodeType === 1 && !isPlainObject(value)) || false;
!isPlainObject(value)) || false;
}; };
} }
@@ -7107,8 +7106,7 @@
*/ */
function isNumber(value) { function isNumber(value) {
var type = typeof value; var type = typeof value;
return type == 'number' || return type == 'number' || (value && type == 'object' && toString.call(value) == numberClass) || false;
(value && type == 'object' && toString.call(value) == numberClass) || false;
} }
/** /**
@@ -7191,8 +7189,8 @@
* // => false * // => false
*/ */
function isString(value) { function isString(value) {
return typeof value == 'string' || return typeof value == 'string' || (value && typeof value == 'object' &&
(value && typeof value == 'object' && toString.call(value) == stringClass) || false; toString.call(value) == stringClass) || false;
} }
/** /**