Bump to v4.15.0.

This commit is contained in:
John-David Dalton
2016-08-11 23:29:12 -07:00
parent cbf5cb1162
commit 28663c1e27
54 changed files with 344 additions and 217 deletions

View File

@@ -3,10 +3,7 @@ import isArguments from './isArguments.js';
import isArray from './isArray.js';
import isArrayLike from './isArrayLike.js';
import isBuffer from './isBuffer.js';
import isFunction from './isFunction.js';
import isObjectLike from './isObjectLike.js';
import isPrototype from './_isPrototype.js';
import isString from './isString.js';
import nativeKeys from './_nativeKeys.js';
/** `Object#toString` result references. */
@@ -60,24 +57,23 @@ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
*/
function isEmpty(value) {
if (isArrayLike(value) &&
(isArray(value) || isString(value) || isFunction(value.splice) ||
isArguments(value) || isBuffer(value))) {
(isArray(value) || typeof value == 'string' ||
typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
return !value.length;
}
if (isObjectLike(value)) {
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (nonEnumShadows || isPrototype(value)) {
return !nativeKeys(value).length;
}
var isProto = isPrototype(value);
for (var key in value) {
if (hasOwnProperty.call(value, key) &&
!(isProto && key == 'constructor')) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return !(nonEnumShadows && nativeKeys(value).length);
return true;
}
export default isEmpty;