|
12 | 12 | var undefined; |
13 | 13 |
|
14 | 14 | /** Used as the semantic version number. */ |
15 | | - var VERSION = '4.17.1'; |
| 15 | + var VERSION = '4.17.2'; |
16 | 16 |
|
17 | 17 | /** Used as the size to enable large array optimizations. */ |
18 | 18 | var LARGE_ARRAY_SIZE = 200; |
|
3805 | 3805 | value = baseGet(object, path); |
3806 | 3806 |
|
3807 | 3807 | if (predicate(value, path)) { |
3808 | | - baseSet(result, path, value); |
| 3808 | + baseSet(result, castPath(path, object), value); |
3809 | 3809 | } |
3810 | 3810 | } |
3811 | 3811 | return result; |
|
3881 | 3881 | var previous = index; |
3882 | 3882 | if (isIndex(index)) { |
3883 | 3883 | splice.call(array, index, 1); |
3884 | | - } |
3885 | | - else { |
3886 | | - var path = castPath(index, array), |
3887 | | - object = parent(array, path); |
3888 | | - |
3889 | | - if (object != null) { |
3890 | | - delete object[toKey(last(path))]; |
3891 | | - } |
| 3884 | + } else { |
| 3885 | + baseUnset(array, index); |
3892 | 3886 | } |
3893 | 3887 | } |
3894 | 3888 | } |
|
4352 | 4346 | function baseUnset(object, path) { |
4353 | 4347 | path = castPath(path, object); |
4354 | 4348 | object = parent(object, path); |
4355 | | - var key = toKey(last(path)); |
4356 | | - return !(object != null && hasOwnProperty.call(object, key)) || delete object[key]; |
| 4349 | + return object == null || delete object[toKey(last(path))]; |
4357 | 4350 | } |
4358 | 4351 |
|
4359 | 4352 | /** |
@@ -10847,15 +10840,11 @@ |
10847 | 10840 | start = start === undefined ? 0 : nativeMax(toInteger(start), 0); |
10848 | 10841 | return baseRest(function(args) { |
10849 | 10842 | var array = args[start], |
10850 | | - lastIndex = args.length - 1, |
10851 | 10843 | otherArgs = castSlice(args, 0, start); |
10852 | 10844 |
|
10853 | 10845 | if (array) { |
10854 | 10846 | arrayPush(otherArgs, array); |
10855 | 10847 | } |
10856 | | - if (start != lastIndex) { |
10857 | | - arrayPush(otherArgs, castSlice(args, start + 1)); |
10858 | | - } |
10859 | 10848 | return apply(func, this, otherArgs); |
10860 | 10849 | }); |
10861 | 10850 | } |
@@ -13470,16 +13459,16 @@ |
13470 | 13459 | if (object == null) { |
13471 | 13460 | return result; |
13472 | 13461 | } |
13473 | | - var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG; |
| 13462 | + var isDeep = false; |
13474 | 13463 | paths = arrayMap(paths, function(path) { |
13475 | 13464 | path = castPath(path, object); |
13476 | | - bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0); |
| 13465 | + isDeep || (isDeep = path.length > 1); |
13477 | 13466 | return path; |
13478 | 13467 | }); |
13479 | | - |
13480 | 13468 | copyObject(object, getAllKeysIn(object), result); |
13481 | | - result = baseClone(result, bitmask); |
13482 | | - |
| 13469 | + if (isDeep) { |
| 13470 | + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG); |
| 13471 | + } |
13483 | 13472 | var length = paths.length; |
13484 | 13473 | while (length--) { |
13485 | 13474 | baseUnset(result, paths[length]); |
|
13600 | 13589 |
|
13601 | 13590 | // Ensure the loop is entered when path is empty. |
13602 | 13591 | if (!length) { |
13603 | | - object = undefined; |
13604 | 13592 | length = 1; |
| 13593 | + object = undefined; |
13605 | 13594 | } |
13606 | 13595 | while (++index < length) { |
13607 | 13596 | var value = object == null ? undefined : object[toKey(path[index])]; |
|
0 commit comments