Skip to content

Commit db9697d

Browse files
committed
Bump to v4.17.2.
1 parent 5585b3a commit db9697d

File tree

14 files changed

+176
-176
lines changed

14 files changed

+176
-176
lines changed

README.md

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

33
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
44

@@ -28,7 +28,7 @@ var at = require('lodash/at');
2828
var curryN = require('lodash/fp/curryN');
2929
```
3030

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

3333
**Note:**<br>
3434
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.

_basePickBy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var baseGet = require('./_baseGet'),
2-
baseSet = require('./_baseSet');
2+
baseSet = require('./_baseSet'),
3+
castPath = require('./_castPath');
34

45
/**
56
* The base implementation of `_.pickBy` without support for iteratee shorthands.
@@ -20,7 +21,7 @@ function basePickBy(object, paths, predicate) {
2021
value = baseGet(object, path);
2122

2223
if (predicate(value, path)) {
23-
baseSet(result, path, value);
24+
baseSet(result, castPath(path, object), value);
2425
}
2526
}
2627
return result;

_basePullAt.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
var castPath = require('./_castPath'),
2-
isIndex = require('./_isIndex'),
3-
last = require('./last'),
4-
parent = require('./_parent'),
5-
toKey = require('./_toKey');
1+
var baseUnset = require('./_baseUnset'),
2+
isIndex = require('./_isIndex');
63

74
/** Used for built-in method references. */
85
var arrayProto = Array.prototype;
@@ -29,14 +26,8 @@ function basePullAt(array, indexes) {
2926
var previous = index;
3027
if (isIndex(index)) {
3128
splice.call(array, index, 1);
32-
}
33-
else {
34-
var path = castPath(index, array),
35-
object = parent(array, path);
36-
37-
if (object != null) {
38-
delete object[toKey(last(path))];
39-
}
29+
} else {
30+
baseUnset(array, index);
4031
}
4132
}
4233
}

_baseUnset.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ var castPath = require('./_castPath'),
33
parent = require('./_parent'),
44
toKey = require('./_toKey');
55

6-
/** Used for built-in method references. */
7-
var objectProto = Object.prototype;
8-
9-
/** Used to check objects for own properties. */
10-
var hasOwnProperty = objectProto.hasOwnProperty;
11-
126
/**
137
* The base implementation of `_.unset`.
148
*
@@ -20,8 +14,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
2014
function baseUnset(object, path) {
2115
path = castPath(path, object);
2216
object = parent(object, path);
23-
var key = toKey(last(path));
24-
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
17+
return object == null || delete object[toKey(last(path))];
2518
}
2619

2720
module.exports = baseUnset;

core.js

Lines changed: 1 addition & 1 deletion
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
/** Error message constants. */
1919
var FUNC_ERROR_TEXT = 'Expected a function';

core.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fp/_baseConvert.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
var mapping = require('./_mapping'),
22
fallbackHolder = require('./placeholder');
33

4+
/** Built-in value reference. */
5+
var push = Array.prototype.push;
6+
47
/**
58
* Creates a function, with an arity of `n`, that invokes `func` with the
69
* arguments it receives.
@@ -61,6 +64,36 @@ function createCloner(func) {
6164
};
6265
}
6366

67+
/**
68+
* This function is like `_.spread` except that it includes arguments after those spread.
69+
*
70+
* @private
71+
* @param {Function} func The function to spread arguments over.
72+
* @param {number} start The start position of the spread.
73+
* @returns {Function} Returns the new function.
74+
*/
75+
function spread(func, start) {
76+
return function() {
77+
var length = arguments.length,
78+
args = Array(length);
79+
80+
while (length--) {
81+
args[length] = arguments[length];
82+
}
83+
var array = args[start],
84+
lastIndex = args.length - 1,
85+
otherArgs = args.slice(0, start);
86+
87+
if (array) {
88+
push.apply(otherArgs, array);
89+
}
90+
if (start != lastIndex) {
91+
push.apply(otherArgs, args.slice(start + 1));
92+
}
93+
return func.apply(this, otherArgs);
94+
};
95+
}
96+
6497
/**
6598
* Creates a function that wraps `func` and uses `cloner` to clone the first
6699
* argument it receives.
@@ -141,7 +174,6 @@ function baseConvert(util, name, func, options) {
141174
'iteratee': util.iteratee,
142175
'keys': util.keys,
143176
'rearg': util.rearg,
144-
'spread': util.spread,
145177
'toInteger': util.toInteger,
146178
'toPath': util.toPath
147179
};
@@ -155,7 +187,6 @@ function baseConvert(util, name, func, options) {
155187
isFunction = helpers.isFunction,
156188
keys = helpers.keys,
157189
rearg = helpers.rearg,
158-
spread = helpers.spread,
159190
toInteger = helpers.toInteger,
160191
toPath = helpers.toPath;
161192

fp/_util.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = {
99
'iteratee': require('../iteratee'),
1010
'keys': require('../_baseKeys'),
1111
'rearg': require('../rearg'),
12-
'spread': require('../spread'),
1312
'toInteger': require('../toInteger'),
1413
'toPath': require('../toPath')
1514
};

lodash.js

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

1414
/** Used as the semantic version number. */
15-
var VERSION = '4.17.1';
15+
var VERSION = '4.17.2';
1616

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

38073807
if (predicate(value, path)) {
3808-
baseSet(result, path, value);
3808+
baseSet(result, castPath(path, object), value);
38093809
}
38103810
}
38113811
return result;
@@ -3881,14 +3881,8 @@
38813881
var previous = index;
38823882
if (isIndex(index)) {
38833883
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);
38923886
}
38933887
}
38943888
}
@@ -4352,8 +4346,7 @@
43524346
function baseUnset(object, path) {
43534347
path = castPath(path, object);
43544348
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))];
43574350
}
43584351

43594352
/**
@@ -10847,15 +10840,11 @@
1084710840
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
1084810841
return baseRest(function(args) {
1084910842
var array = args[start],
10850-
lastIndex = args.length - 1,
1085110843
otherArgs = castSlice(args, 0, start);
1085210844

1085310845
if (array) {
1085410846
arrayPush(otherArgs, array);
1085510847
}
10856-
if (start != lastIndex) {
10857-
arrayPush(otherArgs, castSlice(args, start + 1));
10858-
}
1085910848
return apply(func, this, otherArgs);
1086010849
});
1086110850
}
@@ -13470,16 +13459,16 @@
1347013459
if (object == null) {
1347113460
return result;
1347213461
}
13473-
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
13462+
var isDeep = false;
1347413463
paths = arrayMap(paths, function(path) {
1347513464
path = castPath(path, object);
13476-
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
13465+
isDeep || (isDeep = path.length > 1);
1347713466
return path;
1347813467
});
13479-
1348013468
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+
}
1348313472
var length = paths.length;
1348413473
while (length--) {
1348513474
baseUnset(result, paths[length]);
@@ -13600,8 +13589,8 @@
1360013589

1360113590
// Ensure the loop is entered when path is empty.
1360213591
if (!length) {
13603-
object = undefined;
1360413592
length = 1;
13593+
object = undefined;
1360513594
}
1360613595
while (++index < length) {
1360713596
var value = object == null ? undefined : object[toKey(path[index])];

0 commit comments

Comments
 (0)