Skip to content

Commit 0c27706

Browse files
committed
Bump to v4.17.2.
1 parent 76b7758 commit 0c27706

File tree

9 files changed

+26
-54
lines changed

9 files changed

+26
-54
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# lodash-amd v4.17.1
1+
# lodash-amd v4.17.2
22

33
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
44

@@ -27,4 +27,4 @@ require({
2727
});
2828
```
2929

30-
See the [package source](https://github.com/lodash/lodash/tree/4.17.1-amd) for more details.
30+
See the [package source](https://github.com/lodash/lodash/tree/4.17.2-amd) for more details.

_basePickBy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
1+
define(['./_baseGet', './_baseSet', './_castPath'], function(baseGet, baseSet, castPath) {
22

33
/**
44
* The base implementation of `_.pickBy` without support for iteratee shorthands.
@@ -19,7 +19,7 @@ define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
1919
value = baseGet(object, path);
2020

2121
if (predicate(value, path)) {
22-
baseSet(result, path, value);
22+
baseSet(result, castPath(path, object), value);
2323
}
2424
}
2525
return result;

_basePullAt.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./_castPath', './_isIndex', './last', './_parent', './_toKey'], function(castPath, isIndex, last, parent, toKey) {
1+
define(['./_baseUnset', './_isIndex'], function(baseUnset, isIndex) {
22

33
/** Used for built-in method references. */
44
var arrayProto = Array.prototype;
@@ -25,14 +25,8 @@ define(['./_castPath', './_isIndex', './last', './_parent', './_toKey'], functio
2525
var previous = index;
2626
if (isIndex(index)) {
2727
splice.call(array, index, 1);
28-
}
29-
else {
30-
var path = castPath(index, array),
31-
object = parent(array, path);
32-
33-
if (object != null) {
34-
delete object[toKey(last(path))];
35-
}
28+
} else {
29+
baseUnset(array, index);
3630
}
3731
}
3832
}

_baseUnset.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
define(['./_castPath', './last', './_parent', './_toKey'], function(castPath, last, parent, toKey) {
22

3-
/** Used for built-in method references. */
4-
var objectProto = Object.prototype;
5-
6-
/** Used to check objects for own properties. */
7-
var hasOwnProperty = objectProto.hasOwnProperty;
8-
93
/**
104
* The base implementation of `_.unset`.
115
*
@@ -17,8 +11,7 @@ define(['./_castPath', './last', './_parent', './_toKey'], function(castPath, la
1711
function baseUnset(object, path) {
1812
path = castPath(path, object);
1913
object = parent(object, path);
20-
var key = toKey(last(path));
21-
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
14+
return object == null || delete object[toKey(last(path))];
2215
}
2316

2417
return baseUnset;

main.js

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var undefined;
1414

1515
/** Used as the semantic version number. */
16-
var VERSION = '4.17.1';
16+
var VERSION = '4.17.2';
1717

1818
/** Used as the size to enable large array optimizations. */
1919
var LARGE_ARRAY_SIZE = 200;
@@ -3806,7 +3806,7 @@
38063806
value = baseGet(object, path);
38073807

38083808
if (predicate(value, path)) {
3809-
baseSet(result, path, value);
3809+
baseSet(result, castPath(path, object), value);
38103810
}
38113811
}
38123812
return result;
@@ -3882,14 +3882,8 @@
38823882
var previous = index;
38833883
if (isIndex(index)) {
38843884
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);
38933887
}
38943888
}
38953889
}
@@ -4353,8 +4347,7 @@
43534347
function baseUnset(object, path) {
43544348
path = castPath(path, object);
43554349
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))];
43584351
}
43594352

43604353
/**
@@ -10848,15 +10841,11 @@
1084810841
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
1084910842
return baseRest(function(args) {
1085010843
var array = args[start],
10851-
lastIndex = args.length - 1,
1085210844
otherArgs = castSlice(args, 0, start);
1085310845

1085410846
if (array) {
1085510847
arrayPush(otherArgs, array);
1085610848
}
10857-
if (start != lastIndex) {
10858-
arrayPush(otherArgs, castSlice(args, start + 1));
10859-
}
1086010849
return apply(func, this, otherArgs);
1086110850
});
1086210851
}
@@ -13471,16 +13460,16 @@
1347113460
if (object == null) {
1347213461
return result;
1347313462
}
13474-
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
13463+
var isDeep = false;
1347513464
paths = arrayMap(paths, function(path) {
1347613465
path = castPath(path, object);
13477-
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
13466+
isDeep || (isDeep = path.length > 1);
1347813467
return path;
1347913468
});
13480-
1348113469
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+
}
1348413473
var length = paths.length;
1348513474
while (length--) {
1348613475
baseUnset(result, paths[length]);
@@ -13601,8 +13590,8 @@
1360113590

1360213591
// Ensure the loop is entered when path is empty.
1360313592
if (!length) {
13604-
object = undefined;
1360513593
length = 1;
13594+
object = undefined;
1360613595
}
1360713596
while (++index < length) {
1360813597
var value = object == null ? undefined : object[toKey(path[index])];

omit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ define(['./_arrayMap', './_baseClone', './_baseUnset', './_castPath', './_copyOb
3030
if (object == null) {
3131
return result;
3232
}
33-
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
33+
var isDeep = false;
3434
paths = arrayMap(paths, function(path) {
3535
path = castPath(path, object);
36-
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
36+
isDeep || (isDeep = path.length > 1);
3737
return path;
3838
});
39-
4039
copyObject(object, getAllKeysIn(object), result);
41-
result = baseClone(result, bitmask);
42-
40+
if (isDeep) {
41+
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG);
42+
}
4343
var length = paths.length;
4444
while (length--) {
4545
baseUnset(result, paths[length]);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lodash-amd",
3-
"version": "4.17.1",
3+
"version": "4.17.2",
44
"description": "Lodash exported as AMD modules.",
55
"keywords": "amd, modules, stdlib, util",
66
"homepage": "https://lodash.com/custom-builds",

result.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ define(['./_castPath', './isFunction', './_toKey'], function(castPath, isFunctio
4040

4141
// Ensure the loop is entered when path is empty.
4242
if (!length) {
43-
object = undefined;
4443
length = 1;
44+
object = undefined;
4545
}
4646
while (++index < length) {
4747
var value = object == null ? undefined : object[toKey(path[index])];

spread.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,11 @@ define(['./_apply', './_arrayPush', './_baseRest', './_castSlice', './toInteger'
5050
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
5151
return baseRest(function(args) {
5252
var array = args[start],
53-
lastIndex = args.length - 1,
5453
otherArgs = castSlice(args, 0, start);
5554

5655
if (array) {
5756
arrayPush(otherArgs, array);
5857
}
59-
if (start != lastIndex) {
60-
arrayPush(otherArgs, castSlice(args, start + 1));
61-
}
6258
return apply(func, this, otherArgs);
6359
});
6460
}

0 commit comments

Comments
 (0)