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