lodash-rails 4.15.0 → 4.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.core.js +95 -62
- data/vendor/assets/javascripts/lodash.core.min.js +23 -23
- data/vendor/assets/javascripts/lodash.js +432 -270
- data/vendor/assets/javascripts/lodash.min.js +124 -124
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fbb6e7d8fbc58878e2efeb6be1977d971dc38f7
|
4
|
+
data.tar.gz: 341419b93c8391a6c6f67cbde81c311c036457a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53539968cf3fb6087024fc7b34d9a0774428ce11d4e329e8d43377d74936cb825d1d3762f4e1f0dd8d167ff19c9e0c09f15f44d79d03d6ba7b19572c923807e8
|
7
|
+
data.tar.gz: 56dfaeae8234e9e064815bc627762b704bdaa495432150dd88408364b7e24c0b5a3ed2b0ac00d82e6ced5c570aa2905d86ccb0834523b0b24403f21a3276c48e
|
data/README.md
CHANGED
data/lib/lodash/rails/version.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
var undefined;
|
14
14
|
|
15
15
|
/** Used as the semantic version number. */
|
16
|
-
var VERSION = '4.
|
16
|
+
var VERSION = '4.16.1';
|
17
17
|
|
18
18
|
/** Used as the `TypeError` message for "Functions" methods. */
|
19
19
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
@@ -44,7 +44,7 @@
|
|
44
44
|
stringTag = '[object String]';
|
45
45
|
|
46
46
|
/** Used to match HTML entities and HTML characters. */
|
47
|
-
var reUnescapedHtml = /[&<>"'
|
47
|
+
var reUnescapedHtml = /[&<>"']/g,
|
48
48
|
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
49
49
|
|
50
50
|
/** Used to map characters to HTML entities. */
|
@@ -53,8 +53,7 @@
|
|
53
53
|
'<': '<',
|
54
54
|
'>': '>',
|
55
55
|
'"': '"',
|
56
|
-
"'": '''
|
57
|
-
'`': '`'
|
56
|
+
"'": '''
|
58
57
|
};
|
59
58
|
|
60
59
|
/** Detect free variable `global` from Node.js. */
|
@@ -183,17 +182,6 @@
|
|
183
182
|
*/
|
184
183
|
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
185
184
|
|
186
|
-
/**
|
187
|
-
* Checks if `value` is a host object in IE < 9.
|
188
|
-
*
|
189
|
-
* @private
|
190
|
-
* @param {*} value The value to check.
|
191
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
192
|
-
*/
|
193
|
-
function isHostObject() {
|
194
|
-
return false;
|
195
|
-
}
|
196
|
-
|
197
185
|
/**
|
198
186
|
* Creates a unary function that invokes `func` with its argument transformed.
|
199
187
|
*
|
@@ -414,10 +402,23 @@
|
|
414
402
|
var objValue = object[key];
|
415
403
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
416
404
|
(value === undefined && !(key in object))) {
|
417
|
-
object
|
405
|
+
baseAssignValue(object, key, value);
|
418
406
|
}
|
419
407
|
}
|
420
408
|
|
409
|
+
/**
|
410
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
411
|
+
* value checks.
|
412
|
+
*
|
413
|
+
* @private
|
414
|
+
* @param {Object} object The object to modify.
|
415
|
+
* @param {string} key The key of the property to assign.
|
416
|
+
* @param {*} value The value to assign.
|
417
|
+
*/
|
418
|
+
function baseAssignValue(object, key, value) {
|
419
|
+
object[key] = value;
|
420
|
+
}
|
421
|
+
|
421
422
|
/**
|
422
423
|
* The base implementation of `_.create` without support for assigning
|
423
424
|
* properties to the created object.
|
@@ -674,8 +675,8 @@
|
|
674
675
|
othTag = objectToString.call(other);
|
675
676
|
othTag = othTag == argsTag ? objectTag : othTag;
|
676
677
|
}
|
677
|
-
var objIsObj = objTag == objectTag
|
678
|
-
othIsObj = othTag == objectTag
|
678
|
+
var objIsObj = objTag == objectTag,
|
679
|
+
othIsObj = othTag == objectTag,
|
679
680
|
isSameTag = objTag == othTag;
|
680
681
|
|
681
682
|
stack || (stack = []);
|
@@ -832,24 +833,7 @@
|
|
832
833
|
* @returns {Function} Returns the new function.
|
833
834
|
*/
|
834
835
|
function baseRest(func, start) {
|
835
|
-
|
836
|
-
return function() {
|
837
|
-
var args = arguments,
|
838
|
-
index = -1,
|
839
|
-
length = nativeMax(args.length - start, 0),
|
840
|
-
array = Array(length);
|
841
|
-
|
842
|
-
while (++index < length) {
|
843
|
-
array[index] = args[start + index];
|
844
|
-
}
|
845
|
-
index = -1;
|
846
|
-
var otherArgs = Array(start + 1);
|
847
|
-
while (++index < start) {
|
848
|
-
otherArgs[index] = args[index];
|
849
|
-
}
|
850
|
-
otherArgs[start] = array;
|
851
|
-
return func.apply(this, otherArgs);
|
852
|
-
};
|
836
|
+
return setToString(overRest(func, start, identity), func + '');
|
853
837
|
}
|
854
838
|
|
855
839
|
/**
|
@@ -979,6 +963,7 @@
|
|
979
963
|
* @returns {Object} Returns `object`.
|
980
964
|
*/
|
981
965
|
function copyObject(source, props, object, customizer) {
|
966
|
+
var isNew = !object;
|
982
967
|
object || (object = {});
|
983
968
|
|
984
969
|
var index = -1,
|
@@ -991,7 +976,14 @@
|
|
991
976
|
? customizer(object[key], source[key], key, object, source)
|
992
977
|
: undefined;
|
993
978
|
|
994
|
-
|
979
|
+
if (newValue === undefined) {
|
980
|
+
newValue = source[key];
|
981
|
+
}
|
982
|
+
if (isNew) {
|
983
|
+
baseAssignValue(object, key, newValue);
|
984
|
+
} else {
|
985
|
+
assignValue(object, key, newValue);
|
986
|
+
}
|
995
987
|
}
|
996
988
|
return object;
|
997
989
|
}
|
@@ -1326,6 +1318,17 @@
|
|
1326
1318
|
return result;
|
1327
1319
|
}
|
1328
1320
|
|
1321
|
+
/**
|
1322
|
+
* A specialized version of `baseRest` which flattens the rest array.
|
1323
|
+
*
|
1324
|
+
* @private
|
1325
|
+
* @param {Function} func The function to apply a rest parameter to.
|
1326
|
+
* @returns {Function} Returns the new function.
|
1327
|
+
*/
|
1328
|
+
function flatRest(func) {
|
1329
|
+
return setToString(overRest(func, undefined, flatten), func + '');
|
1330
|
+
}
|
1331
|
+
|
1329
1332
|
/**
|
1330
1333
|
* Checks if `value` is a flattenable `arguments` object or array.
|
1331
1334
|
*
|
@@ -1356,6 +1359,46 @@
|
|
1356
1359
|
return result;
|
1357
1360
|
}
|
1358
1361
|
|
1362
|
+
/**
|
1363
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
1364
|
+
*
|
1365
|
+
* @private
|
1366
|
+
* @param {Function} func The function to apply a rest parameter to.
|
1367
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
1368
|
+
* @param {Function} transform The rest array transform.
|
1369
|
+
* @returns {Function} Returns the new function.
|
1370
|
+
*/
|
1371
|
+
function overRest(func, start, transform) {
|
1372
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
1373
|
+
return function() {
|
1374
|
+
var args = arguments,
|
1375
|
+
index = -1,
|
1376
|
+
length = nativeMax(args.length - start, 0),
|
1377
|
+
array = Array(length);
|
1378
|
+
|
1379
|
+
while (++index < length) {
|
1380
|
+
array[index] = args[start + index];
|
1381
|
+
}
|
1382
|
+
index = -1;
|
1383
|
+
var otherArgs = Array(start + 1);
|
1384
|
+
while (++index < start) {
|
1385
|
+
otherArgs[index] = args[index];
|
1386
|
+
}
|
1387
|
+
otherArgs[start] = transform(array);
|
1388
|
+
return func.apply(this, otherArgs);
|
1389
|
+
};
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
/**
|
1393
|
+
* Sets the `toString` method of `func` to return `string`.
|
1394
|
+
*
|
1395
|
+
* @private
|
1396
|
+
* @param {Function} func The function to modify.
|
1397
|
+
* @param {Function} string The `toString` result.
|
1398
|
+
* @returns {Function} Returns `func`.
|
1399
|
+
*/
|
1400
|
+
var setToString = identity;
|
1401
|
+
|
1359
1402
|
/**
|
1360
1403
|
* Converts `value` to a string key if it's not a string or symbol.
|
1361
1404
|
*
|
@@ -1409,17 +1452,18 @@
|
|
1409
1452
|
* // => [1]
|
1410
1453
|
*/
|
1411
1454
|
function concat() {
|
1412
|
-
var length = arguments.length
|
1413
|
-
|
1455
|
+
var length = arguments.length;
|
1456
|
+
if (!length) {
|
1457
|
+
return [];
|
1458
|
+
}
|
1459
|
+
var args = Array(length - 1),
|
1414
1460
|
array = arguments[0],
|
1415
1461
|
index = length;
|
1416
1462
|
|
1417
1463
|
while (index--) {
|
1418
1464
|
args[index - 1] = arguments[index];
|
1419
1465
|
}
|
1420
|
-
return
|
1421
|
-
? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1))
|
1422
|
-
: [];
|
1466
|
+
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
|
1423
1467
|
}
|
1424
1468
|
|
1425
1469
|
/**
|
@@ -1905,7 +1949,7 @@
|
|
1905
1949
|
* @see _.forEachRight
|
1906
1950
|
* @example
|
1907
1951
|
*
|
1908
|
-
* _([1, 2]
|
1952
|
+
* _.forEach([1, 2], function(value) {
|
1909
1953
|
* console.log(value);
|
1910
1954
|
* });
|
1911
1955
|
* // => Logs `1` then `2`.
|
@@ -2099,16 +2143,11 @@
|
|
2099
2143
|
* { 'user': 'barney', 'age': 34 }
|
2100
2144
|
* ];
|
2101
2145
|
*
|
2102
|
-
* _.sortBy(users, function(o) { return o.user; });
|
2146
|
+
* _.sortBy(users, [function(o) { return o.user; }]);
|
2103
2147
|
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
|
2104
2148
|
*
|
2105
2149
|
* _.sortBy(users, ['user', 'age']);
|
2106
2150
|
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
|
2107
|
-
*
|
2108
|
-
* _.sortBy(users, 'user', function(o) {
|
2109
|
-
* return Math.floor(o.age / 10);
|
2110
|
-
* });
|
2111
|
-
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
|
2112
2151
|
*/
|
2113
2152
|
function sortBy(collection, iteratee) {
|
2114
2153
|
var index = 0;
|
@@ -2212,7 +2251,7 @@
|
|
2212
2251
|
* _.defer(function(text) {
|
2213
2252
|
* console.log(text);
|
2214
2253
|
* }, 'deferred');
|
2215
|
-
* // => Logs 'deferred' after one
|
2254
|
+
* // => Logs 'deferred' after one millisecond.
|
2216
2255
|
*/
|
2217
2256
|
var defer = baseRest(function(func, args) {
|
2218
2257
|
return baseDelay(func, 1, args);
|
@@ -2698,7 +2737,7 @@
|
|
2698
2737
|
*/
|
2699
2738
|
function isObject(value) {
|
2700
2739
|
var type = typeof value;
|
2701
|
-
return
|
2740
|
+
return value != null && (type == 'object' || type == 'function');
|
2702
2741
|
}
|
2703
2742
|
|
2704
2743
|
/**
|
@@ -2726,7 +2765,7 @@
|
|
2726
2765
|
* // => false
|
2727
2766
|
*/
|
2728
2767
|
function isObjectLike(value) {
|
2729
|
-
return
|
2768
|
+
return value != null && typeof value == 'object';
|
2730
2769
|
}
|
2731
2770
|
|
2732
2771
|
/**
|
@@ -3263,8 +3302,8 @@
|
|
3263
3302
|
* _.pick(object, ['a', 'c']);
|
3264
3303
|
* // => { 'a': 1, 'c': 3 }
|
3265
3304
|
*/
|
3266
|
-
var pick =
|
3267
|
-
return object == null ? {} : basePick(object, baseMap(
|
3305
|
+
var pick = flatRest(function(object, props) {
|
3306
|
+
return object == null ? {} : basePick(object, baseMap(props, toKey));
|
3268
3307
|
});
|
3269
3308
|
|
3270
3309
|
/**
|
@@ -3337,8 +3376,8 @@
|
|
3337
3376
|
/*------------------------------------------------------------------------*/
|
3338
3377
|
|
3339
3378
|
/**
|
3340
|
-
* Converts the characters "&", "<", ">", '"',
|
3341
|
-
*
|
3379
|
+
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
3380
|
+
* corresponding HTML entities.
|
3342
3381
|
*
|
3343
3382
|
* **Note:** No other characters are escaped. To escape additional
|
3344
3383
|
* characters use a third-party library like [_he_](https://mths.be/he).
|
@@ -3349,12 +3388,6 @@
|
|
3349
3388
|
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
3350
3389
|
* (under "semi-related fun fact") for more details.
|
3351
3390
|
*
|
3352
|
-
* Backticks are escaped because in IE < 9, they can break out of
|
3353
|
-
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
|
3354
|
-
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
|
3355
|
-
* [#133](https://html5sec.org/#133) of the
|
3356
|
-
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
|
3357
|
-
*
|
3358
3391
|
* When working with HTML you should always
|
3359
3392
|
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
|
3360
3393
|
* XSS vectors.
|
@@ -3,26 +3,26 @@
|
|
3
3
|
* lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
4
4
|
* Build: `lodash core -o ./dist/lodash.core.js`
|
5
5
|
*/
|
6
|
-
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n){return function(t){return null==t?
|
7
|
-
return setTimeout(function(){n.apply(
|
8
|
-
}function v(n,t){return p(t,function(t){return
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
return n&&n.length?n[0]:
|
16
|
-
return
|
17
|
-
function L(n){return typeof n=="string"||!
|
18
|
-
func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var
|
19
|
-
"<":"<",">":">",'"':""","'":"'"
|
20
|
-
return r}}(h),
|
21
|
-
return F(n,t,r)}),
|
22
|
-
|
23
|
-
return function(){return!n.apply(this,arguments)}},u.once=function(n){return
|
24
|
-
break n}}r=0}return r||n.index-t.index}),t("value"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return
|
25
|
-
u.isArray=
|
26
|
-
},u.isString=
|
27
|
-
var t=++
|
28
|
-
}return this[r](function(r){return t.apply(
|
6
|
+
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n){return function(t){return null==t?tn:t[n]}}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return d(t,function(t){return n[t]})}function u(n){return n instanceof o?n:new o(n)}function o(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function i(n,t,r,e){return n===tn||P(n,pn[r])&&!sn.call(e,r)?t:n}function c(n){return K(n)?yn(n):{}}function f(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");
|
7
|
+
return setTimeout(function(){n.apply(tn,r)},t)}function a(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function l(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===tn?i===i:r(i,c)))var c=i,f=o}return f}function p(n,t){var r=[];return mn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function s(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=D),o||(o=[]);++i<c;){var f=t[i];0<r&&e(f)?1<r?s(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function h(n,t){return n&&On(n,t,qn);
|
8
|
+
}function v(n,t){return p(t,function(t){return H(n[t])})}function b(n,t){return n>t}function y(n,t,r,e,u){return n===t||(null==n||null==t||!K(n)&&!L(t)?n!==n&&t!==t:g(n,t,y,r,e,u))}function g(n,t,r,e,u,o){var i=Sn(n),c=Sn(t),f="[object Array]",a="[object Array]";i||(f=vn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=vn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=En(o,function(t){return t[0]==n}),s=En(o,function(n){
|
9
|
+
return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=P(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&sn.call(n,"__wrapped__"),f=c&&sn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=R(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,
|
10
|
+
r=r(i,f,e,u,o),o.pop(),r)}function _(n){return typeof n=="function"?n:null==n?Z:(typeof n=="object"?m:t)(n)}function j(n,t){return n<t}function d(n,t){var r=-1,e=V(n)?Array(n.length):[];return mn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function m(n){var t=jn(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&y(n[u],r[u],tn,3)))return false}return true}}function O(n,t){return n=Object(n),J(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function x(n){return xn(q(n,void 0,Z),n+"");
|
11
|
+
}function A(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function E(n){return A(n,0,n.length)}function w(n,t){var r;return mn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function k(t,r){return J(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function N(n,t,r,e){var u=!r;r||(r={});for(var o=-1,i=t.length;++o<i;){var c=t[o],f=e?e(r[c],n[c],c,r,n):tn;if(f===tn&&(f=n[c]),u)r[c]=f;else{var a=r,l=a[c];
|
12
|
+
sn.call(a,c)&&P(l,f)&&(f!==tn||c in a)||(a[c]=f)}}return r}function S(n){return x(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:tn,o=3<n.length&&typeof o=="function"?(u--,o):tn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function T(n){return function(){var t=arguments,r=c(n.prototype),t=n.apply(r,t);return K(t)?t:r}}function F(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==cn&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];
|
13
|
+
return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=T(n);return e}function B(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:tn;++c<i;){var l=n[c],p=t[c];if(void 0!==tn){f=false;break}if(a){if(!w(t,function(n,t){if(!C(a,t)&&(l===n||r(l,n,e,u,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function R(n,t,r,e,u,o){var i=2&u,c=qn(n),f=c.length,a=qn(t).length;if(f!=a&&!i)return false;
|
14
|
+
for(var l=f;l--;){var p=c[l];if(!(i?p in t:sn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==tn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),a}function D(n){return Sn(n)||U(n)}function I(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);return t}function q(n,t,r){return t=dn(t===tn?n.length-1:t,0),
|
15
|
+
function(){for(var e=arguments,u=-1,o=dn(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];for(u=-1,o=Array(t+1);++u<t;)o[u]=e[u];return o[t]=r(i),n.apply(this,o)}}function $(n){return n&&n.length?s(n,1):[]}function z(n){return n&&n.length?n[0]:tn}function C(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?dn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function G(n,t){return mn(n,_(t))}function J(n,t,e){return r(n,_(t),e,3>arguments.length,mn)}function M(n,t){
|
16
|
+
var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Tn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=tn),r}}function P(n,t){return n===t||n!==n&&t!==t}function U(n){return L(n)&&V(n)&&sn.call(n,"callee")&&(!gn.call(n,"callee")||"[object Arguments]"==vn.call(n))}function V(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!H(n)}function H(n){return n=K(n)?vn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n;
|
17
|
+
}function K(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function L(n){return null!=n&&typeof n=="object"}function Q(n){return typeof n=="number"||L(n)&&"[object Number]"==vn.call(n)}function W(n){return typeof n=="string"||!Sn(n)&&L(n)&&"[object String]"==vn.call(n)}function X(n){return typeof n=="string"?n:null==n?"":n+""}function Y(n){return n?e(n,qn(n)):[]}function Z(n){return n}function nn(t,r,e){var u=qn(r),o=v(r,u);null!=e||K(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=v(r,qn(r)));
|
18
|
+
var i=!(K(e)&&"chain"in e&&!e.chain),c=H(t);return mn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=E(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var tn,rn=1/0,en=/[&<>"']/g,un=RegExp(en.source),on=typeof self=="object"&&self&&self.Object===Object&&self,cn=typeof global=="object"&&global&&global.Object===Object&&global||on||Function("return this")(),fn=(on=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,an=function(n){
|
19
|
+
return function(t){return null==n?tn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),ln=Array.prototype,pn=Object.prototype,sn=pn.hasOwnProperty,hn=0,vn=pn.toString,bn=cn._,yn=Object.create,gn=pn.propertyIsEnumerable,_n=cn.isFinite,jn=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),dn=Math.max;o.prototype=c(u.prototype),o.prototype.constructor=o;var mn=function(n,t){return function(r,e){if(null==r)return r;if(!V(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););
|
20
|
+
return r}}(h),On=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),xn=Z,An=String,En=function(n){return function(t,r,e){var u=Object(t);if(!V(t)){var o=_(r);t=qn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:tn}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Tn(r),0>r&&(r=dn(e+r,0));n:{for(t=_(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),wn=x(function(n,t,r){
|
21
|
+
return F(n,t,r)}),kn=x(function(n,t){return f(n,1,t)}),Nn=x(function(n,t,r){return f(n,Fn(t)||0,r)}),Sn=Array.isArray,Tn=Number,Fn=Number,Bn=S(function(n,t){N(t,jn(t),n)}),Rn=S(function(n,t){N(t,I(t),n)}),Dn=S(function(n,t,r,e){N(t,$n(t),n,e)}),In=x(function(n){return n.push(tn,i),Dn.apply(tn,n)}),qn=jn,$n=I,zn=function(n){return xn(q(n,tn,$),n+"")}(function(n,t){return null==n?{}:O(n,d(t,An))});u.assignIn=Rn,u.before=M,u.bind=wn,u.chain=function(n){return n=u(n),n.__chain__=true,n},u.compact=function(n){
|
22
|
+
return p(n,Boolean)},u.concat=function(){var t=arguments.length;if(!t)return[];for(var r=Array(t-1),e=arguments[0];t--;)r[t-1]=arguments[t];return n(Sn(e)?E(e):[e],s(r,1))},u.create=function(n,t){var r=c(n);return t?Bn(r,t):r},u.defaults=In,u.defer=kn,u.delay=Nn,u.filter=function(n,t){return p(n,_(t))},u.flatten=$,u.flattenDeep=function(n){return n&&n.length?s(n,rn):[]},u.iteratee=_,u.keys=qn,u.map=function(n,t){return d(n,_(t))},u.matches=function(n){return m(Bn({},n))},u.mixin=nn,u.negate=function(n){
|
23
|
+
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},u.once=function(n){return M(2,n)},u.pick=zn,u.slice=function(n,t,r){var e=n?n.length:0;return r=r===tn?e:+r,e?A(n,null==t?0:+t,r):[]},u.sortBy=function(n,r){var e=0;return r=_(r),d(d(n,function(n,t,u){return{value:n,index:e++,criteria:r(n,t,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==tn,o=null===r,i=r===r,c=e!==tn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){
|
24
|
+
r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),t("value"))},u.tap=function(n,t){return t(n),n},u.thru=function(n,t){return t(n)},u.toArray=function(n){return V(n)?n.length?E(n):[]:Y(n)},u.values=Y,u.extend=Rn,nn(u,u),u.clone=function(n){return K(n)?Sn(n)?E(n):N(n,jn(n)):n},u.escape=function(n){return(n=X(n))&&un.test(n)?n.replace(en,an):n},u.every=function(n,t,r){return t=r?tn:t,a(n,_(t))},u.find=En,u.forEach=G,u.has=function(n,t){return null!=n&&sn.call(n,t);
|
25
|
+
},u.head=z,u.identity=Z,u.indexOf=C,u.isArguments=U,u.isArray=Sn,u.isBoolean=function(n){return true===n||false===n||L(n)&&"[object Boolean]"==vn.call(n)},u.isDate=function(n){return L(n)&&"[object Date]"==vn.call(n)},u.isEmpty=function(n){return V(n)&&(Sn(n)||W(n)||H(n.splice)||U(n))?!n.length:!jn(n).length},u.isEqual=function(n,t){return y(n,t)},u.isFinite=function(n){return typeof n=="number"&&_n(n)},u.isFunction=H,u.isNaN=function(n){return Q(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=Q,
|
26
|
+
u.isObject=K,u.isRegExp=function(n){return K(n)&&"[object RegExp]"==vn.call(n)},u.isString=W,u.isUndefined=function(n){return n===tn},u.last=function(n){var t=n?n.length:0;return t?n[t-1]:tn},u.max=function(n){return n&&n.length?l(n,Z,b):tn},u.min=function(n){return n&&n.length?l(n,Z,j):tn},u.noConflict=function(){return cn._===this&&(cn._=bn),this},u.noop=function(){},u.reduce=J,u.result=function(n,t,r){return t=null==n?tn:n[t],t===tn&&(t=r),H(t)?t.call(n):t},u.size=function(n){return null==n?0:(n=V(n)?n:jn(n),
|
27
|
+
n.length)},u.some=function(n,t,r){return t=r?tn:t,w(n,_(t))},u.uniqueId=function(n){var t=++hn;return X(n)+t},u.each=G,u.first=z,nn(u,function(){var n={};return h(u,function(t,r){sn.call(u.prototype,r)||(n[r]=t)}),n}(),{chain:false}),u.VERSION="4.16.1",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:ln)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);u.prototype[n]=function(){
|
28
|
+
var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Sn(u)?u:[],n)}return this[r](function(r){return t.apply(Sn(r)?r:[],n)})}}),u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){return k(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(cn._=u, define(function(){return u})):fn?((fn.exports=u)._=u,on._=u):cn._=u}).call(this);
|
@@ -12,7 +12,7 @@
|
|
12
12
|
var undefined;
|
13
13
|
|
14
14
|
/** Used as the semantic version number. */
|
15
|
-
var VERSION = '4.
|
15
|
+
var VERSION = '4.16.1';
|
16
16
|
|
17
17
|
/** Used as the size to enable large array optimizations. */
|
18
18
|
var LARGE_ARRAY_SIZE = 200;
|
@@ -23,6 +23,9 @@
|
|
23
23
|
/** Used to stand-in for `undefined` hash values. */
|
24
24
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
25
25
|
|
26
|
+
/** Used as the maximum memoize cache size. */
|
27
|
+
var MAX_MEMOIZE_SIZE = 500;
|
28
|
+
|
26
29
|
/** Used as the internal argument placeholder. */
|
27
30
|
var PLACEHOLDER = '__lodash_placeholder__';
|
28
31
|
|
@@ -47,7 +50,7 @@
|
|
47
50
|
DEFAULT_TRUNC_OMISSION = '...';
|
48
51
|
|
49
52
|
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
50
|
-
var HOT_COUNT =
|
53
|
+
var HOT_COUNT = 500,
|
51
54
|
HOT_SPAN = 16;
|
52
55
|
|
53
56
|
/** Used to indicate the type of lazy iteratees. */
|
@@ -116,8 +119,8 @@
|
|
116
119
|
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
117
120
|
|
118
121
|
/** Used to match HTML entities and HTML characters. */
|
119
|
-
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39
|
120
|
-
reUnescapedHtml = /[&<>"'
|
122
|
+
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
|
123
|
+
reUnescapedHtml = /[&<>"']/g,
|
121
124
|
reHasEscapedHtml = RegExp(reEscapedHtml.source),
|
122
125
|
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
123
126
|
|
@@ -164,9 +167,6 @@
|
|
164
167
|
/** Used to match `RegExp` flags from their coerced string values. */
|
165
168
|
var reFlags = /\w*$/;
|
166
169
|
|
167
|
-
/** Used to detect hexadecimal string values. */
|
168
|
-
var reHasHexPrefix = /^0x/i;
|
169
|
-
|
170
170
|
/** Used to detect bad signed hexadecimal string values. */
|
171
171
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
172
172
|
|
@@ -361,7 +361,7 @@
|
|
361
361
|
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
362
362
|
'\u0132': 'IJ', '\u0133': 'ij',
|
363
363
|
'\u0152': 'Oe', '\u0153': 'oe',
|
364
|
-
'\u0149': "'n", '\u017f': '
|
364
|
+
'\u0149': "'n", '\u017f': 's'
|
365
365
|
};
|
366
366
|
|
367
367
|
/** Used to map characters to HTML entities. */
|
@@ -370,8 +370,7 @@
|
|
370
370
|
'<': '<',
|
371
371
|
'>': '>',
|
372
372
|
'"': '"',
|
373
|
-
"'": '''
|
374
|
-
'`': '`'
|
373
|
+
"'": '''
|
375
374
|
};
|
376
375
|
|
377
376
|
/** Used to map HTML entities to characters. */
|
@@ -380,8 +379,7 @@
|
|
380
379
|
'<': '<',
|
381
380
|
'>': '>',
|
382
381
|
'"': '"',
|
383
|
-
''': "'"
|
384
|
-
'`': '`'
|
382
|
+
''': "'"
|
385
383
|
};
|
386
384
|
|
387
385
|
/** Used to escape characters for inclusion in compiled string literals. */
|
@@ -822,18 +820,9 @@
|
|
822
820
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
823
821
|
*/
|
824
822
|
function baseIndexOf(array, value, fromIndex) {
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
var index = fromIndex - 1,
|
829
|
-
length = array.length;
|
830
|
-
|
831
|
-
while (++index < length) {
|
832
|
-
if (array[index] === value) {
|
833
|
-
return index;
|
834
|
-
}
|
835
|
-
}
|
836
|
-
return -1;
|
823
|
+
return value === value
|
824
|
+
? strictIndexOf(array, value, fromIndex)
|
825
|
+
: baseFindIndex(array, baseIsNaN, fromIndex);
|
837
826
|
}
|
838
827
|
|
839
828
|
/**
|
@@ -1038,7 +1027,7 @@
|
|
1038
1027
|
}
|
1039
1028
|
|
1040
1029
|
/**
|
1041
|
-
* Checks if a cache value for `key` exists.
|
1030
|
+
* Checks if a `cache` value for `key` exists.
|
1042
1031
|
*
|
1043
1032
|
* @private
|
1044
1033
|
* @param {Object} cache The cache to query.
|
@@ -1096,7 +1085,7 @@
|
|
1096
1085
|
|
1097
1086
|
while (length--) {
|
1098
1087
|
if (array[length] === placeholder) {
|
1099
|
-
result
|
1088
|
+
++result;
|
1100
1089
|
}
|
1101
1090
|
}
|
1102
1091
|
return result;
|
@@ -1166,25 +1155,6 @@
|
|
1166
1155
|
return reHasUnicodeWord.test(string);
|
1167
1156
|
}
|
1168
1157
|
|
1169
|
-
/**
|
1170
|
-
* Checks if `value` is a host object in IE < 9.
|
1171
|
-
*
|
1172
|
-
* @private
|
1173
|
-
* @param {*} value The value to check.
|
1174
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
1175
|
-
*/
|
1176
|
-
function isHostObject(value) {
|
1177
|
-
// Many host objects are `Object` objects that can coerce to strings
|
1178
|
-
// despite having improperly defined `toString` methods.
|
1179
|
-
var result = false;
|
1180
|
-
if (value != null && typeof value.toString != 'function') {
|
1181
|
-
try {
|
1182
|
-
result = !!(value + '');
|
1183
|
-
} catch (e) {}
|
1184
|
-
}
|
1185
|
-
return result;
|
1186
|
-
}
|
1187
|
-
|
1188
1158
|
/**
|
1189
1159
|
* Converts `iterator` to an array.
|
1190
1160
|
*
|
@@ -1292,6 +1262,48 @@
|
|
1292
1262
|
return result;
|
1293
1263
|
}
|
1294
1264
|
|
1265
|
+
/**
|
1266
|
+
* A specialized version of `_.indexOf` which performs strict equality
|
1267
|
+
* comparisons of values, i.e. `===`.
|
1268
|
+
*
|
1269
|
+
* @private
|
1270
|
+
* @param {Array} array The array to inspect.
|
1271
|
+
* @param {*} value The value to search for.
|
1272
|
+
* @param {number} fromIndex The index to search from.
|
1273
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
1274
|
+
*/
|
1275
|
+
function strictIndexOf(array, value, fromIndex) {
|
1276
|
+
var index = fromIndex - 1,
|
1277
|
+
length = array.length;
|
1278
|
+
|
1279
|
+
while (++index < length) {
|
1280
|
+
if (array[index] === value) {
|
1281
|
+
return index;
|
1282
|
+
}
|
1283
|
+
}
|
1284
|
+
return -1;
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
/**
|
1288
|
+
* A specialized version of `_.lastIndexOf` which performs strict equality
|
1289
|
+
* comparisons of values, i.e. `===`.
|
1290
|
+
*
|
1291
|
+
* @private
|
1292
|
+
* @param {Array} array The array to inspect.
|
1293
|
+
* @param {*} value The value to search for.
|
1294
|
+
* @param {number} fromIndex The index to search from.
|
1295
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
1296
|
+
*/
|
1297
|
+
function strictLastIndexOf(array, value, fromIndex) {
|
1298
|
+
var index = fromIndex + 1;
|
1299
|
+
while (index--) {
|
1300
|
+
if (array[index] === value) {
|
1301
|
+
return index;
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
return index;
|
1305
|
+
}
|
1306
|
+
|
1295
1307
|
/**
|
1296
1308
|
* Gets the number of symbols in `string`.
|
1297
1309
|
*
|
@@ -1337,7 +1349,7 @@
|
|
1337
1349
|
function unicodeSize(string) {
|
1338
1350
|
var result = reUnicode.lastIndex = 0;
|
1339
1351
|
while (reUnicode.test(string)) {
|
1340
|
-
result
|
1352
|
+
++result;
|
1341
1353
|
}
|
1342
1354
|
return result;
|
1343
1355
|
}
|
@@ -1392,17 +1404,10 @@
|
|
1392
1404
|
* lodash.isFunction(lodash.bar);
|
1393
1405
|
* // => true
|
1394
1406
|
*
|
1395
|
-
* // Use `context` to stub `Date#getTime` use in `_.now`.
|
1396
|
-
* var stubbed = _.runInContext({
|
1397
|
-
* 'Date': function() {
|
1398
|
-
* return { 'getTime': stubGetTime };
|
1399
|
-
* }
|
1400
|
-
* });
|
1401
|
-
*
|
1402
1407
|
* // Create a suped-up `defer` in Node.js.
|
1403
1408
|
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
|
1404
1409
|
*/
|
1405
|
-
function runInContext(context) {
|
1410
|
+
var runInContext = (function runInContext(context) {
|
1406
1411
|
context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
|
1407
1412
|
|
1408
1413
|
/** Built-in constructor references. */
|
@@ -1462,6 +1467,7 @@
|
|
1462
1467
|
var Buffer = moduleExports ? context.Buffer : undefined,
|
1463
1468
|
Symbol = context.Symbol,
|
1464
1469
|
Uint8Array = context.Uint8Array,
|
1470
|
+
defineProperty = Object.defineProperty,
|
1465
1471
|
getPrototype = overArg(Object.getPrototypeOf, Object),
|
1466
1472
|
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
1467
1473
|
objectCreate = Object.create,
|
@@ -1484,6 +1490,7 @@
|
|
1484
1490
|
nativeKeys = overArg(Object.keys, Object),
|
1485
1491
|
nativeMax = Math.max,
|
1486
1492
|
nativeMin = Math.min,
|
1493
|
+
nativeNow = Date.now,
|
1487
1494
|
nativeParseInt = context.parseInt,
|
1488
1495
|
nativeRandom = Math.random,
|
1489
1496
|
nativeReverse = arrayProto.reverse;
|
@@ -1494,22 +1501,12 @@
|
|
1494
1501
|
Promise = getNative(context, 'Promise'),
|
1495
1502
|
Set = getNative(context, 'Set'),
|
1496
1503
|
WeakMap = getNative(context, 'WeakMap'),
|
1497
|
-
nativeCreate = getNative(Object, 'create')
|
1498
|
-
|
1499
|
-
/* Used to set `toString` methods. */
|
1500
|
-
var defineProperty = (function() {
|
1501
|
-
var func = getNative(Object, 'defineProperty'),
|
1502
|
-
name = getNative.name;
|
1503
|
-
|
1504
|
-
return (name && name.length > 2) ? func : undefined;
|
1505
|
-
}());
|
1504
|
+
nativeCreate = getNative(Object, 'create'),
|
1505
|
+
nativeDefineProperty = getNative(Object, 'defineProperty');
|
1506
1506
|
|
1507
1507
|
/** Used to store function metadata. */
|
1508
1508
|
var metaMap = WeakMap && new WeakMap;
|
1509
1509
|
|
1510
|
-
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
1511
|
-
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
1512
|
-
|
1513
1510
|
/** Used to lookup unminified function names. */
|
1514
1511
|
var realNames = {};
|
1515
1512
|
|
@@ -1897,6 +1894,7 @@
|
|
1897
1894
|
*/
|
1898
1895
|
function hashClear() {
|
1899
1896
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
1897
|
+
this.size = 0;
|
1900
1898
|
}
|
1901
1899
|
|
1902
1900
|
/**
|
@@ -1910,7 +1908,9 @@
|
|
1910
1908
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
1911
1909
|
*/
|
1912
1910
|
function hashDelete(key) {
|
1913
|
-
|
1911
|
+
var result = this.has(key) && delete this.__data__[key];
|
1912
|
+
this.size -= result ? 1 : 0;
|
1913
|
+
return result;
|
1914
1914
|
}
|
1915
1915
|
|
1916
1916
|
/**
|
@@ -1957,6 +1957,7 @@
|
|
1957
1957
|
*/
|
1958
1958
|
function hashSet(key, value) {
|
1959
1959
|
var data = this.__data__;
|
1960
|
+
this.size += this.has(key) ? 0 : 1;
|
1960
1961
|
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
1961
1962
|
return this;
|
1962
1963
|
}
|
@@ -1997,6 +1998,7 @@
|
|
1997
1998
|
*/
|
1998
1999
|
function listCacheClear() {
|
1999
2000
|
this.__data__ = [];
|
2001
|
+
this.size = 0;
|
2000
2002
|
}
|
2001
2003
|
|
2002
2004
|
/**
|
@@ -2021,6 +2023,7 @@
|
|
2021
2023
|
} else {
|
2022
2024
|
splice.call(data, index, 1);
|
2023
2025
|
}
|
2026
|
+
--this.size;
|
2024
2027
|
return true;
|
2025
2028
|
}
|
2026
2029
|
|
@@ -2068,6 +2071,7 @@
|
|
2068
2071
|
index = assocIndexOf(data, key);
|
2069
2072
|
|
2070
2073
|
if (index < 0) {
|
2074
|
+
++this.size;
|
2071
2075
|
data.push([key, value]);
|
2072
2076
|
} else {
|
2073
2077
|
data[index][1] = value;
|
@@ -2110,6 +2114,7 @@
|
|
2110
2114
|
* @memberOf MapCache
|
2111
2115
|
*/
|
2112
2116
|
function mapCacheClear() {
|
2117
|
+
this.size = 0;
|
2113
2118
|
this.__data__ = {
|
2114
2119
|
'hash': new Hash,
|
2115
2120
|
'map': new (Map || ListCache),
|
@@ -2127,7 +2132,9 @@
|
|
2127
2132
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
2128
2133
|
*/
|
2129
2134
|
function mapCacheDelete(key) {
|
2130
|
-
|
2135
|
+
var result = getMapData(this, key)['delete'](key);
|
2136
|
+
this.size -= result ? 1 : 0;
|
2137
|
+
return result;
|
2131
2138
|
}
|
2132
2139
|
|
2133
2140
|
/**
|
@@ -2167,7 +2174,11 @@
|
|
2167
2174
|
* @returns {Object} Returns the map cache instance.
|
2168
2175
|
*/
|
2169
2176
|
function mapCacheSet(key, value) {
|
2170
|
-
getMapData(this, key)
|
2177
|
+
var data = getMapData(this, key),
|
2178
|
+
size = data.size;
|
2179
|
+
|
2180
|
+
data.set(key, value);
|
2181
|
+
this.size += data.size == size ? 0 : 1;
|
2171
2182
|
return this;
|
2172
2183
|
}
|
2173
2184
|
|
@@ -2240,7 +2251,8 @@
|
|
2240
2251
|
* @param {Array} [entries] The key-value pairs to cache.
|
2241
2252
|
*/
|
2242
2253
|
function Stack(entries) {
|
2243
|
-
this.__data__ = new ListCache(entries);
|
2254
|
+
var data = this.__data__ = new ListCache(entries);
|
2255
|
+
this.size = data.size;
|
2244
2256
|
}
|
2245
2257
|
|
2246
2258
|
/**
|
@@ -2252,6 +2264,7 @@
|
|
2252
2264
|
*/
|
2253
2265
|
function stackClear() {
|
2254
2266
|
this.__data__ = new ListCache;
|
2267
|
+
this.size = 0;
|
2255
2268
|
}
|
2256
2269
|
|
2257
2270
|
/**
|
@@ -2264,7 +2277,11 @@
|
|
2264
2277
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
2265
2278
|
*/
|
2266
2279
|
function stackDelete(key) {
|
2267
|
-
|
2280
|
+
var data = this.__data__,
|
2281
|
+
result = data['delete'](key);
|
2282
|
+
|
2283
|
+
this.size = data.size;
|
2284
|
+
return result;
|
2268
2285
|
}
|
2269
2286
|
|
2270
2287
|
/**
|
@@ -2304,16 +2321,18 @@
|
|
2304
2321
|
* @returns {Object} Returns the stack cache instance.
|
2305
2322
|
*/
|
2306
2323
|
function stackSet(key, value) {
|
2307
|
-
var
|
2308
|
-
if (
|
2309
|
-
var pairs =
|
2324
|
+
var data = this.__data__;
|
2325
|
+
if (data instanceof ListCache) {
|
2326
|
+
var pairs = data.__data__;
|
2310
2327
|
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
2311
2328
|
pairs.push([key, value]);
|
2329
|
+
this.size = ++data.size;
|
2312
2330
|
return this;
|
2313
2331
|
}
|
2314
|
-
|
2332
|
+
data = this.__data__ = new MapCache(pairs);
|
2315
2333
|
}
|
2316
|
-
|
2334
|
+
data.set(key, value);
|
2335
|
+
this.size = data.size;
|
2317
2336
|
return this;
|
2318
2337
|
}
|
2319
2338
|
|
@@ -2353,6 +2372,44 @@
|
|
2353
2372
|
return result;
|
2354
2373
|
}
|
2355
2374
|
|
2375
|
+
/**
|
2376
|
+
* A specialized version of `_.sample` for arrays without support for iteratee
|
2377
|
+
* shorthands.
|
2378
|
+
*
|
2379
|
+
* @private
|
2380
|
+
* @param {Array} array The array to sample.
|
2381
|
+
* @returns {*} Returns the random element.
|
2382
|
+
*/
|
2383
|
+
function arraySample(array) {
|
2384
|
+
var length = array.length;
|
2385
|
+
return length ? array[baseRandom(0, length - 1)] : undefined;
|
2386
|
+
}
|
2387
|
+
|
2388
|
+
/**
|
2389
|
+
* A specialized version of `_.sampleSize` for arrays.
|
2390
|
+
*
|
2391
|
+
* @private
|
2392
|
+
* @param {Array} array The array to sample.
|
2393
|
+
* @param {number} n The number of elements to sample.
|
2394
|
+
* @returns {Array} Returns the random elements.
|
2395
|
+
*/
|
2396
|
+
function arraySampleSize(array, n) {
|
2397
|
+
var result = arrayShuffle(array);
|
2398
|
+
result.length = baseClamp(n, 0, result.length);
|
2399
|
+
return result;
|
2400
|
+
}
|
2401
|
+
|
2402
|
+
/**
|
2403
|
+
* A specialized version of `_.shuffle` for arrays.
|
2404
|
+
*
|
2405
|
+
* @private
|
2406
|
+
* @param {Array} array The array to shuffle.
|
2407
|
+
* @returns {Array} Returns the new shuffled array.
|
2408
|
+
*/
|
2409
|
+
function arrayShuffle(array) {
|
2410
|
+
return shuffleSelf(copyArray(array));
|
2411
|
+
}
|
2412
|
+
|
2356
2413
|
/**
|
2357
2414
|
* Used by `_.defaults` to customize its `_.assignIn` use.
|
2358
2415
|
*
|
@@ -2383,7 +2440,7 @@
|
|
2383
2440
|
function assignMergeValue(object, key, value) {
|
2384
2441
|
if ((value !== undefined && !eq(object[key], value)) ||
|
2385
2442
|
(typeof key == 'number' && value === undefined && !(key in object))) {
|
2386
|
-
object
|
2443
|
+
baseAssignValue(object, key, value);
|
2387
2444
|
}
|
2388
2445
|
}
|
2389
2446
|
|
@@ -2401,7 +2458,7 @@
|
|
2401
2458
|
var objValue = object[key];
|
2402
2459
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
2403
2460
|
(value === undefined && !(key in object))) {
|
2404
|
-
object
|
2461
|
+
baseAssignValue(object, key, value);
|
2405
2462
|
}
|
2406
2463
|
}
|
2407
2464
|
|
@@ -2454,6 +2511,28 @@
|
|
2454
2511
|
return object && copyObject(source, keys(source), object);
|
2455
2512
|
}
|
2456
2513
|
|
2514
|
+
/**
|
2515
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
2516
|
+
* value checks.
|
2517
|
+
*
|
2518
|
+
* @private
|
2519
|
+
* @param {Object} object The object to modify.
|
2520
|
+
* @param {string} key The key of the property to assign.
|
2521
|
+
* @param {*} value The value to assign.
|
2522
|
+
*/
|
2523
|
+
function baseAssignValue(object, key, value) {
|
2524
|
+
if (key == '__proto__' && defineProperty) {
|
2525
|
+
defineProperty(object, key, {
|
2526
|
+
'configurable': true,
|
2527
|
+
'enumerable': true,
|
2528
|
+
'value': value,
|
2529
|
+
'writable': true
|
2530
|
+
});
|
2531
|
+
} else {
|
2532
|
+
object[key] = value;
|
2533
|
+
}
|
2534
|
+
}
|
2535
|
+
|
2457
2536
|
/**
|
2458
2537
|
* The base implementation of `_.at` without support for individual paths.
|
2459
2538
|
*
|
@@ -2534,9 +2613,6 @@
|
|
2534
2613
|
return cloneBuffer(value, isDeep);
|
2535
2614
|
}
|
2536
2615
|
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
|
2537
|
-
if (isHostObject(value)) {
|
2538
|
-
return object ? value : {};
|
2539
|
-
}
|
2540
2616
|
result = initCloneObject(isFunc ? {} : value);
|
2541
2617
|
if (!isDeep) {
|
2542
2618
|
return copySymbols(value, baseAssign(result, value));
|
@@ -3180,8 +3256,8 @@
|
|
3180
3256
|
othTag = getTag(other);
|
3181
3257
|
othTag = othTag == argsTag ? objectTag : othTag;
|
3182
3258
|
}
|
3183
|
-
var objIsObj = objTag == objectTag
|
3184
|
-
othIsObj = othTag == objectTag
|
3259
|
+
var objIsObj = objTag == objectTag,
|
3260
|
+
othIsObj = othTag == objectTag,
|
3185
3261
|
isSameTag = objTag == othTag;
|
3186
3262
|
|
3187
3263
|
if (isSameTag && !objIsObj) {
|
@@ -3286,7 +3362,7 @@
|
|
3286
3362
|
if (!isObject(value) || isMasked(value)) {
|
3287
3363
|
return false;
|
3288
3364
|
}
|
3289
|
-
var pattern =
|
3365
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
3290
3366
|
return pattern.test(toSource(value));
|
3291
3367
|
}
|
3292
3368
|
|
@@ -3644,7 +3720,7 @@
|
|
3644
3720
|
value = object[key];
|
3645
3721
|
|
3646
3722
|
if (predicate(value, key)) {
|
3647
|
-
result
|
3723
|
+
baseAssignValue(result, key, value);
|
3648
3724
|
}
|
3649
3725
|
}
|
3650
3726
|
return result;
|
@@ -3810,24 +3886,7 @@
|
|
3810
3886
|
* @returns {Function} Returns the new function.
|
3811
3887
|
*/
|
3812
3888
|
function baseRest(func, start) {
|
3813
|
-
|
3814
|
-
return function() {
|
3815
|
-
var args = arguments,
|
3816
|
-
index = -1,
|
3817
|
-
length = nativeMax(args.length - start, 0),
|
3818
|
-
array = Array(length);
|
3819
|
-
|
3820
|
-
while (++index < length) {
|
3821
|
-
array[index] = args[start + index];
|
3822
|
-
}
|
3823
|
-
index = -1;
|
3824
|
-
var otherArgs = Array(start + 1);
|
3825
|
-
while (++index < start) {
|
3826
|
-
otherArgs[index] = args[index];
|
3827
|
-
}
|
3828
|
-
otherArgs[start] = array;
|
3829
|
-
return apply(func, this, otherArgs);
|
3830
|
-
};
|
3889
|
+
return setToString(overRest(func, start, identity), func + '');
|
3831
3890
|
}
|
3832
3891
|
|
3833
3892
|
/**
|
@@ -3871,7 +3930,7 @@
|
|
3871
3930
|
}
|
3872
3931
|
|
3873
3932
|
/**
|
3874
|
-
* The base implementation of `setData` without support for hot loop
|
3933
|
+
* The base implementation of `setData` without support for hot loop shorting.
|
3875
3934
|
*
|
3876
3935
|
* @private
|
3877
3936
|
* @param {Function} func The function to associate metadata with.
|
@@ -3883,6 +3942,23 @@
|
|
3883
3942
|
return func;
|
3884
3943
|
};
|
3885
3944
|
|
3945
|
+
/**
|
3946
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
3947
|
+
*
|
3948
|
+
* @private
|
3949
|
+
* @param {Function} func The function to modify.
|
3950
|
+
* @param {Function} string The `toString` result.
|
3951
|
+
* @returns {Function} Returns `func`.
|
3952
|
+
*/
|
3953
|
+
var baseSetToString = !nativeDefineProperty ? identity : function(func, string) {
|
3954
|
+
return nativeDefineProperty(func, 'toString', {
|
3955
|
+
'configurable': true,
|
3956
|
+
'enumerable': false,
|
3957
|
+
'value': constant(string),
|
3958
|
+
'writable': true
|
3959
|
+
});
|
3960
|
+
};
|
3961
|
+
|
3886
3962
|
/**
|
3887
3963
|
* The base implementation of `_.slice` without an iteratee call guard.
|
3888
3964
|
*
|
@@ -4297,6 +4373,17 @@
|
|
4297
4373
|
return isArray(value) ? value : stringToPath(value);
|
4298
4374
|
}
|
4299
4375
|
|
4376
|
+
/**
|
4377
|
+
* A `baseRest` alias which can be replaced with `identity` by module
|
4378
|
+
* replacement plugins.
|
4379
|
+
*
|
4380
|
+
* @private
|
4381
|
+
* @type {Function}
|
4382
|
+
* @param {Function} func The function to apply a rest parameter to.
|
4383
|
+
* @returns {Function} Returns the new function.
|
4384
|
+
*/
|
4385
|
+
var castRest = baseRest;
|
4386
|
+
|
4300
4387
|
/**
|
4301
4388
|
* Casts `array` to a slice if it's needed.
|
4302
4389
|
*
|
@@ -4611,6 +4698,7 @@
|
|
4611
4698
|
* @returns {Object} Returns `object`.
|
4612
4699
|
*/
|
4613
4700
|
function copyObject(source, props, object, customizer) {
|
4701
|
+
var isNew = !object;
|
4614
4702
|
object || (object = {});
|
4615
4703
|
|
4616
4704
|
var index = -1,
|
@@ -4623,7 +4711,14 @@
|
|
4623
4711
|
? customizer(object[key], source[key], key, object, source)
|
4624
4712
|
: undefined;
|
4625
4713
|
|
4626
|
-
|
4714
|
+
if (newValue === undefined) {
|
4715
|
+
newValue = source[key];
|
4716
|
+
}
|
4717
|
+
if (isNew) {
|
4718
|
+
baseAssignValue(object, key, newValue);
|
4719
|
+
} else {
|
4720
|
+
assignValue(object, key, newValue);
|
4721
|
+
}
|
4627
4722
|
}
|
4628
4723
|
return object;
|
4629
4724
|
}
|
@@ -4902,9 +4997,7 @@
|
|
4902
4997
|
* @returns {Function} Returns the new flow function.
|
4903
4998
|
*/
|
4904
4999
|
function createFlow(fromRight) {
|
4905
|
-
return
|
4906
|
-
funcs = baseFlatten(funcs, 1);
|
4907
|
-
|
5000
|
+
return flatRest(function(funcs) {
|
4908
5001
|
var length = funcs.length,
|
4909
5002
|
index = length,
|
4910
5003
|
prereq = LodashWrapper.prototype.thru;
|
@@ -5087,11 +5180,8 @@
|
|
5087
5180
|
* @returns {Function} Returns the new over function.
|
5088
5181
|
*/
|
5089
5182
|
function createOver(arrayFunc) {
|
5090
|
-
return
|
5091
|
-
iteratees = (iteratees
|
5092
|
-
? arrayMap(iteratees[0], baseUnary(getIteratee()))
|
5093
|
-
: arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee()));
|
5094
|
-
|
5183
|
+
return flatRest(function(iteratees) {
|
5184
|
+
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
5095
5185
|
return baseRest(function(args) {
|
5096
5186
|
var thisArg = this;
|
5097
5187
|
return arrayFunc(iteratees, function(iteratee) {
|
@@ -5434,9 +5524,9 @@
|
|
5434
5524
|
// Recursively compare arrays (susceptible to call stack limits).
|
5435
5525
|
if (seen) {
|
5436
5526
|
if (!arraySome(other, function(othValue, othIndex) {
|
5437
|
-
if (!seen
|
5527
|
+
if (!cacheHas(seen, othIndex) &&
|
5438
5528
|
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
|
5439
|
-
return seen.
|
5529
|
+
return seen.push(othIndex);
|
5440
5530
|
}
|
5441
5531
|
})) {
|
5442
5532
|
result = false;
|
@@ -5616,6 +5706,17 @@
|
|
5616
5706
|
return result;
|
5617
5707
|
}
|
5618
5708
|
|
5709
|
+
/**
|
5710
|
+
* A specialized version of `baseRest` which flattens the rest array.
|
5711
|
+
*
|
5712
|
+
* @private
|
5713
|
+
* @param {Function} func The function to apply a rest parameter to.
|
5714
|
+
* @returns {Function} Returns the new function.
|
5715
|
+
*/
|
5716
|
+
function flatRest(func) {
|
5717
|
+
return setToString(overRest(func, undefined, flatten), func + '');
|
5718
|
+
}
|
5719
|
+
|
5619
5720
|
/**
|
5620
5721
|
* Creates an array of own enumerable property names and symbols of `object`.
|
5621
5722
|
*
|
@@ -5784,8 +5885,7 @@
|
|
5784
5885
|
*/
|
5785
5886
|
var getTag = baseGetTag;
|
5786
5887
|
|
5787
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11
|
5788
|
-
// for data views in Edge < 14, and promises in Node.js.
|
5888
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
5789
5889
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
5790
5890
|
(Map && getTag(new Map) != mapTag) ||
|
5791
5891
|
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
@@ -5861,9 +5961,9 @@
|
|
5861
5961
|
function hasPath(object, path, hasFunc) {
|
5862
5962
|
path = isKey(path, object) ? [path] : castPath(path);
|
5863
5963
|
|
5864
|
-
var
|
5865
|
-
|
5866
|
-
|
5964
|
+
var index = -1,
|
5965
|
+
length = path.length,
|
5966
|
+
result = false;
|
5867
5967
|
|
5868
5968
|
while (++index < length) {
|
5869
5969
|
var key = toKey(path[index]);
|
@@ -5872,10 +5972,10 @@
|
|
5872
5972
|
}
|
5873
5973
|
object = object[key];
|
5874
5974
|
}
|
5875
|
-
if (result) {
|
5975
|
+
if (result || ++index != length) {
|
5876
5976
|
return result;
|
5877
5977
|
}
|
5878
|
-
|
5978
|
+
length = object ? object.length : 0;
|
5879
5979
|
return !!length && isLength(length) && isIndex(key, length) &&
|
5880
5980
|
(isArray(object) || isArguments(object));
|
5881
5981
|
}
|
@@ -5970,9 +6070,11 @@
|
|
5970
6070
|
* @returns {string} Returns the modified source.
|
5971
6071
|
*/
|
5972
6072
|
function insertWrapDetails(source, details) {
|
5973
|
-
var length = details.length
|
5974
|
-
|
5975
|
-
|
6073
|
+
var length = details.length;
|
6074
|
+
if (!length) {
|
6075
|
+
return source;
|
6076
|
+
}
|
6077
|
+
var lastIndex = length - 1;
|
5976
6078
|
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
|
5977
6079
|
details = details.join(length > 2 ? ', ' : ' ');
|
5978
6080
|
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
|
@@ -6151,6 +6253,26 @@
|
|
6151
6253
|
};
|
6152
6254
|
}
|
6153
6255
|
|
6256
|
+
/**
|
6257
|
+
* A specialized version of `_.memoize` which clears the memoized function's
|
6258
|
+
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
6259
|
+
*
|
6260
|
+
* @private
|
6261
|
+
* @param {Function} func The function to have its output memoized.
|
6262
|
+
* @returns {Function} Returns the new memoized function.
|
6263
|
+
*/
|
6264
|
+
function memoizeCapped(func) {
|
6265
|
+
var result = memoize(func, function(key) {
|
6266
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
6267
|
+
cache.clear();
|
6268
|
+
}
|
6269
|
+
return key;
|
6270
|
+
});
|
6271
|
+
|
6272
|
+
var cache = result.cache;
|
6273
|
+
return result;
|
6274
|
+
}
|
6275
|
+
|
6154
6276
|
/**
|
6155
6277
|
* Merges the function metadata of `source` into `data`.
|
6156
6278
|
*
|
@@ -6264,6 +6386,36 @@
|
|
6264
6386
|
return result;
|
6265
6387
|
}
|
6266
6388
|
|
6389
|
+
/**
|
6390
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
6391
|
+
*
|
6392
|
+
* @private
|
6393
|
+
* @param {Function} func The function to apply a rest parameter to.
|
6394
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
6395
|
+
* @param {Function} transform The rest array transform.
|
6396
|
+
* @returns {Function} Returns the new function.
|
6397
|
+
*/
|
6398
|
+
function overRest(func, start, transform) {
|
6399
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
6400
|
+
return function() {
|
6401
|
+
var args = arguments,
|
6402
|
+
index = -1,
|
6403
|
+
length = nativeMax(args.length - start, 0),
|
6404
|
+
array = Array(length);
|
6405
|
+
|
6406
|
+
while (++index < length) {
|
6407
|
+
array[index] = args[start + index];
|
6408
|
+
}
|
6409
|
+
index = -1;
|
6410
|
+
var otherArgs = Array(start + 1);
|
6411
|
+
while (++index < start) {
|
6412
|
+
otherArgs[index] = args[index];
|
6413
|
+
}
|
6414
|
+
otherArgs[start] = transform(array);
|
6415
|
+
return apply(func, this, otherArgs);
|
6416
|
+
};
|
6417
|
+
}
|
6418
|
+
|
6267
6419
|
/**
|
6268
6420
|
* Gets the parent value at `path` of `object`.
|
6269
6421
|
*
|
@@ -6312,25 +6464,7 @@
|
|
6312
6464
|
* @param {*} data The metadata.
|
6313
6465
|
* @returns {Function} Returns `func`.
|
6314
6466
|
*/
|
6315
|
-
var setData = (
|
6316
|
-
var count = 0,
|
6317
|
-
lastCalled = 0;
|
6318
|
-
|
6319
|
-
return function(key, value) {
|
6320
|
-
var stamp = now(),
|
6321
|
-
remaining = HOT_SPAN - (stamp - lastCalled);
|
6322
|
-
|
6323
|
-
lastCalled = stamp;
|
6324
|
-
if (remaining > 0) {
|
6325
|
-
if (++count >= HOT_COUNT) {
|
6326
|
-
return key;
|
6327
|
-
}
|
6328
|
-
} else {
|
6329
|
-
count = 0;
|
6330
|
-
}
|
6331
|
-
return baseSetData(key, value);
|
6332
|
-
};
|
6333
|
-
}());
|
6467
|
+
var setData = shortOut(baseSetData);
|
6334
6468
|
|
6335
6469
|
/**
|
6336
6470
|
* A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
|
@@ -6344,6 +6478,16 @@
|
|
6344
6478
|
return root.setTimeout(func, wait);
|
6345
6479
|
};
|
6346
6480
|
|
6481
|
+
/**
|
6482
|
+
* Sets the `toString` method of `func` to return `string`.
|
6483
|
+
*
|
6484
|
+
* @private
|
6485
|
+
* @param {Function} func The function to modify.
|
6486
|
+
* @param {Function} string The `toString` result.
|
6487
|
+
* @returns {Function} Returns `func`.
|
6488
|
+
*/
|
6489
|
+
var setToString = shortOut(baseSetToString);
|
6490
|
+
|
6347
6491
|
/**
|
6348
6492
|
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
|
6349
6493
|
* with wrapper details in a comment at the top of the source body.
|
@@ -6354,14 +6498,61 @@
|
|
6354
6498
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
|
6355
6499
|
* @returns {Function} Returns `wrapper`.
|
6356
6500
|
*/
|
6357
|
-
|
6501
|
+
function setWrapToString(wrapper, reference, bitmask) {
|
6358
6502
|
var source = (reference + '');
|
6359
|
-
return
|
6360
|
-
|
6361
|
-
|
6362
|
-
|
6363
|
-
|
6364
|
-
|
6503
|
+
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
|
6504
|
+
}
|
6505
|
+
|
6506
|
+
/**
|
6507
|
+
* Creates a function that'll short out and invoke `identity` instead
|
6508
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
6509
|
+
* milliseconds.
|
6510
|
+
*
|
6511
|
+
* @private
|
6512
|
+
* @param {Function} func The function to restrict.
|
6513
|
+
* @returns {Function} Returns the new shortable function.
|
6514
|
+
*/
|
6515
|
+
function shortOut(func) {
|
6516
|
+
var count = 0,
|
6517
|
+
lastCalled = 0;
|
6518
|
+
|
6519
|
+
return function() {
|
6520
|
+
var stamp = nativeNow(),
|
6521
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
6522
|
+
|
6523
|
+
lastCalled = stamp;
|
6524
|
+
if (remaining > 0) {
|
6525
|
+
if (++count >= HOT_COUNT) {
|
6526
|
+
return arguments[0];
|
6527
|
+
}
|
6528
|
+
} else {
|
6529
|
+
count = 0;
|
6530
|
+
}
|
6531
|
+
return func.apply(undefined, arguments);
|
6532
|
+
};
|
6533
|
+
}
|
6534
|
+
|
6535
|
+
/**
|
6536
|
+
* A specialized version of `arrayShuffle` which mutates `array`.
|
6537
|
+
*
|
6538
|
+
* @private
|
6539
|
+
* @param {Array} array The array to shuffle.
|
6540
|
+
* @returns {Array} Returns `array`.
|
6541
|
+
*/
|
6542
|
+
function shuffleSelf(array) {
|
6543
|
+
var index = -1,
|
6544
|
+
length = array.length,
|
6545
|
+
lastIndex = length - 1;
|
6546
|
+
|
6547
|
+
while (++index < length) {
|
6548
|
+
var rand = baseRandom(index, lastIndex),
|
6549
|
+
value = array[rand];
|
6550
|
+
|
6551
|
+
array[rand] = array[index];
|
6552
|
+
array[index] = value;
|
6553
|
+
}
|
6554
|
+
return array;
|
6555
|
+
}
|
6365
6556
|
|
6366
6557
|
/**
|
6367
6558
|
* Converts `string` to a property path array.
|
@@ -6370,7 +6561,7 @@
|
|
6370
6561
|
* @param {string} string The string to convert.
|
6371
6562
|
* @returns {Array} Returns the property path array.
|
6372
6563
|
*/
|
6373
|
-
var stringToPath =
|
6564
|
+
var stringToPath = memoizeCapped(function(string) {
|
6374
6565
|
string = toString(string);
|
6375
6566
|
|
6376
6567
|
var result = [];
|
@@ -6549,24 +6740,25 @@
|
|
6549
6740
|
* // => [1]
|
6550
6741
|
*/
|
6551
6742
|
function concat() {
|
6552
|
-
var length = arguments.length
|
6553
|
-
|
6743
|
+
var length = arguments.length;
|
6744
|
+
if (!length) {
|
6745
|
+
return [];
|
6746
|
+
}
|
6747
|
+
var args = Array(length - 1),
|
6554
6748
|
array = arguments[0],
|
6555
6749
|
index = length;
|
6556
6750
|
|
6557
6751
|
while (index--) {
|
6558
6752
|
args[index - 1] = arguments[index];
|
6559
6753
|
}
|
6560
|
-
return
|
6561
|
-
? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1))
|
6562
|
-
: [];
|
6754
|
+
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
|
6563
6755
|
}
|
6564
6756
|
|
6565
6757
|
/**
|
6566
6758
|
* Creates an array of `array` values not included in the other given arrays
|
6567
6759
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
6568
|
-
* for equality comparisons. The order of result values
|
6569
|
-
*
|
6760
|
+
* for equality comparisons. The order and references of result values are
|
6761
|
+
* determined by the first array.
|
6570
6762
|
*
|
6571
6763
|
* **Note:** Unlike `_.pullAll`, this method returns a new array.
|
6572
6764
|
*
|
@@ -6592,8 +6784,9 @@
|
|
6592
6784
|
/**
|
6593
6785
|
* This method is like `_.difference` except that it accepts `iteratee` which
|
6594
6786
|
* is invoked for each element of `array` and `values` to generate the criterion
|
6595
|
-
* by which they're compared.
|
6596
|
-
* The iteratee is invoked with one argument:
|
6787
|
+
* by which they're compared. The order and references of result values are
|
6788
|
+
* determined by the first array. The iteratee is invoked with one argument:
|
6789
|
+
* (value).
|
6597
6790
|
*
|
6598
6791
|
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
|
6599
6792
|
*
|
@@ -6626,9 +6819,9 @@
|
|
6626
6819
|
|
6627
6820
|
/**
|
6628
6821
|
* This method is like `_.difference` except that it accepts `comparator`
|
6629
|
-
* which is invoked to compare elements of `array` to `values`.
|
6630
|
-
* are
|
6631
|
-
* (arrVal, othVal).
|
6822
|
+
* which is invoked to compare elements of `array` to `values`. The order and
|
6823
|
+
* references of result values are determined by the first array. The comparator
|
6824
|
+
* is invoked with two arguments: (arrVal, othVal).
|
6632
6825
|
*
|
6633
6826
|
* **Note:** Unlike `_.pullAllWith`, this method returns a new array.
|
6634
6827
|
*
|
@@ -7122,8 +7315,8 @@
|
|
7122
7315
|
/**
|
7123
7316
|
* Creates an array of unique values that are included in all given arrays
|
7124
7317
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
7125
|
-
* for equality comparisons. The order of result values
|
7126
|
-
*
|
7318
|
+
* for equality comparisons. The order and references of result values are
|
7319
|
+
* determined by the first array.
|
7127
7320
|
*
|
7128
7321
|
* @static
|
7129
7322
|
* @memberOf _
|
@@ -7146,8 +7339,9 @@
|
|
7146
7339
|
/**
|
7147
7340
|
* This method is like `_.intersection` except that it accepts `iteratee`
|
7148
7341
|
* which is invoked for each element of each `arrays` to generate the criterion
|
7149
|
-
* by which they're compared.
|
7150
|
-
* The iteratee is invoked with one argument:
|
7342
|
+
* by which they're compared. The order and references of result values are
|
7343
|
+
* determined by the first array. The iteratee is invoked with one argument:
|
7344
|
+
* (value).
|
7151
7345
|
*
|
7152
7346
|
* @static
|
7153
7347
|
* @memberOf _
|
@@ -7181,9 +7375,9 @@
|
|
7181
7375
|
|
7182
7376
|
/**
|
7183
7377
|
* This method is like `_.intersection` except that it accepts `comparator`
|
7184
|
-
* which is invoked to compare elements of `arrays`.
|
7185
|
-
*
|
7186
|
-
* (arrVal, othVal).
|
7378
|
+
* which is invoked to compare elements of `arrays`. The order and references
|
7379
|
+
* of result values are determined by the first array. The comparator is
|
7380
|
+
* invoked with two arguments: (arrVal, othVal).
|
7187
7381
|
*
|
7188
7382
|
* @static
|
7189
7383
|
* @memberOf _
|
@@ -7281,21 +7475,11 @@
|
|
7281
7475
|
var index = length;
|
7282
7476
|
if (fromIndex !== undefined) {
|
7283
7477
|
index = toInteger(fromIndex);
|
7284
|
-
index = (
|
7285
|
-
index < 0
|
7286
|
-
? nativeMax(length + index, 0)
|
7287
|
-
: nativeMin(index, length - 1)
|
7288
|
-
) + 1;
|
7289
|
-
}
|
7290
|
-
if (value !== value) {
|
7291
|
-
return baseFindIndex(array, baseIsNaN, index - 1, true);
|
7478
|
+
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
|
7292
7479
|
}
|
7293
|
-
|
7294
|
-
|
7295
|
-
|
7296
|
-
}
|
7297
|
-
}
|
7298
|
-
return -1;
|
7480
|
+
return value === value
|
7481
|
+
? strictLastIndexOf(array, value, index)
|
7482
|
+
: baseFindIndex(array, baseIsNaN, index, true);
|
7299
7483
|
}
|
7300
7484
|
|
7301
7485
|
/**
|
@@ -7457,9 +7641,7 @@
|
|
7457
7641
|
* console.log(pulled);
|
7458
7642
|
* // => ['b', 'd']
|
7459
7643
|
*/
|
7460
|
-
var pullAt =
|
7461
|
-
indexes = baseFlatten(indexes, 1);
|
7462
|
-
|
7644
|
+
var pullAt = flatRest(function(array, indexes) {
|
7463
7645
|
var length = array ? array.length : 0,
|
7464
7646
|
result = baseAt(array, indexes);
|
7465
7647
|
|
@@ -8034,8 +8216,9 @@
|
|
8034
8216
|
/**
|
8035
8217
|
* Creates a duplicate-free version of an array, using
|
8036
8218
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
8037
|
-
* for equality comparisons, in which only the first occurrence of each
|
8038
|
-
*
|
8219
|
+
* for equality comparisons, in which only the first occurrence of each element
|
8220
|
+
* is kept. The order of result values is determined by the order they occur
|
8221
|
+
* in the array.
|
8039
8222
|
*
|
8040
8223
|
* @static
|
8041
8224
|
* @memberOf _
|
@@ -8057,7 +8240,9 @@
|
|
8057
8240
|
/**
|
8058
8241
|
* This method is like `_.uniq` except that it accepts `iteratee` which is
|
8059
8242
|
* invoked for each element in `array` to generate the criterion by which
|
8060
|
-
* uniqueness is computed. The
|
8243
|
+
* uniqueness is computed. The order of result values is determined by the
|
8244
|
+
* order they occur in the array. The iteratee is invoked with one argument:
|
8245
|
+
* (value).
|
8061
8246
|
*
|
8062
8247
|
* @static
|
8063
8248
|
* @memberOf _
|
@@ -8084,8 +8269,9 @@
|
|
8084
8269
|
|
8085
8270
|
/**
|
8086
8271
|
* This method is like `_.uniq` except that it accepts `comparator` which
|
8087
|
-
* is invoked to compare elements of `array`. The
|
8088
|
-
*
|
8272
|
+
* is invoked to compare elements of `array`. The order of result values is
|
8273
|
+
* determined by the order they occur in the array.The comparator is invoked
|
8274
|
+
* with two arguments: (arrVal, othVal).
|
8089
8275
|
*
|
8090
8276
|
* @static
|
8091
8277
|
* @memberOf _
|
@@ -8227,8 +8413,9 @@
|
|
8227
8413
|
/**
|
8228
8414
|
* This method is like `_.xor` except that it accepts `iteratee` which is
|
8229
8415
|
* invoked for each element of each `arrays` to generate the criterion by
|
8230
|
-
* which by which they're compared. The
|
8231
|
-
*
|
8416
|
+
* which by which they're compared. The order of result values is determined
|
8417
|
+
* by the order they occur in the arrays. The iteratee is invoked with one
|
8418
|
+
* argument: (value).
|
8232
8419
|
*
|
8233
8420
|
* @static
|
8234
8421
|
* @memberOf _
|
@@ -8257,8 +8444,9 @@
|
|
8257
8444
|
|
8258
8445
|
/**
|
8259
8446
|
* This method is like `_.xor` except that it accepts `comparator` which is
|
8260
|
-
* invoked to compare elements of `arrays`. The
|
8261
|
-
*
|
8447
|
+
* invoked to compare elements of `arrays`. The order of result values is
|
8448
|
+
* determined by the order they occur in the arrays. The comparator is invoked
|
8449
|
+
* with two arguments: (arrVal, othVal).
|
8262
8450
|
*
|
8263
8451
|
* @static
|
8264
8452
|
* @memberOf _
|
@@ -8475,8 +8663,7 @@
|
|
8475
8663
|
* _(object).at(['a[0].b.c', 'a[1]']).value();
|
8476
8664
|
* // => [3, 4]
|
8477
8665
|
*/
|
8478
|
-
var wrapperAt =
|
8479
|
-
paths = baseFlatten(paths, 1);
|
8666
|
+
var wrapperAt = flatRest(function(paths) {
|
8480
8667
|
var length = paths.length,
|
8481
8668
|
start = length ? paths[0] : 0,
|
8482
8669
|
value = this.__wrapped__,
|
@@ -8741,7 +8928,11 @@
|
|
8741
8928
|
* // => { '3': 2, '5': 1 }
|
8742
8929
|
*/
|
8743
8930
|
var countBy = createAggregator(function(result, value, key) {
|
8744
|
-
hasOwnProperty.call(result, key)
|
8931
|
+
if (hasOwnProperty.call(result, key)) {
|
8932
|
+
++result[key];
|
8933
|
+
} else {
|
8934
|
+
baseAssignValue(result, key, 1);
|
8935
|
+
}
|
8745
8936
|
});
|
8746
8937
|
|
8747
8938
|
/**
|
@@ -8996,7 +9187,7 @@
|
|
8996
9187
|
* @see _.forEachRight
|
8997
9188
|
* @example
|
8998
9189
|
*
|
8999
|
-
* _([1, 2]
|
9190
|
+
* _.forEach([1, 2], function(value) {
|
9000
9191
|
* console.log(value);
|
9001
9192
|
* });
|
9002
9193
|
* // => Logs `1` then `2`.
|
@@ -9064,7 +9255,7 @@
|
|
9064
9255
|
if (hasOwnProperty.call(result, key)) {
|
9065
9256
|
result[key].push(value);
|
9066
9257
|
} else {
|
9067
|
-
result
|
9258
|
+
baseAssignValue(result, key, [value]);
|
9068
9259
|
}
|
9069
9260
|
});
|
9070
9261
|
|
@@ -9177,7 +9368,7 @@
|
|
9177
9368
|
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
|
9178
9369
|
*/
|
9179
9370
|
var keyBy = createAggregator(function(result, value, key) {
|
9180
|
-
result
|
9371
|
+
baseAssignValue(result, key, value);
|
9181
9372
|
});
|
9182
9373
|
|
9183
9374
|
/**
|
@@ -9437,10 +9628,7 @@
|
|
9437
9628
|
* // => 2
|
9438
9629
|
*/
|
9439
9630
|
function sample(collection) {
|
9440
|
-
|
9441
|
-
length = array.length;
|
9442
|
-
|
9443
|
-
return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
|
9631
|
+
return arraySample(isArrayLike(collection) ? collection : values(collection));
|
9444
9632
|
}
|
9445
9633
|
|
9446
9634
|
/**
|
@@ -9464,25 +9652,12 @@
|
|
9464
9652
|
* // => [2, 3, 1]
|
9465
9653
|
*/
|
9466
9654
|
function sampleSize(collection, n, guard) {
|
9467
|
-
var index = -1,
|
9468
|
-
result = toArray(collection),
|
9469
|
-
length = result.length,
|
9470
|
-
lastIndex = length - 1;
|
9471
|
-
|
9472
9655
|
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
|
9473
9656
|
n = 1;
|
9474
9657
|
} else {
|
9475
|
-
n =
|
9476
|
-
}
|
9477
|
-
while (++index < n) {
|
9478
|
-
var rand = baseRandom(index, lastIndex),
|
9479
|
-
value = result[rand];
|
9480
|
-
|
9481
|
-
result[rand] = result[index];
|
9482
|
-
result[index] = value;
|
9658
|
+
n = toInteger(n);
|
9483
9659
|
}
|
9484
|
-
|
9485
|
-
return result;
|
9660
|
+
return arraySampleSize(isArrayLike(collection) ? collection : values(collection), n);
|
9486
9661
|
}
|
9487
9662
|
|
9488
9663
|
/**
|
@@ -9501,7 +9676,10 @@
|
|
9501
9676
|
* // => [4, 1, 3, 2]
|
9502
9677
|
*/
|
9503
9678
|
function shuffle(collection) {
|
9504
|
-
return
|
9679
|
+
return shuffleSelf(isArrayLike(collection)
|
9680
|
+
? copyArray(collection)
|
9681
|
+
: values(collection)
|
9682
|
+
);
|
9505
9683
|
}
|
9506
9684
|
|
9507
9685
|
/**
|
@@ -9606,16 +9784,11 @@
|
|
9606
9784
|
* { 'user': 'barney', 'age': 34 }
|
9607
9785
|
* ];
|
9608
9786
|
*
|
9609
|
-
* _.sortBy(users, function(o) { return o.user; });
|
9787
|
+
* _.sortBy(users, [function(o) { return o.user; }]);
|
9610
9788
|
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
|
9611
9789
|
*
|
9612
9790
|
* _.sortBy(users, ['user', 'age']);
|
9613
9791
|
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
|
9614
|
-
*
|
9615
|
-
* _.sortBy(users, 'user', function(o) {
|
9616
|
-
* return Math.floor(o.age / 10);
|
9617
|
-
* });
|
9618
|
-
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
|
9619
9792
|
*/
|
9620
9793
|
var sortBy = baseRest(function(collection, iteratees) {
|
9621
9794
|
if (collection == null) {
|
@@ -10130,7 +10303,7 @@
|
|
10130
10303
|
* _.defer(function(text) {
|
10131
10304
|
* console.log(text);
|
10132
10305
|
* }, 'deferred');
|
10133
|
-
* // => Logs 'deferred' after one
|
10306
|
+
* // => Logs 'deferred' after one millisecond.
|
10134
10307
|
*/
|
10135
10308
|
var defer = baseRest(function(func, args) {
|
10136
10309
|
return baseDelay(func, 1, args);
|
@@ -10238,14 +10411,14 @@
|
|
10238
10411
|
return cache.get(key);
|
10239
10412
|
}
|
10240
10413
|
var result = func.apply(this, args);
|
10241
|
-
memoized.cache = cache.set(key, result);
|
10414
|
+
memoized.cache = cache.set(key, result) || cache;
|
10242
10415
|
return result;
|
10243
10416
|
};
|
10244
10417
|
memoized.cache = new (memoize.Cache || MapCache);
|
10245
10418
|
return memoized;
|
10246
10419
|
}
|
10247
10420
|
|
10248
|
-
//
|
10421
|
+
// Expose `MapCache`.
|
10249
10422
|
memoize.Cache = MapCache;
|
10250
10423
|
|
10251
10424
|
/**
|
@@ -10337,7 +10510,7 @@
|
|
10337
10510
|
* func(10, 5);
|
10338
10511
|
* // => [100, 10]
|
10339
10512
|
*/
|
10340
|
-
var overArgs =
|
10513
|
+
var overArgs = castRest(function(func, transforms) {
|
10341
10514
|
transforms = (transforms.length == 1 && isArray(transforms[0]))
|
10342
10515
|
? arrayMap(transforms[0], baseUnary(getIteratee()))
|
10343
10516
|
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
|
@@ -10451,8 +10624,8 @@
|
|
10451
10624
|
* rearged('b', 'c', 'a')
|
10452
10625
|
* // => ['a', 'b', 'c']
|
10453
10626
|
*/
|
10454
|
-
var rearg =
|
10455
|
-
return createWrap(func, REARG_FLAG, undefined, undefined, undefined,
|
10627
|
+
var rearg = flatRest(function(func, indexes) {
|
10628
|
+
return createWrap(func, REARG_FLAG, undefined, undefined, undefined, indexes);
|
10456
10629
|
});
|
10457
10630
|
|
10458
10631
|
/**
|
@@ -11128,7 +11301,7 @@
|
|
11128
11301
|
* // => false
|
11129
11302
|
*/
|
11130
11303
|
function isElement(value) {
|
11131
|
-
return
|
11304
|
+
return value != null && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
|
11132
11305
|
}
|
11133
11306
|
|
11134
11307
|
/**
|
@@ -11174,7 +11347,7 @@
|
|
11174
11347
|
if (tag == mapTag || tag == setTag) {
|
11175
11348
|
return !value.size;
|
11176
11349
|
}
|
11177
|
-
if (
|
11350
|
+
if (isPrototype(value)) {
|
11178
11351
|
return !nativeKeys(value).length;
|
11179
11352
|
}
|
11180
11353
|
for (var key in value) {
|
@@ -11423,7 +11596,7 @@
|
|
11423
11596
|
*/
|
11424
11597
|
function isObject(value) {
|
11425
11598
|
var type = typeof value;
|
11426
|
-
return
|
11599
|
+
return value != null && (type == 'object' || type == 'function');
|
11427
11600
|
}
|
11428
11601
|
|
11429
11602
|
/**
|
@@ -11451,7 +11624,7 @@
|
|
11451
11624
|
* // => false
|
11452
11625
|
*/
|
11453
11626
|
function isObjectLike(value) {
|
11454
|
-
return
|
11627
|
+
return value != null && typeof value == 'object';
|
11455
11628
|
}
|
11456
11629
|
|
11457
11630
|
/**
|
@@ -11715,8 +11888,7 @@
|
|
11715
11888
|
* // => true
|
11716
11889
|
*/
|
11717
11890
|
function isPlainObject(value) {
|
11718
|
-
if (!isObjectLike(value) ||
|
11719
|
-
objectToString.call(value) != objectTag || isHostObject(value)) {
|
11891
|
+
if (!isObjectLike(value) || objectToString.call(value) != objectTag) {
|
11720
11892
|
return false;
|
11721
11893
|
}
|
11722
11894
|
var proto = getPrototype(value);
|
@@ -12273,7 +12445,7 @@
|
|
12273
12445
|
* // => { 'a': 1, 'c': 3 }
|
12274
12446
|
*/
|
12275
12447
|
var assign = createAssigner(function(object, source) {
|
12276
|
-
if (
|
12448
|
+
if (isPrototype(source) || isArrayLike(source)) {
|
12277
12449
|
copyObject(source, keys(source), object);
|
12278
12450
|
return;
|
12279
12451
|
}
|
@@ -12401,9 +12573,7 @@
|
|
12401
12573
|
* _.at(object, ['a[0].b.c', 'a[1]']);
|
12402
12574
|
* // => [3, 4]
|
12403
12575
|
*/
|
12404
|
-
var at =
|
12405
|
-
return baseAt(object, baseFlatten(paths, 1));
|
12406
|
-
});
|
12576
|
+
var at = flatRest(baseAt);
|
12407
12577
|
|
12408
12578
|
/**
|
12409
12579
|
* Creates an object that inherits from the `prototype` object. If a
|
@@ -13006,7 +13176,7 @@
|
|
13006
13176
|
iteratee = getIteratee(iteratee, 3);
|
13007
13177
|
|
13008
13178
|
baseForOwn(object, function(value, key, object) {
|
13009
|
-
result
|
13179
|
+
baseAssignValue(result, iteratee(value, key, object), value);
|
13010
13180
|
});
|
13011
13181
|
return result;
|
13012
13182
|
}
|
@@ -13044,7 +13214,7 @@
|
|
13044
13214
|
iteratee = getIteratee(iteratee, 3);
|
13045
13215
|
|
13046
13216
|
baseForOwn(object, function(value, key, object) {
|
13047
|
-
result
|
13217
|
+
baseAssignValue(result, key, iteratee(value, key, object));
|
13048
13218
|
});
|
13049
13219
|
return result;
|
13050
13220
|
}
|
@@ -13088,7 +13258,7 @@
|
|
13088
13258
|
* This method is like `_.merge` except that it accepts `customizer` which
|
13089
13259
|
* is invoked to produce the merged values of the destination and source
|
13090
13260
|
* properties. If `customizer` returns `undefined`, merging is handled by the
|
13091
|
-
* method instead. The `customizer` is invoked with
|
13261
|
+
* method instead. The `customizer` is invoked with six arguments:
|
13092
13262
|
* (objValue, srcValue, key, object, source, stack).
|
13093
13263
|
*
|
13094
13264
|
* **Note:** This method mutates `object`.
|
@@ -13138,11 +13308,11 @@
|
|
13138
13308
|
* _.omit(object, ['a', 'c']);
|
13139
13309
|
* // => { 'b': '2' }
|
13140
13310
|
*/
|
13141
|
-
var omit =
|
13311
|
+
var omit = flatRest(function(object, props) {
|
13142
13312
|
if (object == null) {
|
13143
13313
|
return {};
|
13144
13314
|
}
|
13145
|
-
props = arrayMap(
|
13315
|
+
props = arrayMap(props, toKey);
|
13146
13316
|
return basePick(object, baseDifference(getAllKeysIn(object), props));
|
13147
13317
|
});
|
13148
13318
|
|
@@ -13187,8 +13357,8 @@
|
|
13187
13357
|
* _.pick(object, ['a', 'c']);
|
13188
13358
|
* // => { 'a': 1, 'c': 3 }
|
13189
13359
|
*/
|
13190
|
-
var pick =
|
13191
|
-
return object == null ? {} : basePick(object, arrayMap(
|
13360
|
+
var pick = flatRest(function(object, props) {
|
13361
|
+
return object == null ? {} : basePick(object, arrayMap(props, toKey));
|
13192
13362
|
});
|
13193
13363
|
|
13194
13364
|
/**
|
@@ -13842,8 +14012,8 @@
|
|
13842
14012
|
}
|
13843
14013
|
|
13844
14014
|
/**
|
13845
|
-
* Converts the characters "&", "<", ">", '"',
|
13846
|
-
*
|
14015
|
+
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
14016
|
+
* corresponding HTML entities.
|
13847
14017
|
*
|
13848
14018
|
* **Note:** No other characters are escaped. To escape additional
|
13849
14019
|
* characters use a third-party library like [_he_](https://mths.be/he).
|
@@ -13854,12 +14024,6 @@
|
|
13854
14024
|
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
13855
14025
|
* (under "semi-related fun fact") for more details.
|
13856
14026
|
*
|
13857
|
-
* Backticks are escaped because in IE < 9, they can break out of
|
13858
|
-
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
|
13859
|
-
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
|
13860
|
-
* [#133](https://html5sec.org/#133) of the
|
13861
|
-
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
|
13862
|
-
*
|
13863
14027
|
* When working with HTML you should always
|
13864
14028
|
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
|
13865
14029
|
* XSS vectors.
|
@@ -14102,15 +14266,12 @@
|
|
14102
14266
|
* // => [6, 8, 10]
|
14103
14267
|
*/
|
14104
14268
|
function parseInt(string, radix, guard) {
|
14105
|
-
// Chrome fails to trim leading <BOM> whitespace characters.
|
14106
|
-
// See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details.
|
14107
14269
|
if (guard || radix == null) {
|
14108
14270
|
radix = 0;
|
14109
14271
|
} else if (radix) {
|
14110
14272
|
radix = +radix;
|
14111
14273
|
}
|
14112
|
-
|
14113
|
-
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
|
14274
|
+
return nativeParseInt(toString(string), radix || 0);
|
14114
14275
|
}
|
14115
14276
|
|
14116
14277
|
/**
|
@@ -14349,7 +14510,8 @@
|
|
14349
14510
|
* compiled({ 'user': 'barney' });
|
14350
14511
|
* // => 'hello barney!'
|
14351
14512
|
*
|
14352
|
-
* // Use the ES delimiter as an
|
14513
|
+
* // Use the ES template literal delimiter as an "interpolate" delimiter.
|
14514
|
+
* // Disable support by replacing the "interpolate" delimiter.
|
14353
14515
|
* var compiled = _.template('hello ${ user }!');
|
14354
14516
|
* compiled({ 'user': 'pebbles' });
|
14355
14517
|
* // => 'hello pebbles!'
|
@@ -14750,7 +14912,7 @@
|
|
14750
14912
|
|
14751
14913
|
/**
|
14752
14914
|
* The inverse of `_.escape`; this method converts the HTML entities
|
14753
|
-
* `&`, `<`, `>`, `"`,
|
14915
|
+
* `&`, `<`, `>`, `"`, and `'` in `string` to
|
14754
14916
|
* their corresponding characters.
|
14755
14917
|
*
|
14756
14918
|
* **Note:** No other HTML entities are unescaped. To unescape additional
|
@@ -14904,10 +15066,10 @@
|
|
14904
15066
|
* jQuery(element).on('click', view.click);
|
14905
15067
|
* // => Logs 'clicked docs' when clicked.
|
14906
15068
|
*/
|
14907
|
-
var bindAll =
|
14908
|
-
arrayEach(
|
15069
|
+
var bindAll = flatRest(function(object, methodNames) {
|
15070
|
+
arrayEach(methodNames, function(key) {
|
14909
15071
|
key = toKey(key);
|
14910
|
-
object
|
15072
|
+
baseAssignValue(object, key, bind(object[key], object));
|
14911
15073
|
});
|
14912
15074
|
return object;
|
14913
15075
|
});
|
@@ -16698,7 +16860,7 @@
|
|
16698
16860
|
lodash.prototype[iteratorSymbol] = wrapperToIterator;
|
16699
16861
|
}
|
16700
16862
|
return lodash;
|
16701
|
-
}
|
16863
|
+
});
|
16702
16864
|
|
16703
16865
|
/*--------------------------------------------------------------------------*/
|
16704
16866
|
|