8000 Bump to v4.17.20. · lodash/lodash@42e2585 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42e2585

Browse files
committed
Bump to v4.17.20.
1 parent 4d5fdc4 commit 42e2585

16 files changed

+78
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# lodash-es v4.17.15
1+
# lodash-es v4.17.20
22

33
The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
44

@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
77
$ lodash modularize exports=es -o ./
88
```
99

10-
See the [package source](https://github.com/lodash/lodash/tree/4.17.15-es) for more details.
10+
See the [package source](https://github.com/lodash/lodash/tree/4.17.20-es) for more details.

_baseClone.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import isMap from './isMap.js';
1919
import isObject from './isObject.js';
2020
import isSet from './isSet.js';
2121
import keys from './keys.js';
22+
import keysIn from './keysIn.js';
2223

2324
/** Used to compose bitmasks for cloning. */
2425
var CLONE_DEEP_FLAG = 1,

_baseOrderBy.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import arrayMap from './_arrayMap.js';
2+
import baseGet from './_baseGet.js';
23
import baseIteratee from './_baseIteratee.js';
34
import baseMap from './_baseMap.js';
45
import baseSortBy from './_baseSortBy.js';
56
import baseUnary from './_baseUnary.js';
67
import compareMultiple from './_compareMultiple.js';
78
import identity from './identity.js';
9+
import isArray from './isArray.js';
810

911
/**
1012
* The base implementation of `_.orderBy` without param guards.
@@ -16,8 +18,21 @@ import identity from './identity.js';
1618
* @returns {Array} Returns the new sorted array.
1719
*/
1820
function baseOrderBy(collection, iteratees, orders) {
21+
if (iteratees.length) {
22+
iteratees = arrayMap(iteratees, function(iteratee) {
23+
if (isArray(iteratee)) {
24+
return function(value) {
25+
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
26+
}
27+
}
28+
return iteratee;
29+
});
30+
} else {
31+
iteratees = [identity];
32+
}
33+
1934
var index = -1;
20-
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
35+
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
2136

2237
var result = baseMap(collection, function(value, key, collection) {
2338
var criteria = arrayMap(iteratees, function(iteratee) {

_baseSet.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function baseSet(object, path, value, customizer) {
2929
var key = toKey(path[index]),
3030
newValue = value;
3131

32+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
33+
return object;
34+
}
35+
3236
if (index != lastIndex) {
3337
var objValue = nested[key];
3438
newValue = customizer ? customizer(objValue, key, nested) : undefined;

_baseSortedIndexBy.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ var nativeFloor = Math.floor,
2222
* into `array`.
2323
*/
2424
function baseSortedIndexBy(array, value, iteratee, retHighest) {
25-
value = iteratee(value);
26-
2725
var low = 0,
28-
high = array == null ? 0 : array.length,
29-
valIsNaN = value !== value,
26+
high = array == null ? 0 : array.length;
27+
if (high === 0) {
28+
return 0;
29+
}
30+
31+
value = iteratee(value);
32+
var valIsNaN = value !== value,
3033
valIsNull = value === null,
3134
valIsSymbol = isSymbol(value),
3235
valIsUndefined = value === undefined;

_equalArrays.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
2727
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
2828
return false;
2929
}
30-
// Assume cyclic values are equal.
31-
var stacked = stack.get(array);
32-
if (stacked && stack.get(other)) {
33-
return stacked == other;
30+
// Check that cyclic values are equal.
31+
var arrStacked = stack.get(array);
32+
var othStacked = stack.get(other);
33+
if (arrStacked && othStacked) {
34+
return arrStacked == other && othStacked == array;
3435
}
3536
var index = -1,
3637
result = true,

_equalObjects.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
3939
return false;
4040
}
4141
}
42-
// Assume cyclic values are equal.
43-
var stacked = stack.get(object);
44-
if (stacked && stack.get(other)) {
45-
return stacked == other;
42+
// Check that cyclic values are equal.
43+
var objStacked = stack.get(object);
44+
var othStacked = stack.get(other);
45+
if (objStacked && othStacked) {
46+
return objStacked == other && othStacked == object;
4647
}
4748
var result = true;
4849
stack.set(object, other);

filter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ import isArray from './isArray.js';
3939
* // The `_.property` iteratee shorthand.
4040
* _.filter(users, 'active');
4141
* // => objects for ['barney']
42+
*
43+
* // Combining several predicates using `_.overEvery` or `_.overSome`.
44+
* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
45+
* // => objects for ['fred', 'barney']
4246
*/
4347
function filter(collection, predicate) {
4448
var func = isArray(collection) ? arrayFilter : baseFilter;

lodash.default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import toInteger from './toInteger.js';
4545
import lodash from './wrapperLodash.js';
4646

4747
/** Used as the semantic version number. */
48-
var VERSION = '4.17.15';
48+
var VERSION = '4.17.20';
4949

5050
/** Used to compose bitmasks for function metadata. */
5151
var WRAP_BIND_KEY_FLAG = 2;

matches.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ var CLONE_DEEP_FLAG = 1;
1616
* values against any array or object value, respectively. See `_.isEqual`
1717
* for a list of supported value comparisons.
1818
*
19+
* **Note:** Multiple values can be checked by combining several matchers
20+
* using `_.overSome`
21+
*
1922
* @static
2023
* @memberOf _
2124
* @since 3.0.0
@@ -31,6 +34,10 @@ var CLONE_DEEP_FLAG = 1;
3134
*
3235
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
3336
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
37+
*
38+
* // Checking for several possible values
39+
* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
40+
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
3441
*/
3542
function matches(source) {
3643
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));

0 commit comments

Comments
 (0)
0