Exit early from _.isEmpty for nullish values.

This commit is contained in:
John-David Dalton
2016-10-08 10:42:21 -07:00
parent f5dd98cac4
commit 52e96c38dc

View File

@@ -11424,6 +11424,9 @@
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {