Make _.isEmpty work as expected on buffers.

This commit is contained in:
Federico De Giuli
2016-03-22 18:48:11 -04:00
committed by John-David Dalton
parent 583b03ba5f
commit 271f64ee3f
2 changed files with 13 additions and 5 deletions

View File

@@ -10173,8 +10173,8 @@
/**
* Checks if `value` is an empty object or collection. A value is considered
* empty if it's an `arguments` object, array, string, or jQuery-like collection
* with a length of `0` or has no own enumerable string keyed properties.
* empty if it's an `arguments` object, array, buffer, string, or jQuery-like
* collection with a length of `0` or has no own enumerable string keyed properties.
*
* @static
* @memberOf _
@@ -10201,8 +10201,8 @@
*/
function isEmpty(value) {
if (isArrayLike(value) &&
(isArray(value) || isString(value) ||
isFunction(value.splice) || isArguments(value))) {
(isArray(value) || isString(value) || isFunction(value.splice) ||
isArguments(value) || isBuffer(value))) {
return !value.length;
}
for (var key in value) {