Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-26 00:00:36 -07:00
parent a83b4ebd53
commit ce0b51888c
394 changed files with 1789 additions and 841 deletions

View File

@@ -5,8 +5,6 @@ import isIndex from './_isIndex';
import isKey from './_isKey';
import isLength from './isLength';
import isString from './isString';
import last from './last';
import parent from './_parent';
/**
* Checks if `path` exists on `object`.
@@ -24,10 +22,16 @@ function hasPath(object, path, hasFunc) {
var result = hasFunc(object, path);
if (!result && !isKey(path)) {
path = baseCastPath(path);
object = parent(object, path);
if (object != null) {
path = last(path);
result = hasFunc(object, path);
var index = -1,
length = path.length;
while (object != null && ++index < length) {
var key = path[index];
if (!(result = hasFunc(object, key))) {
break;
}
object = object[key];
}
}
var length = object ? object.length : undefined;