lodash-rails 4.17.14 → 4.17.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/lodash/rails/version.rb +1 -1
- data/vendor/assets/javascripts/lodash.core.js +140 -117
- data/vendor/assets/javascripts/lodash.core.min.js +20 -20
- data/vendor/assets/javascripts/lodash.js +770 -673
- data/vendor/assets/javascripts/lodash.min.js +137 -134
- metadata +6 -6
@@ -12,14 +12,15 @@
|
|
12
12
|
var undefined;
|
13
13
|
|
14
14
|
/** Used as the semantic version number. */
|
15
|
-
var VERSION = '4.17.
|
15
|
+
var VERSION = '4.17.21';
|
16
16
|
|
17
17
|
/** Used as the size to enable large array optimizations. */
|
18
18
|
var LARGE_ARRAY_SIZE = 200;
|
19
19
|
|
20
20
|
/** Error message constants. */
|
21
21
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
22
|
-
|
22
|
+
FUNC_ERROR_TEXT = 'Expected a function',
|
23
|
+
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
23
24
|
|
24
25
|
/** Used to stand-in for `undefined` hash values. */
|
25
26
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
@@ -32,48 +33,48 @@
|
|
32
33
|
|
33
34
|
/** Used to compose bitmasks for cloning. */
|
34
35
|
var CLONE_DEEP_FLAG = 1,
|
35
|
-
|
36
|
-
|
36
|
+
CLONE_FLAT_FLAG = 2,
|
37
|
+
CLONE_SYMBOLS_FLAG = 4;
|
37
38
|
|
38
39
|
/** Used to compose bitmasks for value comparisons. */
|
39
40
|
var COMPARE_PARTIAL_FLAG = 1,
|
40
|
-
|
41
|
+
COMPARE_UNORDERED_FLAG = 2;
|
41
42
|
|
42
43
|
/** Used to compose bitmasks for function metadata. */
|
43
44
|
var WRAP_BIND_FLAG = 1,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
WRAP_BIND_KEY_FLAG = 2,
|
46
|
+
WRAP_CURRY_BOUND_FLAG = 4,
|
47
|
+
WRAP_CURRY_FLAG = 8,
|
48
|
+
WRAP_CURRY_RIGHT_FLAG = 16,
|
49
|
+
WRAP_PARTIAL_FLAG = 32,
|
50
|
+
WRAP_PARTIAL_RIGHT_FLAG = 64,
|
51
|
+
WRAP_ARY_FLAG = 128,
|
52
|
+
WRAP_REARG_FLAG = 256,
|
53
|
+
WRAP_FLIP_FLAG = 512;
|
53
54
|
|
54
55
|
/** Used as default options for `_.truncate`. */
|
55
56
|
var DEFAULT_TRUNC_LENGTH = 30,
|
56
|
-
|
57
|
+
DEFAULT_TRUNC_OMISSION = '...';
|
57
58
|
|
58
59
|
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
59
60
|
var HOT_COUNT = 800,
|
60
|
-
|
61
|
+
HOT_SPAN = 16;
|
61
62
|
|
62
63
|
/** Used to indicate the type of lazy iteratees. */
|
63
64
|
var LAZY_FILTER_FLAG = 1,
|
64
|
-
|
65
|
-
|
65
|
+
LAZY_MAP_FLAG = 2,
|
66
|
+
LAZY_WHILE_FLAG = 3;
|
66
67
|
|
67
68
|
/** Used as references for various `Number` constants. */
|
68
69
|
var INFINITY = 1 / 0,
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
MAX_SAFE_INTEGER = 9007199254740991,
|
71
|
+
MAX_INTEGER = 1.7976931348623157e+308,
|
72
|
+
NAN = 0 / 0;
|
72
73
|
|
73
74
|
/** Used as references for the maximum length and index of an array. */
|
74
75
|
var MAX_ARRAY_LENGTH = 4294967295,
|
75
|
-
|
76
|
-
|
76
|
+
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
|
77
|
+
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
77
78
|
|
78
79
|
/** Used to associate wrap methods with their bit flags. */
|
79
80
|
var wrapFlags = [
|
@@ -90,81 +91,94 @@
|
|
90
91
|
|
91
92
|
/** `Object#toString` result references. */
|
92
93
|
var argsTag = '[object Arguments]',
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
94
|
+
arrayTag = '[object Array]',
|
95
|
+
asyncTag = '[object AsyncFunction]',
|
96
|
+
boolTag = '[object Boolean]',
|
97
|
+
dateTag = '[object Date]',
|
98
|
+
domExcTag = '[object DOMException]',
|
99
|
+
errorTag = '[object Error]',
|
100
|
+
funcTag = '[object Function]',
|
101
|
+
genTag = '[object GeneratorFunction]',
|
102
|
+
mapTag = '[object Map]',
|
103
|
+
numberTag = '[object Number]',
|
104
|
+
nullTag = '[object Null]',
|
105
|
+
objectTag = '[object Object]',
|
106
|
+
promiseTag = '[object Promise]',
|
107
|
+
proxyTag = '[object Proxy]',
|
108
|
+
regexpTag = '[object RegExp]',
|
109
|
+
setTag = '[object Set]',
|
110
|
+
stringTag = '[object String]',
|
111
|
+
symbolTag = '[object Symbol]',
|
112
|
+
undefinedTag = '[object Undefined]',
|
113
|
+
weakMapTag = '[object WeakMap]',
|
114
|
+
weakSetTag = '[object WeakSet]';
|
114
115
|
|
115
116
|
var arrayBufferTag = '[object ArrayBuffer]',
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
117
|
+
dataViewTag = '[object DataView]',
|
118
|
+
float32Tag = '[object Float32Array]',
|
119
|
+
float64Tag = '[object Float64Array]',
|
120
|
+
int8Tag = '[object Int8Array]',
|
121
|
+
int16Tag = '[object Int16Array]',
|
122
|
+
int32Tag = '[object Int32Array]',
|
123
|
+
uint8Tag = '[object Uint8Array]',
|
124
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
125
|
+
uint16Tag = '[object Uint16Array]',
|
126
|
+
uint32Tag = '[object Uint32Array]';
|
126
127
|
|
127
128
|
/** Used to match empty string literals in compiled template source. */
|
128
129
|
var reEmptyStringLeading = /\b__p \+= '';/g,
|
129
|
-
|
130
|
-
|
130
|
+
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
131
|
+
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
131
132
|
|
132
133
|
/** Used to match HTML entities and HTML characters. */
|
133
134
|
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
reUnescapedHtml = /[&<>"']/g,
|
136
|
+
reHasEscapedHtml = RegExp(reEscapedHtml.source),
|
137
|
+
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
137
138
|
|
138
139
|
/** Used to match template delimiters. */
|
139
140
|
var reEscape = /<%-([\s\S]+?)%>/g,
|
140
|
-
|
141
|
-
|
141
|
+
reEvaluate = /<%([\s\S]+?)%>/g,
|
142
|
+
reInterpolate = /<%=([\s\S]+?)%>/g;
|
142
143
|
|
143
144
|
/** Used to match property names within property paths. */
|
144
145
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
145
|
-
|
146
|
-
|
146
|
+
reIsPlainProp = /^\w*$/,
|
147
|
+
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
147
148
|
|
148
149
|
/**
|
149
150
|
* Used to match `RegExp`
|
150
151
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
151
152
|
*/
|
152
153
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
153
|
-
|
154
|
+
reHasRegExpChar = RegExp(reRegExpChar.source);
|
154
155
|
|
155
|
-
/** Used to match leading
|
156
|
-
var
|
157
|
-
|
158
|
-
|
156
|
+
/** Used to match leading whitespace. */
|
157
|
+
var reTrimStart = /^\s+/;
|
158
|
+
|
159
|
+
/** Used to match a single whitespace character. */
|
160
|
+
var reWhitespace = /\s/;
|
159
161
|
|
160
162
|
/** Used to match wrap detail comments. */
|
161
163
|
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
|
162
|
-
|
163
|
-
|
164
|
+
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
|
165
|
+
reSplitDetails = /,? & /;
|
164
166
|
|
165
167
|
/** Used to match words composed of alphanumeric characters. */
|
166
168
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
167
169
|
|
170
|
+
/**
|
171
|
+
* Used to validate the `validate` option in `_.template` variable.
|
172
|
+
*
|
173
|
+
* Forbids characters which could potentially change the meaning of the function argument definition:
|
174
|
+
* - "()," (modification of function parameters)
|
175
|
+
* - "=" (default value)
|
176
|
+
* - "[]{}" (destructuring of function parameters)
|
177
|
+
* - "/" (beginning of a comment)
|
178
|
+
* - whitespace
|
179
|
+
*/
|
180
|
+
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
181
|
+
|
168
182
|
/** Used to match backslashes in property paths. */
|
169
183
|
var reEscapeChar = /\\(\\)?/g;
|
170
184
|
|
@@ -203,50 +217,50 @@
|
|
203
217
|
|
204
218
|
/** Used to compose unicode character classes. */
|
205
219
|
var rsAstralRange = '\\ud800-\\udfff',
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
220
|
+
rsComboMarksRange = '\\u0300-\\u036f',
|
221
|
+
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
222
|
+
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
223
|
+
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
224
|
+
rsDingbatRange = '\\u2700-\\u27bf',
|
225
|
+
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
226
|
+
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
227
|
+
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
228
|
+
rsPunctuationRange = '\\u2000-\\u206f',
|
229
|
+
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
230
|
+
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
231
|
+
rsVarRange = '\\ufe0e\\ufe0f',
|
232
|
+
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
219
233
|
|
220
234
|
/** Used to compose unicode capture groups. */
|
221
235
|
var rsApos = "['\u2019]",
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
+
rsAstral = '[' + rsAstralRange + ']',
|
237
|
+
rsBreak = '[' + rsBreakRange + ']',
|
238
|
+
rsCombo = '[' + rsComboRange + ']',
|
239
|
+
rsDigits = '\\d+',
|
240
|
+
rsDingbat = '[' + rsDingbatRange + ']',
|
241
|
+
rsLower = '[' + rsLowerRange + ']',
|
242
|
+
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
243
|
+
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
244
|
+
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
245
|
+
rsNonAstral = '[^' + rsAstralRange + ']',
|
246
|
+
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
247
|
+
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
248
|
+
rsUpper = '[' + rsUpperRange + ']',
|
249
|
+
rsZWJ = '\\u200d';
|
236
250
|
|
237
251
|
/** Used to compose unicode regexes. */
|
238
252
|
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
253
|
+
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
254
|
+
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
|
255
|
+
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
|
256
|
+
reOptMod = rsModifier + '?',
|
257
|
+
rsOptVar = '[' + rsVarRange + ']?',
|
258
|
+
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
259
|
+
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
260
|
+
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
261
|
+
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
262
|
+
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
|
263
|
+
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
250
264
|
|
251
265
|
/** Used to match apostrophes. */
|
252
266
|
var reApos = RegExp(rsApos, 'g');
|
@@ -293,34 +307,34 @@
|
|
293
307
|
/** Used to identify `toStringTag` values of typed arrays. */
|
294
308
|
var typedArrayTags = {};
|
295
309
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
310
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
311
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
312
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
313
|
+
typedArrayTags[uint32Tag] = true;
|
300
314
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
315
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
316
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
317
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
318
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
319
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
320
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
321
|
+
typedArrayTags[weakMapTag] = false;
|
308
322
|
|
309
323
|
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
310
324
|
var cloneableTags = {};
|
311
325
|
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
326
|
+
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
327
|
+
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
328
|
+
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
329
|
+
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
330
|
+
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
331
|
+
cloneableTags[numberTag] = cloneableTags[objectTag] =
|
332
|
+
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
333
|
+
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
334
|
+
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
335
|
+
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
322
336
|
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
323
|
-
|
337
|
+
cloneableTags[weakMapTag] = false;
|
324
338
|
|
325
339
|
/** Used to map Latin Unicode letters to basic Latin letters. */
|
326
340
|
var deburredLetters = {
|
@@ -410,7 +424,7 @@
|
|
410
424
|
|
411
425
|
/** Built-in method references without a dependency on `root`. */
|
412
426
|
var freeParseFloat = parseFloat,
|
413
|
-
|
427
|
+
freeParseInt = parseInt;
|
414
428
|
|
415
429
|
/** Detect free variable `global` from Node.js. */
|
416
430
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
@@ -450,11 +464,11 @@
|
|
450
464
|
|
451
465
|
/* Node.js helper references. */
|
452
466
|
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
467
|
+
nodeIsDate = nodeUtil && nodeUtil.isDate,
|
468
|
+
nodeIsMap = nodeUtil && nodeUtil.isMap,
|
469
|
+
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
|
470
|
+
nodeIsSet = nodeUtil && nodeUtil.isSet,
|
471
|
+
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
458
472
|
|
459
473
|
/*--------------------------------------------------------------------------*/
|
460
474
|
|
@@ -490,7 +504,7 @@
|
|
490
504
|
*/
|
491
505
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
492
506
|
var index = -1,
|
493
|
-
|
507
|
+
length = array == null ? 0 : array.length;
|
494
508
|
|
495
509
|
while (++index < length) {
|
496
510
|
var value = array[index];
|
@@ -510,7 +524,7 @@
|
|
510
524
|
*/
|
511
525
|
function arrayEach(array, iteratee) {
|
512
526
|
var index = -1,
|
513
|
-
|
527
|
+
length = array == null ? 0 : array.length;
|
514
528
|
|
515
529
|
while (++index < length) {
|
516
530
|
if (iteratee(array[index], index, array) === false) {
|
@@ -552,7 +566,7 @@
|
|
552
566
|
*/
|
553
567
|
function arrayEvery(array, predicate) {
|
554
568
|
var index = -1,
|
555
|
-
|
569
|
+
length = array == null ? 0 : array.length;
|
556
570
|
|
557
571
|
while (++index < length) {
|
558
572
|
if (!predicate(array[index], index, array)) {
|
@@ -573,9 +587,9 @@
|
|
573
587
|
*/
|
574
588
|
function arrayFilter(array, predicate) {
|
575
589
|
var index = -1,
|
576
|
-
|
577
|
-
|
578
|
-
|
590
|
+
length = array == null ? 0 : array.length,
|
591
|
+
resIndex = 0,
|
592
|
+
result = [];
|
579
593
|
|
580
594
|
while (++index < length) {
|
581
595
|
var value = array[index];
|
@@ -611,7 +625,7 @@
|
|
611
625
|
*/
|
612
626
|
function arrayIncludesWith(array, value, comparator) {
|
613
627
|
var index = -1,
|
614
|
-
|
628
|
+
length = array == null ? 0 : array.length;
|
615
629
|
|
616
630
|
while (++index < length) {
|
617
631
|
if (comparator(value, array[index])) {
|
@@ -632,8 +646,8 @@
|
|
632
646
|
*/
|
633
647
|
function arrayMap(array, iteratee) {
|
634
648
|
var index = -1,
|
635
|
-
|
636
|
-
|
649
|
+
length = array == null ? 0 : array.length,
|
650
|
+
result = Array(length);
|
637
651
|
|
638
652
|
while (++index < length) {
|
639
653
|
result[index] = iteratee(array[index], index, array);
|
@@ -651,8 +665,8 @@
|
|
651
665
|
*/
|
652
666
|
function arrayPush(array, values) {
|
653
667
|
var index = -1,
|
654
|
-
|
655
|
-
|
668
|
+
length = values.length,
|
669
|
+
offset = array.length;
|
656
670
|
|
657
671
|
while (++index < length) {
|
658
672
|
array[offset + index] = values[index];
|
@@ -674,7 +688,7 @@
|
|
674
688
|
*/
|
675
689
|
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
676
690
|
var index = -1,
|
677
|
-
|
691
|
+
length = array == null ? 0 : array.length;
|
678
692
|
|
679
693
|
if (initAccum && length) {
|
680
694
|
accumulator = array[++index];
|
@@ -720,7 +734,7 @@
|
|
720
734
|
*/
|
721
735
|
function arraySome(array, predicate) {
|
722
736
|
var index = -1,
|
723
|
-
|
737
|
+
length = array == null ? 0 : array.length;
|
724
738
|
|
725
739
|
while (++index < length) {
|
726
740
|
if (predicate(array[index], index, array)) {
|
@@ -796,7 +810,7 @@
|
|
796
810
|
*/
|
797
811
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
798
812
|
var length = array.length,
|
799
|
-
|
813
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
800
814
|
|
801
815
|
while ((fromRight ? index-- : ++index < length)) {
|
802
816
|
if (predicate(array[index], index, array)) {
|
@@ -833,7 +847,7 @@
|
|
833
847
|
*/
|
834
848
|
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
835
849
|
var index = fromIndex - 1,
|
836
|
-
|
850
|
+
length = array.length;
|
837
851
|
|
838
852
|
while (++index < length) {
|
839
853
|
if (comparator(array[index], value)) {
|
@@ -947,8 +961,8 @@
|
|
947
961
|
*/
|
948
962
|
function baseSum(array, iteratee) {
|
949
963
|
var result,
|
950
|
-
|
951
|
-
|
964
|
+
index = -1,
|
965
|
+
length = array.length;
|
952
966
|
|
953
967
|
while (++index < length) {
|
954
968
|
var current = iteratee(array[index]);
|
@@ -970,7 +984,7 @@
|
|
970
984
|
*/
|
971
985
|
function baseTimes(n, iteratee) {
|
972
986
|
var index = -1,
|
973
|
-
|
987
|
+
result = Array(n);
|
974
988
|
|
975
989
|
while (++index < n) {
|
976
990
|
result[index] = iteratee(index);
|
@@ -993,6 +1007,19 @@
|
|
993
1007
|
});
|
994
1008
|
}
|
995
1009
|
|
1010
|
+
/**
|
1011
|
+
* The base implementation of `_.trim`.
|
1012
|
+
*
|
1013
|
+
* @private
|
1014
|
+
* @param {string} string The string to trim.
|
1015
|
+
* @returns {string} Returns the trimmed string.
|
1016
|
+
*/
|
1017
|
+
function baseTrim(string) {
|
1018
|
+
return string
|
1019
|
+
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
1020
|
+
: string;
|
1021
|
+
}
|
1022
|
+
|
996
1023
|
/**
|
997
1024
|
* The base implementation of `_.unary` without support for storing metadata.
|
998
1025
|
*
|
@@ -1045,7 +1072,7 @@
|
|
1045
1072
|
*/
|
1046
1073
|
function charsStartIndex(strSymbols, chrSymbols) {
|
1047
1074
|
var index = -1,
|
1048
|
-
|
1075
|
+
length = strSymbols.length;
|
1049
1076
|
|
1050
1077
|
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
1051
1078
|
return index;
|
@@ -1077,7 +1104,7 @@
|
|
1077
1104
|
*/
|
1078
1105
|
function countHolders(array, placeholder) {
|
1079
1106
|
var length = array.length,
|
1080
|
-
|
1107
|
+
result = 0;
|
1081
1108
|
|
1082
1109
|
while (length--) {
|
1083
1110
|
if (array[length] === placeholder) {
|
@@ -1160,7 +1187,7 @@
|
|
1160
1187
|
*/
|
1161
1188
|
function iteratorToArray(iterator) {
|
1162
1189
|
var data,
|
1163
|
-
|
1190
|
+
result = [];
|
1164
1191
|
|
1165
1192
|
while (!(data = iterator.next()).done) {
|
1166
1193
|
result.push(data.value);
|
@@ -1177,7 +1204,7 @@
|
|
1177
1204
|
*/
|
1178
1205
|
function mapToArray(map) {
|
1179
1206
|
var index = -1,
|
1180
|
-
|
1207
|
+
result = Array(map.size);
|
1181
1208
|
|
1182
1209
|
map.forEach(function(value, key) {
|
1183
1210
|
result[++index] = [key, value];
|
@@ -1210,9 +1237,9 @@
|
|
1210
1237
|
*/
|
1211
1238
|
function replaceHolders(array, placeholder) {
|
1212
1239
|
var index = -1,
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1240
|
+
length = array.length,
|
1241
|
+
resIndex = 0,
|
1242
|
+
result = [];
|
1216
1243
|
|
1217
1244
|
while (++index < length) {
|
1218
1245
|
var value = array[index];
|
@@ -1233,7 +1260,7 @@
|
|
1233
1260
|
*/
|
1234
1261
|
function setToArray(set) {
|
1235
1262
|
var index = -1,
|
1236
|
-
|
1263
|
+
result = Array(set.size);
|
1237
1264
|
|
1238
1265
|
set.forEach(function(value) {
|
1239
1266
|
result[++index] = value;
|
@@ -1250,7 +1277,7 @@
|
|
1250
1277
|
*/
|
1251
1278
|
function setToPairs(set) {
|
1252
1279
|
var index = -1,
|
1253
|
-
|
1280
|
+
result = Array(set.size);
|
1254
1281
|
|
1255
1282
|
set.forEach(function(value) {
|
1256
1283
|
result[++index] = [value, value];
|
@@ -1270,7 +1297,7 @@
|
|
1270
1297
|
*/
|
1271
1298
|
function strictIndexOf(array, value, fromIndex) {
|
1272
1299
|
var index = fromIndex - 1,
|
1273
|
-
|
1300
|
+
length = array.length;
|
1274
1301
|
|
1275
1302
|
while (++index < length) {
|
1276
1303
|
if (array[index] === value) {
|
@@ -1326,6 +1353,21 @@
|
|
1326
1353
|
: asciiToArray(string);
|
1327
1354
|
}
|
1328
1355
|
|
1356
|
+
/**
|
1357
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
1358
|
+
* character of `string`.
|
1359
|
+
*
|
1360
|
+
* @private
|
1361
|
+
* @param {string} string The string to inspect.
|
1362
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
1363
|
+
*/
|
1364
|
+
function trimmedEndIndex(string) {
|
1365
|
+
var index = string.length;
|
1366
|
+
|
1367
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
1368
|
+
return index;
|
1369
|
+
}
|
1370
|
+
|
1329
1371
|
/**
|
1330
1372
|
* Used by `_.unescape` to convert HTML entities to characters.
|
1331
1373
|
*
|
@@ -1408,19 +1450,19 @@
|
|
1408
1450
|
|
1409
1451
|
/** Built-in constructor references. */
|
1410
1452
|
var Array = context.Array,
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1453
|
+
Date = context.Date,
|
1454
|
+
Error = context.Error,
|
1455
|
+
Function = context.Function,
|
1456
|
+
Math = context.Math,
|
1457
|
+
Object = context.Object,
|
1458
|
+
RegExp = context.RegExp,
|
1459
|
+
String = context.String,
|
1460
|
+
TypeError = context.TypeError;
|
1419
1461
|
|
1420
1462
|
/** Used for built-in method references. */
|
1421
1463
|
var arrayProto = Array.prototype,
|
1422
|
-
|
1423
|
-
|
1464
|
+
funcProto = Function.prototype,
|
1465
|
+
objectProto = Object.prototype;
|
1424
1466
|
|
1425
1467
|
/** Used to detect overreaching core-js shims. */
|
1426
1468
|
var coreJsData = context['__core-js_shared__'];
|
@@ -1456,21 +1498,21 @@
|
|
1456
1498
|
/** Used to detect if a method is native. */
|
1457
1499
|
var reIsNative = RegExp('^' +
|
1458
1500
|
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
1459
|
-
|
1501
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
1460
1502
|
);
|
1461
1503
|
|
1462
1504
|
/** Built-in value references. */
|
1463
1505
|
var Buffer = moduleExports ? context.Buffer : undefined,
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1506
|
+
Symbol = context.Symbol,
|
1507
|
+
Uint8Array = context.Uint8Array,
|
1508
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
1509
|
+
getPrototype = overArg(Object.getPrototypeOf, Object),
|
1510
|
+
objectCreate = Object.create,
|
1511
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
1512
|
+
splice = arrayProto.splice,
|
1513
|
+
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
|
1514
|
+
symIterator = Symbol ? Symbol.iterator : undefined,
|
1515
|
+
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
1474
1516
|
|
1475
1517
|
var defineProperty = (function() {
|
1476
1518
|
try {
|
@@ -1482,31 +1524,31 @@
|
|
1482
1524
|
|
1483
1525
|
/** Mocked built-ins. */
|
1484
1526
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
1485
|
-
|
1486
|
-
|
1527
|
+
ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
1528
|
+
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
1487
1529
|
|
1488
1530
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
1489
1531
|
var nativeCeil = Math.ceil,
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1532
|
+
nativeFloor = Math.floor,
|
1533
|
+
nativeGetSymbols = Object.getOwnPropertySymbols,
|
1534
|
+
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
1535
|
+
nativeIsFinite = context.isFinite,
|
1536
|
+
nativeJoin = arrayProto.join,
|
1537
|
+
nativeKeys = overArg(Object.keys, Object),
|
1538
|
+
nativeMax = Math.max,
|
1539
|
+
nativeMin = Math.min,
|
1540
|
+
nativeNow = Date.now,
|
1541
|
+
nativeParseInt = context.parseInt,
|
1542
|
+
nativeRandom = Math.random,
|
1543
|
+
nativeReverse = arrayProto.reverse;
|
1502
1544
|
|
1503
1545
|
/* Built-in method references that are verified to be native. */
|
1504
1546
|
var DataView = getNative(context, 'DataView'),
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1547
|
+
Map = getNative(context, 'Map'),
|
1548
|
+
Promise = getNative(context, 'Promise'),
|
1549
|
+
Set = getNative(context, 'Set'),
|
1550
|
+
WeakMap = getNative(context, 'WeakMap'),
|
1551
|
+
nativeCreate = getNative(Object, 'create');
|
1510
1552
|
|
1511
1553
|
/** Used to store function metadata. */
|
1512
1554
|
var metaMap = WeakMap && new WeakMap;
|
@@ -1516,15 +1558,15 @@
|
|
1516
1558
|
|
1517
1559
|
/** Used to detect maps, sets, and weakmaps. */
|
1518
1560
|
var dataViewCtorString = toSource(DataView),
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1561
|
+
mapCtorString = toSource(Map),
|
1562
|
+
promiseCtorString = toSource(Promise),
|
1563
|
+
setCtorString = toSource(Set),
|
1564
|
+
weakMapCtorString = toSource(WeakMap);
|
1523
1565
|
|
1524
1566
|
/** Used to convert symbols to primitives and strings. */
|
1525
1567
|
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
1526
|
-
|
1527
|
-
|
1568
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
|
1569
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
1528
1570
|
|
1529
1571
|
/*------------------------------------------------------------------------*/
|
1530
1572
|
|
@@ -1841,19 +1883,19 @@
|
|
1841
1883
|
*/
|
1842
1884
|
function lazyValue() {
|
1843
1885
|
var array = this.__wrapped__.value(),
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1886
|
+
dir = this.__dir__,
|
1887
|
+
isArr = isArray(array),
|
1888
|
+
isRight = dir < 0,
|
1889
|
+
arrLength = isArr ? array.length : 0,
|
1890
|
+
view = getView(0, arrLength, this.__views__),
|
1891
|
+
start = view.start,
|
1892
|
+
end = view.end,
|
1893
|
+
length = end - start,
|
1894
|
+
index = isRight ? end : (start - 1),
|
1895
|
+
iteratees = this.__iteratees__,
|
1896
|
+
iterLength = iteratees.length,
|
1897
|
+
resIndex = 0,
|
1898
|
+
takeCount = nativeMin(length, this.__takeCount__);
|
1857
1899
|
|
1858
1900
|
if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
|
1859
1901
|
return baseWrapperValue(array, this.__actions__);
|
@@ -1861,30 +1903,30 @@
|
|
1861
1903
|
var result = [];
|
1862
1904
|
|
1863
1905
|
outer:
|
1864
|
-
|
1865
|
-
|
1906
|
+
while (length-- && resIndex < takeCount) {
|
1907
|
+
index += dir;
|
1866
1908
|
|
1867
|
-
|
1909
|
+
var iterIndex = -1,
|
1868
1910
|
value = array[index];
|
1869
1911
|
|
1870
|
-
|
1871
|
-
|
1912
|
+
while (++iterIndex < iterLength) {
|
1913
|
+
var data = iteratees[iterIndex],
|
1872
1914
|
iteratee = data.iteratee,
|
1873
1915
|
type = data.type,
|
1874
1916
|
computed = iteratee(value);
|
1875
1917
|
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1918
|
+
if (type == LAZY_MAP_FLAG) {
|
1919
|
+
value = computed;
|
1920
|
+
} else if (!computed) {
|
1921
|
+
if (type == LAZY_FILTER_FLAG) {
|
1922
|
+
continue outer;
|
1923
|
+
} else {
|
1924
|
+
break outer;
|
1925
|
+
}
|
1883
1926
|
}
|
1884
1927
|
}
|
1928
|
+
result[resIndex++] = value;
|
1885
1929
|
}
|
1886
|
-
result[resIndex++] = value;
|
1887
|
-
}
|
1888
1930
|
return result;
|
1889
1931
|
}
|
1890
1932
|
|
@@ -1903,7 +1945,7 @@
|
|
1903
1945
|
*/
|
1904
1946
|
function Hash(entries) {
|
1905
1947
|
var index = -1,
|
1906
|
-
|
1948
|
+
length = entries == null ? 0 : entries.length;
|
1907
1949
|
|
1908
1950
|
this.clear();
|
1909
1951
|
while (++index < length) {
|
@@ -2007,7 +2049,7 @@
|
|
2007
2049
|
*/
|
2008
2050
|
function ListCache(entries) {
|
2009
2051
|
var index = -1,
|
2010
|
-
|
2052
|
+
length = entries == null ? 0 : entries.length;
|
2011
2053
|
|
2012
2054
|
this.clear();
|
2013
2055
|
while (++index < length) {
|
@@ -2039,7 +2081,7 @@
|
|
2039
2081
|
*/
|
2040
2082
|
function listCacheDelete(key) {
|
2041
2083
|
var data = this.__data__,
|
2042
|
-
|
2084
|
+
index = assocIndexOf(data, key);
|
2043
2085
|
|
2044
2086
|
if (index < 0) {
|
2045
2087
|
return false;
|
@@ -2065,7 +2107,7 @@
|
|
2065
2107
|
*/
|
2066
2108
|
function listCacheGet(key) {
|
2067
2109
|
var data = this.__data__,
|
2068
|
-
|
2110
|
+
index = assocIndexOf(data, key);
|
2069
2111
|
|
2070
2112
|
return index < 0 ? undefined : data[index][1];
|
2071
2113
|
}
|
@@ -2095,7 +2137,7 @@
|
|
2095
2137
|
*/
|
2096
2138
|
function listCacheSet(key, value) {
|
2097
2139
|
var data = this.__data__,
|
2098
|
-
|
2140
|
+
index = assocIndexOf(data, key);
|
2099
2141
|
|
2100
2142
|
if (index < 0) {
|
2101
2143
|
++this.size;
|
@@ -2124,7 +2166,7 @@
|
|
2124
2166
|
*/
|
2125
2167
|
function MapCache(entries) {
|
2126
2168
|
var index = -1,
|
2127
|
-
|
2169
|
+
length = entries == null ? 0 : entries.length;
|
2128
2170
|
|
2129
2171
|
this.clear();
|
2130
2172
|
while (++index < length) {
|
@@ -2202,7 +2244,7 @@
|
|
2202
2244
|
*/
|
2203
2245
|
function mapCacheSet(key, value) {
|
2204
2246
|
var data = getMapData(this, key),
|
2205
|
-
|
2247
|
+
size = data.size;
|
2206
2248
|
|
2207
2249
|
data.set(key, value);
|
2208
2250
|
this.size += data.size == size ? 0 : 1;
|
@@ -2228,7 +2270,7 @@
|
|
2228
2270
|
*/
|
2229
2271
|
function SetCache(values) {
|
2230
2272
|
var index = -1,
|
2231
|
-
|
2273
|
+
length = values == null ? 0 : values.length;
|
2232
2274
|
|
2233
2275
|
this.__data__ = new MapCache;
|
2234
2276
|
while (++index < length) {
|
@@ -2305,7 +2347,7 @@
|
|
2305
2347
|
*/
|
2306
2348
|
function stackDelete(key) {
|
2307
2349
|
var data = this.__data__,
|
2308
|
-
|
2350
|
+
result = data['delete'](key);
|
2309
2351
|
|
2310
2352
|
this.size = data.size;
|
2311
2353
|
return result;
|
@@ -2382,25 +2424,25 @@
|
|
2382
2424
|
*/
|
2383
2425
|
function arrayLikeKeys(value, inherited) {
|
2384
2426
|
var isArr = isArray(value),
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2427
|
+
isArg = !isArr && isArguments(value),
|
2428
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
2429
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
2430
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
2431
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
2432
|
+
length = result.length;
|
2391
2433
|
|
2392
2434
|
for (var key in value) {
|
2393
2435
|
if ((inherited || hasOwnProperty.call(value, key)) &&
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2436
|
+
!(skipIndexes && (
|
2437
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
2438
|
+
key == 'length' ||
|
2439
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
2440
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
2441
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
2442
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
2443
|
+
// Skip index properties.
|
2444
|
+
isIndex(key, length)
|
2445
|
+
))) {
|
2404
2446
|
result.push(key);
|
2405
2447
|
}
|
2406
2448
|
}
|
@@ -2453,7 +2495,7 @@
|
|
2453
2495
|
*/
|
2454
2496
|
function assignMergeValue(object, key, value) {
|
2455
2497
|
if ((value !== undefined && !eq(object[key], value)) ||
|
2456
|
-
|
2498
|
+
(value === undefined && !(key in object))) {
|
2457
2499
|
baseAssignValue(object, key, value);
|
2458
2500
|
}
|
2459
2501
|
}
|
@@ -2471,7 +2513,7 @@
|
|
2471
2513
|
function assignValue(object, key, value) {
|
2472
2514
|
var objValue = object[key];
|
2473
2515
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
2474
|
-
|
2516
|
+
(value === undefined && !(key in object))) {
|
2475
2517
|
baseAssignValue(object, key, value);
|
2476
2518
|
}
|
2477
2519
|
}
|
@@ -2570,9 +2612,9 @@
|
|
2570
2612
|
*/
|
2571
2613
|
function baseAt(object, paths) {
|
2572
2614
|
var index = -1,
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2615
|
+
length = paths.length,
|
2616
|
+
result = Array(length),
|
2617
|
+
skip = object == null;
|
2576
2618
|
|
2577
2619
|
while (++index < length) {
|
2578
2620
|
result[index] = skip ? undefined : get(object, paths[index]);
|
@@ -2619,9 +2661,9 @@
|
|
2619
2661
|
*/
|
2620
2662
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
2621
2663
|
var result,
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2664
|
+
isDeep = bitmask & CLONE_DEEP_FLAG,
|
2665
|
+
isFlat = bitmask & CLONE_FLAT_FLAG,
|
2666
|
+
isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
2625
2667
|
|
2626
2668
|
if (customizer) {
|
2627
2669
|
result = object ? customizer(value, key, object, stack) : customizer(value);
|
@@ -2640,7 +2682,7 @@
|
|
2640
2682
|
}
|
2641
2683
|
} else {
|
2642
2684
|
var tag = getTag(value),
|
2643
|
-
|
2685
|
+
isFunc = tag == funcTag || tag == genTag;
|
2644
2686
|
|
2645
2687
|
if (isBuffer(value)) {
|
2646
2688
|
return cloneBuffer(value, isDeep);
|
@@ -2723,8 +2765,8 @@
|
|
2723
2765
|
object = Object(object);
|
2724
2766
|
while (length--) {
|
2725
2767
|
var key = props[length],
|
2726
|
-
|
2727
|
-
|
2768
|
+
predicate = source[key],
|
2769
|
+
value = object[key];
|
2728
2770
|
|
2729
2771
|
if ((value === undefined && !(key in object)) || !predicate(value)) {
|
2730
2772
|
return false;
|
@@ -2763,11 +2805,11 @@
|
|
2763
2805
|
*/
|
2764
2806
|
function baseDifference(array, values, iteratee, comparator) {
|
2765
2807
|
var index = -1,
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2808
|
+
includes = arrayIncludes,
|
2809
|
+
isCommon = true,
|
2810
|
+
length = array.length,
|
2811
|
+
result = [],
|
2812
|
+
valuesLength = values.length;
|
2771
2813
|
|
2772
2814
|
if (!length) {
|
2773
2815
|
return result;
|
@@ -2785,24 +2827,24 @@
|
|
2785
2827
|
values = new SetCache(values);
|
2786
2828
|
}
|
2787
2829
|
outer:
|
2788
|
-
|
2789
|
-
|
2830
|
+
while (++index < length) {
|
2831
|
+
var value = array[index],
|
2790
2832
|
computed = iteratee == null ? value : iteratee(value);
|
2791
2833
|
|
2792
|
-
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2834
|
+
value = (comparator || value !== 0) ? value : 0;
|
2835
|
+
if (isCommon && computed === computed) {
|
2836
|
+
var valuesIndex = valuesLength;
|
2837
|
+
while (valuesIndex--) {
|
2838
|
+
if (values[valuesIndex] === computed) {
|
2839
|
+
continue outer;
|
2840
|
+
}
|
2798
2841
|
}
|
2842
|
+
result.push(value);
|
2843
|
+
}
|
2844
|
+
else if (!includes(values, computed, comparator)) {
|
2845
|
+
result.push(value);
|
2799
2846
|
}
|
2800
|
-
result.push(value);
|
2801
|
-
}
|
2802
|
-
else if (!includes(values, computed, comparator)) {
|
2803
|
-
result.push(value);
|
2804
2847
|
}
|
2805
|
-
}
|
2806
2848
|
return result;
|
2807
2849
|
}
|
2808
2850
|
|
@@ -2856,18 +2898,18 @@
|
|
2856
2898
|
*/
|
2857
2899
|
function baseExtremum(array, iteratee, comparator) {
|
2858
2900
|
var index = -1,
|
2859
|
-
|
2901
|
+
length = array.length;
|
2860
2902
|
|
2861
2903
|
while (++index < length) {
|
2862
2904
|
var value = array[index],
|
2863
|
-
|
2905
|
+
current = iteratee(value);
|
2864
2906
|
|
2865
2907
|
if (current != null && (computed === undefined
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2908
|
+
? (current === current && !isSymbol(current))
|
2909
|
+
: comparator(current, computed)
|
2910
|
+
)) {
|
2869
2911
|
var computed = current,
|
2870
|
-
|
2912
|
+
result = value;
|
2871
2913
|
}
|
2872
2914
|
}
|
2873
2915
|
return result;
|
@@ -2932,7 +2974,7 @@
|
|
2932
2974
|
*/
|
2933
2975
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
2934
2976
|
var index = -1,
|
2935
|
-
|
2977
|
+
length = array.length;
|
2936
2978
|
|
2937
2979
|
predicate || (predicate = isFlattenable);
|
2938
2980
|
result || (result = []);
|
@@ -3029,7 +3071,7 @@
|
|
3029
3071
|
path = castPath(path, object);
|
3030
3072
|
|
3031
3073
|
var index = 0,
|
3032
|
-
|
3074
|
+
length = path.length;
|
3033
3075
|
|
3034
3076
|
while (object != null && index < length) {
|
3035
3077
|
object = object[toKey(path[index++])];
|
@@ -3131,12 +3173,12 @@
|
|
3131
3173
|
*/
|
3132
3174
|
function baseIntersection(arrays, iteratee, comparator) {
|
3133
3175
|
var includes = comparator ? arrayIncludesWith : arrayIncludes,
|
3134
|
-
|
3135
|
-
|
3136
|
-
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3176
|
+
length = arrays[0].length,
|
3177
|
+
othLength = arrays.length,
|
3178
|
+
othIndex = othLength,
|
3179
|
+
caches = Array(othLength),
|
3180
|
+
maxLength = Infinity,
|
3181
|
+
result = [];
|
3140
3182
|
|
3141
3183
|
while (othIndex--) {
|
3142
3184
|
var array = arrays[othIndex];
|
@@ -3151,34 +3193,34 @@
|
|
3151
3193
|
array = arrays[0];
|
3152
3194
|
|
3153
3195
|
var index = -1,
|
3154
|
-
|
3196
|
+
seen = caches[0];
|
3155
3197
|
|
3156
3198
|
outer:
|
3157
|
-
|
3158
|
-
|
3199
|
+
while (++index < length && result.length < maxLength) {
|
3200
|
+
var value = array[index],
|
3159
3201
|
computed = iteratee ? iteratee(value) : value;
|
3160
3202
|
|
3161
|
-
|
3162
|
-
|
3203
|
+
value = (comparator || value !== 0) ? value : 0;
|
3204
|
+
if (!(seen
|
3163
3205
|
? cacheHas(seen, computed)
|
3164
3206
|
: includes(result, computed, comparator)
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3207
|
+
)) {
|
3208
|
+
othIndex = othLength;
|
3209
|
+
while (--othIndex) {
|
3210
|
+
var cache = caches[othIndex];
|
3211
|
+
if (!(cache
|
3212
|
+
? cacheHas(cache, computed)
|
3213
|
+
: includes(arrays[othIndex], computed, comparator))
|
3214
|
+
) {
|
3215
|
+
continue outer;
|
3216
|
+
}
|
3174
3217
|
}
|
3218
|
+
if (seen) {
|
3219
|
+
seen.push(computed);
|
3220
|
+
}
|
3221
|
+
result.push(value);
|
3175
3222
|
}
|
3176
|
-
if (seen) {
|
3177
|
-
seen.push(computed);
|
3178
|
-
}
|
3179
|
-
result.push(value);
|
3180
3223
|
}
|
3181
|
-
}
|
3182
3224
|
return result;
|
3183
3225
|
}
|
3184
3226
|
|
@@ -3290,16 +3332,16 @@
|
|
3290
3332
|
*/
|
3291
3333
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
3292
3334
|
var objIsArr = isArray(object),
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3335
|
+
othIsArr = isArray(other),
|
3336
|
+
objTag = objIsArr ? arrayTag : getTag(object),
|
3337
|
+
othTag = othIsArr ? arrayTag : getTag(other);
|
3296
3338
|
|
3297
3339
|
objTag = objTag == argsTag ? objectTag : objTag;
|
3298
3340
|
othTag = othTag == argsTag ? objectTag : othTag;
|
3299
3341
|
|
3300
3342
|
var objIsObj = objTag == objectTag,
|
3301
|
-
|
3302
|
-
|
3343
|
+
othIsObj = othTag == objectTag,
|
3344
|
+
isSameTag = objTag == othTag;
|
3303
3345
|
|
3304
3346
|
if (isSameTag && isBuffer(object)) {
|
3305
3347
|
if (!isBuffer(other)) {
|
@@ -3316,11 +3358,11 @@
|
|
3316
3358
|
}
|
3317
3359
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
3318
3360
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
3319
|
-
|
3361
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
3320
3362
|
|
3321
3363
|
if (objIsWrapped || othIsWrapped) {
|
3322
3364
|
var objUnwrapped = objIsWrapped ? object.value() : object,
|
3323
|
-
|
3365
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
3324
3366
|
|
3325
3367
|
stack || (stack = new Stack);
|
3326
3368
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
@@ -3356,8 +3398,8 @@
|
|
3356
3398
|
*/
|
3357
3399
|
function baseIsMatch(object, source, matchData, customizer) {
|
3358
3400
|
var index = matchData.length,
|
3359
|
-
|
3360
|
-
|
3401
|
+
length = index,
|
3402
|
+
noCustomizer = !customizer;
|
3361
3403
|
|
3362
3404
|
if (object == null) {
|
3363
3405
|
return !length;
|
@@ -3366,17 +3408,17 @@
|
|
3366
3408
|
while (index--) {
|
3367
3409
|
var data = matchData[index];
|
3368
3410
|
if ((noCustomizer && data[2])
|
3369
|
-
|
3370
|
-
|
3371
|
-
|
3411
|
+
? data[1] !== object[data[0]]
|
3412
|
+
: !(data[0] in object)
|
3413
|
+
) {
|
3372
3414
|
return false;
|
3373
3415
|
}
|
3374
3416
|
}
|
3375
3417
|
while (++index < length) {
|
3376
3418
|
data = matchData[index];
|
3377
3419
|
var key = data[0],
|
3378
|
-
|
3379
|
-
|
3420
|
+
objValue = object[key],
|
3421
|
+
srcValue = data[1];
|
3380
3422
|
|
3381
3423
|
if (noCustomizer && data[2]) {
|
3382
3424
|
if (objValue === undefined && !(key in object)) {
|
@@ -3388,9 +3430,9 @@
|
|
3388
3430
|
var result = customizer(objValue, srcValue, key, object, source, stack);
|
3389
3431
|
}
|
3390
3432
|
if (!(result === undefined
|
3391
|
-
|
3392
|
-
|
3393
|
-
|
3433
|
+
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
|
3434
|
+
: result
|
3435
|
+
)) {
|
3394
3436
|
return false;
|
3395
3437
|
}
|
3396
3438
|
}
|
@@ -3504,7 +3546,7 @@
|
|
3504
3546
|
return nativeKeysIn(object);
|
3505
3547
|
}
|
3506
3548
|
var isProto = isPrototype(object),
|
3507
|
-
|
3549
|
+
result = [];
|
3508
3550
|
|
3509
3551
|
for (var key in object) {
|
3510
3552
|
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
@@ -3537,7 +3579,7 @@
|
|
3537
3579
|
*/
|
3538
3580
|
function baseMap(collection, iteratee) {
|
3539
3581
|
var index = -1,
|
3540
|
-
|
3582
|
+
result = isArrayLike(collection) ? Array(collection.length) : [];
|
3541
3583
|
|
3542
3584
|
baseEach(collection, function(value, key, collection) {
|
3543
3585
|
result[++index] = iteratee(value, key, collection);
|
@@ -3632,8 +3674,8 @@
|
|
3632
3674
|
*/
|
3633
3675
|
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
3634
3676
|
var objValue = safeGet(object, key),
|
3635
|
-
|
3636
|
-
|
3677
|
+
srcValue = safeGet(source, key),
|
3678
|
+
stacked = stack.get(srcValue);
|
3637
3679
|
|
3638
3680
|
if (stacked) {
|
3639
3681
|
assignMergeValue(object, key, stacked);
|
@@ -3647,8 +3689,8 @@
|
|
3647
3689
|
|
3648
3690
|
if (isCommon) {
|
3649
3691
|
var isArr = isArray(srcValue),
|
3650
|
-
|
3651
|
-
|
3692
|
+
isBuff = !isArr && isBuffer(srcValue),
|
3693
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
3652
3694
|
|
3653
3695
|
newValue = srcValue;
|
3654
3696
|
if (isArr || isBuff || isTyped) {
|
@@ -3719,8 +3761,21 @@
|
|
3719
3761
|
* @returns {Array} Returns the new sorted array.
|
3720
3762
|
*/
|
3721
3763
|
function baseOrderBy(collection, iteratees, orders) {
|
3764
|
+
if (iteratees.length) {
|
3765
|
+
iteratees = arrayMap(iteratees, function(iteratee) {
|
3766
|
+
if (isArray(iteratee)) {
|
3767
|
+
return function(value) {
|
3768
|
+
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
3769
|
+
}
|
3770
|
+
}
|
3771
|
+
return iteratee;
|
3772
|
+
});
|
3773
|
+
} else {
|
3774
|
+
iteratees = [identity];
|
3775
|
+
}
|
3776
|
+
|
3722
3777
|
var index = -1;
|
3723
|
-
iteratees = arrayMap(iteratees
|
3778
|
+
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
3724
3779
|
|
3725
3780
|
var result = baseMap(collection, function(value, key, collection) {
|
3726
3781
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
@@ -3760,12 +3815,12 @@
|
|
3760
3815
|
*/
|
3761
3816
|
function basePickBy(object, paths, predicate) {
|
3762
3817
|
var index = -1,
|
3763
|
-
|
3764
|
-
|
3818
|
+
length = paths.length,
|
3819
|
+
result = {};
|
3765
3820
|
|
3766
3821
|
while (++index < length) {
|
3767
3822
|
var path = paths[index],
|
3768
|
-
|
3823
|
+
value = baseGet(object, path);
|
3769
3824
|
|
3770
3825
|
if (predicate(value, path)) {
|
3771
3826
|
baseSet(result, castPath(path, object), value);
|
@@ -3800,9 +3855,9 @@
|
|
3800
3855
|
*/
|
3801
3856
|
function basePullAll(array, values, iteratee, comparator) {
|
3802
3857
|
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
|
3803
|
-
|
3804
|
-
|
3805
|
-
|
3858
|
+
index = -1,
|
3859
|
+
length = values.length,
|
3860
|
+
seen = array;
|
3806
3861
|
|
3807
3862
|
if (array === values) {
|
3808
3863
|
values = copyArray(values);
|
@@ -3812,8 +3867,8 @@
|
|
3812
3867
|
}
|
3813
3868
|
while (++index < length) {
|
3814
3869
|
var fromIndex = 0,
|
3815
|
-
|
3816
|
-
|
3870
|
+
value = values[index],
|
3871
|
+
computed = iteratee ? iteratee(value) : value;
|
3817
3872
|
|
3818
3873
|
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
|
3819
3874
|
if (seen !== array) {
|
@@ -3836,7 +3891,7 @@
|
|
3836
3891
|
*/
|
3837
3892
|
function basePullAt(array, indexes) {
|
3838
3893
|
var length = array ? indexes.length : 0,
|
3839
|
-
|
3894
|
+
lastIndex = length - 1;
|
3840
3895
|
|
3841
3896
|
while (length--) {
|
3842
3897
|
var index = indexes[length];
|
@@ -3878,8 +3933,8 @@
|
|
3878
3933
|
*/
|
3879
3934
|
function baseRange(start, end, step, fromRight) {
|
3880
3935
|
var index = -1,
|
3881
|
-
|
3882
|
-
|
3936
|
+
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
|
3937
|
+
result = Array(length);
|
3883
3938
|
|
3884
3939
|
while (length--) {
|
3885
3940
|
result[fromRight ? length : ++index] = start;
|
@@ -3969,13 +4024,17 @@
|
|
3969
4024
|
path = castPath(path, object);
|
3970
4025
|
|
3971
4026
|
var index = -1,
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
4027
|
+
length = path.length,
|
4028
|
+
lastIndex = length - 1,
|
4029
|
+
nested = object;
|
3975
4030
|
|
3976
4031
|
while (nested != null && ++index < length) {
|
3977
4032
|
var key = toKey(path[index]),
|
3978
|
-
|
4033
|
+
newValue = value;
|
4034
|
+
|
4035
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
4036
|
+
return object;
|
4037
|
+
}
|
3979
4038
|
|
3980
4039
|
if (index != lastIndex) {
|
3981
4040
|
var objValue = nested[key];
|
@@ -4044,7 +4103,7 @@
|
|
4044
4103
|
*/
|
4045
4104
|
function baseSlice(array, start, end) {
|
4046
4105
|
var index = -1,
|
4047
|
-
|
4106
|
+
length = array.length;
|
4048
4107
|
|
4049
4108
|
if (start < 0) {
|
4050
4109
|
start = -start > length ? 0 : (length + start);
|
@@ -4096,15 +4155,15 @@
|
|
4096
4155
|
*/
|
4097
4156
|
function baseSortedIndex(array, value, retHighest) {
|
4098
4157
|
var low = 0,
|
4099
|
-
|
4158
|
+
high = array == null ? low : array.length;
|
4100
4159
|
|
4101
4160
|
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
4102
4161
|
while (low < high) {
|
4103
4162
|
var mid = (low + high) >>> 1,
|
4104
|
-
|
4163
|
+
computed = array[mid];
|
4105
4164
|
|
4106
4165
|
if (computed !== null && !isSymbol(computed) &&
|
4107
|
-
|
4166
|
+
(retHighest ? (computed <= value) : (computed < value))) {
|
4108
4167
|
low = mid + 1;
|
4109
4168
|
} else {
|
4110
4169
|
high = mid;
|
@@ -4129,22 +4188,25 @@
|
|
4129
4188
|
* into `array`.
|
4130
4189
|
*/
|
4131
4190
|
function baseSortedIndexBy(array, value, iteratee, retHighest) {
|
4132
|
-
value = iteratee(value);
|
4133
|
-
|
4134
4191
|
var low = 0,
|
4135
|
-
|
4136
|
-
|
4137
|
-
|
4138
|
-
|
4139
|
-
|
4192
|
+
high = array == null ? 0 : array.length;
|
4193
|
+
if (high === 0) {
|
4194
|
+
return 0;
|
4195
|
+
}
|
4196
|
+
|
4197
|
+
value = iteratee(value);
|
4198
|
+
var valIsNaN = value !== value,
|
4199
|
+
valIsNull = value === null,
|
4200
|
+
valIsSymbol = isSymbol(value),
|
4201
|
+
valIsUndefined = value === undefined;
|
4140
4202
|
|
4141
4203
|
while (low < high) {
|
4142
4204
|
var mid = nativeFloor((low + high) / 2),
|
4143
|
-
|
4144
|
-
|
4145
|
-
|
4146
|
-
|
4147
|
-
|
4205
|
+
computed = iteratee(array[mid]),
|
4206
|
+
othIsDefined = computed !== undefined,
|
4207
|
+
othIsNull = computed === null,
|
4208
|
+
othIsReflexive = computed === computed,
|
4209
|
+
othIsSymbol = isSymbol(computed);
|
4148
4210
|
|
4149
4211
|
if (valIsNaN) {
|
4150
4212
|
var setLow = retHighest || othIsReflexive;
|
@@ -4179,13 +4241,13 @@
|
|
4179
4241
|
*/
|
4180
4242
|
function baseSortedUniq(array, iteratee) {
|
4181
4243
|
var index = -1,
|
4182
|
-
|
4183
|
-
|
4184
|
-
|
4244
|
+
length = array.length,
|
4245
|
+
resIndex = 0,
|
4246
|
+
result = [];
|
4185
4247
|
|
4186
4248
|
while (++index < length) {
|
4187
4249
|
var value = array[index],
|
4188
|
-
|
4250
|
+
computed = iteratee ? iteratee(value) : value;
|
4189
4251
|
|
4190
4252
|
if (!index || !eq(computed, seen)) {
|
4191
4253
|
var seen = computed;
|
@@ -4248,11 +4310,11 @@
|
|
4248
4310
|
*/
|
4249
4311
|
function baseUniq(array, iteratee, comparator) {
|
4250
4312
|
var index = -1,
|
4251
|
-
|
4252
|
-
|
4253
|
-
|
4254
|
-
|
4255
|
-
|
4313
|
+
includes = arrayIncludes,
|
4314
|
+
length = array.length,
|
4315
|
+
isCommon = true,
|
4316
|
+
result = [],
|
4317
|
+
seen = result;
|
4256
4318
|
|
4257
4319
|
if (comparator) {
|
4258
4320
|
isCommon = false;
|
@@ -4271,30 +4333,30 @@
|
|
4271
4333
|
seen = iteratee ? [] : result;
|
4272
4334
|
}
|
4273
4335
|
outer:
|
4274
|
-
|
4275
|
-
|
4336
|
+
while (++index < length) {
|
4337
|
+
var value = array[index],
|
4276
4338
|
computed = iteratee ? iteratee(value) : value;
|
4277
4339
|
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4340
|
+
value = (comparator || value !== 0) ? value : 0;
|
4341
|
+
if (isCommon && computed === computed) {
|
4342
|
+
var seenIndex = seen.length;
|
4343
|
+
while (seenIndex--) {
|
4344
|
+
if (seen[seenIndex] === computed) {
|
4345
|
+
continue outer;
|
4346
|
+
}
|
4284
4347
|
}
|
4348
|
+
if (iteratee) {
|
4349
|
+
seen.push(computed);
|
4350
|
+
}
|
4351
|
+
result.push(value);
|
4285
4352
|
}
|
4286
|
-
if (
|
4287
|
-
seen
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4291
|
-
else if (!includes(seen, computed, comparator)) {
|
4292
|
-
if (seen !== result) {
|
4293
|
-
seen.push(computed);
|
4353
|
+
else if (!includes(seen, computed, comparator)) {
|
4354
|
+
if (seen !== result) {
|
4355
|
+
seen.push(computed);
|
4356
|
+
}
|
4357
|
+
result.push(value);
|
4294
4358
|
}
|
4295
|
-
result.push(value);
|
4296
4359
|
}
|
4297
|
-
}
|
4298
4360
|
return result;
|
4299
4361
|
}
|
4300
4362
|
|
@@ -4339,10 +4401,10 @@
|
|
4339
4401
|
*/
|
4340
4402
|
function baseWhile(array, predicate, isDrop, fromRight) {
|
4341
4403
|
var length = array.length,
|
4342
|
-
|
4404
|
+
index = fromRight ? length : -1;
|
4343
4405
|
|
4344
4406
|
while ((fromRight ? index-- : ++index < length) &&
|
4345
|
-
|
4407
|
+
predicate(array[index], index, array)) {}
|
4346
4408
|
|
4347
4409
|
return isDrop
|
4348
4410
|
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
|
@@ -4385,11 +4447,11 @@
|
|
4385
4447
|
return length ? baseUniq(arrays[0]) : [];
|
4386
4448
|
}
|
4387
4449
|
var index = -1,
|
4388
|
-
|
4450
|
+
result = Array(length);
|
4389
4451
|
|
4390
4452
|
while (++index < length) {
|
4391
4453
|
var array = arrays[index],
|
4392
|
-
|
4454
|
+
othIndex = -1;
|
4393
4455
|
|
4394
4456
|
while (++othIndex < length) {
|
4395
4457
|
if (othIndex != index) {
|
@@ -4411,9 +4473,9 @@
|
|
4411
4473
|
*/
|
4412
4474
|
function baseZipObject(props, values, assignFunc) {
|
4413
4475
|
var index = -1,
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4476
|
+
length = props.length,
|
4477
|
+
valsLength = values.length,
|
4478
|
+
result = {};
|
4417
4479
|
|
4418
4480
|
while (++index < length) {
|
4419
4481
|
var value = index < valsLength ? values[index] : undefined;
|
@@ -4508,7 +4570,7 @@
|
|
4508
4570
|
return buffer.slice();
|
4509
4571
|
}
|
4510
4572
|
var length = buffer.length,
|
4511
|
-
|
4573
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
4512
4574
|
|
4513
4575
|
buffer.copy(result);
|
4514
4576
|
return result;
|
@@ -4588,27 +4650,27 @@
|
|
4588
4650
|
function compareAscending(value, other) {
|
4589
4651
|
if (value !== other) {
|
4590
4652
|
var valIsDefined = value !== undefined,
|
4591
|
-
|
4592
|
-
|
4593
|
-
|
4653
|
+
valIsNull = value === null,
|
4654
|
+
valIsReflexive = value === value,
|
4655
|
+
valIsSymbol = isSymbol(value);
|
4594
4656
|
|
4595
4657
|
var othIsDefined = other !== undefined,
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4658
|
+
othIsNull = other === null,
|
4659
|
+
othIsReflexive = other === other,
|
4660
|
+
othIsSymbol = isSymbol(other);
|
4599
4661
|
|
4600
4662
|
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
4601
|
-
|
4602
|
-
|
4603
|
-
|
4604
|
-
|
4663
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
4664
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
4665
|
+
(!valIsDefined && othIsReflexive) ||
|
4666
|
+
!valIsReflexive) {
|
4605
4667
|
return 1;
|
4606
4668
|
}
|
4607
4669
|
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4611
|
-
|
4670
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
4671
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
4672
|
+
(!othIsDefined && valIsReflexive) ||
|
4673
|
+
!othIsReflexive) {
|
4612
4674
|
return -1;
|
4613
4675
|
}
|
4614
4676
|
}
|
@@ -4631,10 +4693,10 @@
|
|
4631
4693
|
*/
|
4632
4694
|
function compareMultiple(object, other, orders) {
|
4633
4695
|
var index = -1,
|
4634
|
-
|
4635
|
-
|
4636
|
-
|
4637
|
-
|
4696
|
+
objCriteria = object.criteria,
|
4697
|
+
othCriteria = other.criteria,
|
4698
|
+
length = objCriteria.length,
|
4699
|
+
ordersLength = orders.length;
|
4638
4700
|
|
4639
4701
|
while (++index < length) {
|
4640
4702
|
var result = compareAscending(objCriteria[index], othCriteria[index]);
|
@@ -4669,13 +4731,13 @@
|
|
4669
4731
|
*/
|
4670
4732
|
function composeArgs(args, partials, holders, isCurried) {
|
4671
4733
|
var argsIndex = -1,
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4734
|
+
argsLength = args.length,
|
4735
|
+
holdersLength = holders.length,
|
4736
|
+
leftIndex = -1,
|
4737
|
+
leftLength = partials.length,
|
4738
|
+
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
4739
|
+
result = Array(leftLength + rangeLength),
|
4740
|
+
isUncurried = !isCurried;
|
4679
4741
|
|
4680
4742
|
while (++leftIndex < leftLength) {
|
4681
4743
|
result[leftIndex] = partials[leftIndex];
|
@@ -4704,14 +4766,14 @@
|
|
4704
4766
|
*/
|
4705
4767
|
function composeArgsRight(args, partials, holders, isCurried) {
|
4706
4768
|
var argsIndex = -1,
|
4707
|
-
|
4708
|
-
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4769
|
+
argsLength = args.length,
|
4770
|
+
holdersIndex = -1,
|
4771
|
+
holdersLength = holders.length,
|
4772
|
+
rightIndex = -1,
|
4773
|
+
rightLength = partials.length,
|
4774
|
+
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
4775
|
+
result = Array(rangeLength + rightLength),
|
4776
|
+
isUncurried = !isCurried;
|
4715
4777
|
|
4716
4778
|
while (++argsIndex < rangeLength) {
|
4717
4779
|
result[argsIndex] = args[argsIndex];
|
@@ -4738,7 +4800,7 @@
|
|
4738
4800
|
*/
|
4739
4801
|
function copyArray(source, array) {
|
4740
4802
|
var index = -1,
|
4741
|
-
|
4803
|
+
length = source.length;
|
4742
4804
|
|
4743
4805
|
array || (array = Array(length));
|
4744
4806
|
while (++index < length) {
|
@@ -4762,7 +4824,7 @@
|
|
4762
4824
|
object || (object = {});
|
4763
4825
|
|
4764
4826
|
var index = -1,
|
4765
|
-
|
4827
|
+
length = props.length;
|
4766
4828
|
|
4767
4829
|
while (++index < length) {
|
4768
4830
|
var key = props[index];
|
@@ -4818,7 +4880,7 @@
|
|
4818
4880
|
function createAggregator(setter, initializer) {
|
4819
4881
|
return function(collection, iteratee) {
|
4820
4882
|
var func = isArray(collection) ? arrayAggregator : baseAggregator,
|
4821
|
-
|
4883
|
+
accumulator = initializer ? initializer() : {};
|
4822
4884
|
|
4823
4885
|
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
|
4824
4886
|
};
|
@@ -4834,9 +4896,9 @@
|
|
4834
4896
|
function createAssigner(assigner) {
|
4835
4897
|
return baseRest(function(object, sources) {
|
4836
4898
|
var index = -1,
|
4837
|
-
|
4838
|
-
|
4839
|
-
|
4899
|
+
length = sources.length,
|
4900
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
4901
|
+
guard = length > 2 ? sources[2] : undefined;
|
4840
4902
|
|
4841
4903
|
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
4842
4904
|
? (length--, customizer)
|
@@ -4874,8 +4936,8 @@
|
|
4874
4936
|
return eachFunc(collection, iteratee);
|
4875
4937
|
}
|
4876
4938
|
var length = collection.length,
|
4877
|
-
|
4878
|
-
|
4939
|
+
index = fromRight ? length : -1,
|
4940
|
+
iterable = Object(collection);
|
4879
4941
|
|
4880
4942
|
while ((fromRight ? index-- : ++index < length)) {
|
4881
4943
|
if (iteratee(iterable[index], index, iterable) === false) {
|
@@ -4896,9 +4958,9 @@
|
|
4896
4958
|
function createBaseFor(fromRight) {
|
4897
4959
|
return function(object, iteratee, keysFunc) {
|
4898
4960
|
var index = -1,
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4961
|
+
iterable = Object(object),
|
4962
|
+
props = keysFunc(object),
|
4963
|
+
length = props.length;
|
4902
4964
|
|
4903
4965
|
while (length--) {
|
4904
4966
|
var key = props[fromRight ? length : ++index];
|
@@ -4922,7 +4984,7 @@
|
|
4922
4984
|
*/
|
4923
4985
|
function createBind(func, bitmask, thisArg) {
|
4924
4986
|
var isBind = bitmask & WRAP_BIND_FLAG,
|
4925
|
-
|
4987
|
+
Ctor = createCtor(func);
|
4926
4988
|
|
4927
4989
|
function wrapper() {
|
4928
4990
|
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
@@ -4996,7 +5058,7 @@
|
|
4996
5058
|
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
4997
5059
|
}
|
4998
5060
|
var thisBinding = baseCreate(Ctor.prototype),
|
4999
|
-
|
5061
|
+
result = Ctor.apply(thisBinding, args);
|
5000
5062
|
|
5001
5063
|
// Mimic the constructor's `return` behavior.
|
5002
5064
|
// See https://es5.github.io/#x13.2.2 for more details.
|
@@ -5018,9 +5080,9 @@
|
|
5018
5080
|
|
5019
5081
|
function wrapper() {
|
5020
5082
|
var length = arguments.length,
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5083
|
+
args = Array(length),
|
5084
|
+
index = length,
|
5085
|
+
placeholder = getHolder(wrapper);
|
5024
5086
|
|
5025
5087
|
while (index--) {
|
5026
5088
|
args[index] = arguments[index];
|
@@ -5071,8 +5133,8 @@
|
|
5071
5133
|
function createFlow(fromRight) {
|
5072
5134
|
return flatRest(function(funcs) {
|
5073
5135
|
var length = funcs.length,
|
5074
|
-
|
5075
|
-
|
5136
|
+
index = length,
|
5137
|
+
prereq = LodashWrapper.prototype.thru;
|
5076
5138
|
|
5077
5139
|
if (fromRight) {
|
5078
5140
|
funcs.reverse();
|
@@ -5091,12 +5153,12 @@
|
|
5091
5153
|
func = funcs[index];
|
5092
5154
|
|
5093
5155
|
var funcName = getFuncName(func),
|
5094
|
-
|
5156
|
+
data = funcName == 'wrapper' ? getData(func) : undefined;
|
5095
5157
|
|
5096
5158
|
if (data && isLaziable(data[0]) &&
|
5097
|
-
|
5098
|
-
|
5099
|
-
|
5159
|
+
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
|
5160
|
+
!data[4].length && data[9] == 1
|
5161
|
+
) {
|
5100
5162
|
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
5101
5163
|
} else {
|
5102
5164
|
wrapper = (func.length == 1 && isLaziable(func))
|
@@ -5106,13 +5168,13 @@
|
|
5106
5168
|
}
|
5107
5169
|
return function() {
|
5108
5170
|
var args = arguments,
|
5109
|
-
|
5171
|
+
value = args[0];
|
5110
5172
|
|
5111
5173
|
if (wrapper && args.length == 1 && isArray(value)) {
|
5112
5174
|
return wrapper.plant(value).value();
|
5113
5175
|
}
|
5114
5176
|
var index = 0,
|
5115
|
-
|
5177
|
+
result = length ? funcs[index].apply(this, args) : value;
|
5116
5178
|
|
5117
5179
|
while (++index < length) {
|
5118
5180
|
result = funcs[index].call(this, result);
|
@@ -5143,23 +5205,23 @@
|
|
5143
5205
|
*/
|
5144
5206
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
|
5145
5207
|
var isAry = bitmask & WRAP_ARY_FLAG,
|
5146
|
-
|
5147
|
-
|
5148
|
-
|
5149
|
-
|
5150
|
-
|
5208
|
+
isBind = bitmask & WRAP_BIND_FLAG,
|
5209
|
+
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
|
5210
|
+
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
|
5211
|
+
isFlip = bitmask & WRAP_FLIP_FLAG,
|
5212
|
+
Ctor = isBindKey ? undefined : createCtor(func);
|
5151
5213
|
|
5152
5214
|
function wrapper() {
|
5153
5215
|
var length = arguments.length,
|
5154
|
-
|
5155
|
-
|
5216
|
+
args = Array(length),
|
5217
|
+
index = length;
|
5156
5218
|
|
5157
5219
|
while (index--) {
|
5158
5220
|
args[index] = arguments[index];
|
5159
5221
|
}
|
5160
5222
|
if (isCurried) {
|
5161
5223
|
var placeholder = getHolder(wrapper),
|
5162
|
-
|
5224
|
+
holdersCount = countHolders(args, placeholder);
|
5163
5225
|
}
|
5164
5226
|
if (partials) {
|
5165
5227
|
args = composeArgs(args, partials, holders, isCurried);
|
@@ -5176,7 +5238,7 @@
|
|
5176
5238
|
);
|
5177
5239
|
}
|
5178
5240
|
var thisBinding = isBind ? thisArg : this,
|
5179
|
-
|
5241
|
+
fn = isBindKey ? thisBinding[func] : func;
|
5180
5242
|
|
5181
5243
|
length = args.length;
|
5182
5244
|
if (argPos) {
|
@@ -5298,15 +5360,15 @@
|
|
5298
5360
|
*/
|
5299
5361
|
function createPartial(func, bitmask, thisArg, partials) {
|
5300
5362
|
var isBind = bitmask & WRAP_BIND_FLAG,
|
5301
|
-
|
5363
|
+
Ctor = createCtor(func);
|
5302
5364
|
|
5303
5365
|
function wrapper() {
|
5304
5366
|
var argsIndex = -1,
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5367
|
+
argsLength = arguments.length,
|
5368
|
+
leftIndex = -1,
|
5369
|
+
leftLength = partials.length,
|
5370
|
+
args = Array(leftLength + argsLength),
|
5371
|
+
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
5310
5372
|
|
5311
5373
|
while (++leftIndex < leftLength) {
|
5312
5374
|
args[leftIndex] = partials[leftIndex];
|
@@ -5380,10 +5442,10 @@
|
|
5380
5442
|
*/
|
5381
5443
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
5382
5444
|
var isCurry = bitmask & WRAP_CURRY_FLAG,
|
5383
|
-
|
5384
|
-
|
5385
|
-
|
5386
|
-
|
5445
|
+
newHolders = isCurry ? holders : undefined,
|
5446
|
+
newHoldersRight = isCurry ? undefined : holders,
|
5447
|
+
newPartials = isCurry ? partials : undefined,
|
5448
|
+
newPartialsRight = isCurry ? undefined : partials;
|
5387
5449
|
|
5388
5450
|
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
|
5389
5451
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
@@ -5420,7 +5482,7 @@
|
|
5420
5482
|
// Shift with exponential notation to avoid floating-point issues.
|
5421
5483
|
// See [MDN](https://mdn.io/round#Examples) for more details.
|
5422
5484
|
var pair = (toString(number) + 'e').split('e'),
|
5423
|
-
|
5485
|
+
value = func(pair[0] + 'e' + (+pair[1] + precision));
|
5424
5486
|
|
5425
5487
|
pair = (toString(value) + 'e').split('e');
|
5426
5488
|
return +(pair[0] + 'e' + (+pair[1] - precision));
|
@@ -5501,7 +5563,7 @@
|
|
5501
5563
|
|
5502
5564
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
5503
5565
|
var partialsRight = partials,
|
5504
|
-
|
5566
|
+
holdersRight = holders;
|
5505
5567
|
|
5506
5568
|
partials = holders = undefined;
|
5507
5569
|
}
|
@@ -5554,7 +5616,7 @@
|
|
5554
5616
|
*/
|
5555
5617
|
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
5556
5618
|
if (objValue === undefined ||
|
5557
|
-
|
5619
|
+
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
5558
5620
|
return srcValue;
|
5559
5621
|
}
|
5560
5622
|
return objValue;
|
@@ -5612,20 +5674,21 @@
|
|
5612
5674
|
*/
|
5613
5675
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
5614
5676
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
5615
|
-
|
5616
|
-
|
5677
|
+
arrLength = array.length,
|
5678
|
+
othLength = other.length;
|
5617
5679
|
|
5618
5680
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
5619
5681
|
return false;
|
5620
5682
|
}
|
5621
|
-
//
|
5622
|
-
var
|
5623
|
-
|
5624
|
-
|
5683
|
+
// Check that cyclic values are equal.
|
5684
|
+
var arrStacked = stack.get(array);
|
5685
|
+
var othStacked = stack.get(other);
|
5686
|
+
if (arrStacked && othStacked) {
|
5687
|
+
return arrStacked == other && othStacked == array;
|
5625
5688
|
}
|
5626
5689
|
var index = -1,
|
5627
|
-
|
5628
|
-
|
5690
|
+
result = true,
|
5691
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
|
5629
5692
|
|
5630
5693
|
stack.set(array, other);
|
5631
5694
|
stack.set(other, array);
|
@@ -5633,7 +5696,7 @@
|
|
5633
5696
|
// Ignore non-index properties.
|
5634
5697
|
while (++index < arrLength) {
|
5635
5698
|
var arrValue = array[index],
|
5636
|
-
|
5699
|
+
othValue = other[index];
|
5637
5700
|
|
5638
5701
|
if (customizer) {
|
5639
5702
|
var compared = isPartial
|
@@ -5650,18 +5713,18 @@
|
|
5650
5713
|
// Recursively compare arrays (susceptible to call stack limits).
|
5651
5714
|
if (seen) {
|
5652
5715
|
if (!arraySome(other, function(othValue, othIndex) {
|
5653
|
-
|
5654
|
-
|
5655
|
-
|
5656
|
-
|
5657
|
-
|
5716
|
+
if (!cacheHas(seen, othIndex) &&
|
5717
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
5718
|
+
return seen.push(othIndex);
|
5719
|
+
}
|
5720
|
+
})) {
|
5658
5721
|
result = false;
|
5659
5722
|
break;
|
5660
5723
|
}
|
5661
5724
|
} else if (!(
|
5662
|
-
|
5663
|
-
|
5664
|
-
|
5725
|
+
arrValue === othValue ||
|
5726
|
+
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
5727
|
+
)) {
|
5665
5728
|
result = false;
|
5666
5729
|
break;
|
5667
5730
|
}
|
@@ -5692,7 +5755,7 @@
|
|
5692
5755
|
switch (tag) {
|
5693
5756
|
case dataViewTag:
|
5694
5757
|
if ((object.byteLength != other.byteLength) ||
|
5695
|
-
|
5758
|
+
(object.byteOffset != other.byteOffset)) {
|
5696
5759
|
return false;
|
5697
5760
|
}
|
5698
5761
|
object = object.buffer;
|
@@ -5700,7 +5763,7 @@
|
|
5700
5763
|
|
5701
5764
|
case arrayBufferTag:
|
5702
5765
|
if ((object.byteLength != other.byteLength) ||
|
5703
|
-
|
5766
|
+
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
5704
5767
|
return false;
|
5705
5768
|
}
|
5706
5769
|
return true;
|
@@ -5768,10 +5831,10 @@
|
|
5768
5831
|
*/
|
5769
5832
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
5770
5833
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
5771
|
-
|
5772
|
-
|
5773
|
-
|
5774
|
-
|
5834
|
+
objProps = getAllKeys(object),
|
5835
|
+
objLength = objProps.length,
|
5836
|
+
othProps = getAllKeys(other),
|
5837
|
+
othLength = othProps.length;
|
5775
5838
|
|
5776
5839
|
if (objLength != othLength && !isPartial) {
|
5777
5840
|
return false;
|
@@ -5783,10 +5846,11 @@
|
|
5783
5846
|
return false;
|
5784
5847
|
}
|
5785
5848
|
}
|
5786
|
-
//
|
5787
|
-
var
|
5788
|
-
|
5789
|
-
|
5849
|
+
// Check that cyclic values are equal.
|
5850
|
+
var objStacked = stack.get(object);
|
5851
|
+
var othStacked = stack.get(other);
|
5852
|
+
if (objStacked && othStacked) {
|
5853
|
+
return objStacked == other && othStacked == object;
|
5790
5854
|
}
|
5791
5855
|
var result = true;
|
5792
5856
|
stack.set(object, other);
|
@@ -5796,7 +5860,7 @@
|
|
5796
5860
|
while (++index < objLength) {
|
5797
5861
|
key = objProps[index];
|
5798
5862
|
var objValue = object[key],
|
5799
|
-
|
5863
|
+
othValue = other[key];
|
5800
5864
|
|
5801
5865
|
if (customizer) {
|
5802
5866
|
var compared = isPartial
|
@@ -5805,9 +5869,9 @@
|
|
5805
5869
|
}
|
5806
5870
|
// Recursively compare objects (susceptible to call stack limits).
|
5807
5871
|
if (!(compared === undefined
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5872
|
+
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
5873
|
+
: compared
|
5874
|
+
)) {
|
5811
5875
|
result = false;
|
5812
5876
|
break;
|
5813
5877
|
}
|
@@ -5815,13 +5879,13 @@
|
|
5815
5879
|
}
|
5816
5880
|
if (result && !skipCtor) {
|
5817
5881
|
var objCtor = object.constructor,
|
5818
|
-
|
5882
|
+
othCtor = other.constructor;
|
5819
5883
|
|
5820
5884
|
// Non `Object` object instances with different constructors are not equal.
|
5821
5885
|
if (objCtor != othCtor &&
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5886
|
+
('constructor' in object && 'constructor' in other) &&
|
5887
|
+
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
5888
|
+
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
5825
5889
|
result = false;
|
5826
5890
|
}
|
5827
5891
|
}
|
@@ -5884,12 +5948,12 @@
|
|
5884
5948
|
*/
|
5885
5949
|
function getFuncName(func) {
|
5886
5950
|
var result = (func.name + ''),
|
5887
|
-
|
5888
|
-
|
5951
|
+
array = realNames[result],
|
5952
|
+
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
|
5889
5953
|
|
5890
5954
|
while (length--) {
|
5891
5955
|
var data = array[length],
|
5892
|
-
|
5956
|
+
otherFunc = data.func;
|
5893
5957
|
if (otherFunc == null || otherFunc == func) {
|
5894
5958
|
return data.name;
|
5895
5959
|
}
|
@@ -5950,11 +6014,11 @@
|
|
5950
6014
|
*/
|
5951
6015
|
function getMatchData(object) {
|
5952
6016
|
var result = keys(object),
|
5953
|
-
|
6017
|
+
length = result.length;
|
5954
6018
|
|
5955
6019
|
while (length--) {
|
5956
6020
|
var key = result[length],
|
5957
|
-
|
6021
|
+
value = object[key];
|
5958
6022
|
|
5959
6023
|
result[length] = [key, value, isStrictComparable(value)];
|
5960
6024
|
}
|
@@ -5983,7 +6047,7 @@
|
|
5983
6047
|
*/
|
5984
6048
|
function getRawTag(value) {
|
5985
6049
|
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
5986
|
-
|
6050
|
+
tag = value[symToStringTag];
|
5987
6051
|
|
5988
6052
|
try {
|
5989
6053
|
value[symToStringTag] = undefined;
|
@@ -6045,14 +6109,14 @@
|
|
6045
6109
|
|
6046
6110
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
6047
6111
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
6048
|
-
|
6049
|
-
|
6050
|
-
|
6051
|
-
|
6112
|
+
(Map && getTag(new Map) != mapTag) ||
|
6113
|
+
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
6114
|
+
(Set && getTag(new Set) != setTag) ||
|
6115
|
+
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
6052
6116
|
getTag = function(value) {
|
6053
6117
|
var result = baseGetTag(value),
|
6054
|
-
|
6055
|
-
|
6118
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
6119
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
6056
6120
|
|
6057
6121
|
if (ctorString) {
|
6058
6122
|
switch (ctorString) {
|
@@ -6079,11 +6143,11 @@
|
|
6079
6143
|
*/
|
6080
6144
|
function getView(start, end, transforms) {
|
6081
6145
|
var index = -1,
|
6082
|
-
|
6146
|
+
length = transforms.length;
|
6083
6147
|
|
6084
6148
|
while (++index < length) {
|
6085
6149
|
var data = transforms[index],
|
6086
|
-
|
6150
|
+
size = data.size;
|
6087
6151
|
|
6088
6152
|
switch (data.type) {
|
6089
6153
|
case 'drop': start += size; break;
|
@@ -6120,8 +6184,8 @@
|
|
6120
6184
|
path = castPath(path, object);
|
6121
6185
|
|
6122
6186
|
var index = -1,
|
6123
|
-
|
6124
|
-
|
6187
|
+
length = path.length,
|
6188
|
+
result = false;
|
6125
6189
|
|
6126
6190
|
while (++index < length) {
|
6127
6191
|
var key = toKey(path[index]);
|
@@ -6147,7 +6211,7 @@
|
|
6147
6211
|
*/
|
6148
6212
|
function initCloneArray(array) {
|
6149
6213
|
var length = array.length,
|
6150
|
-
|
6214
|
+
result = new array.constructor(length);
|
6151
6215
|
|
6152
6216
|
// Add properties assigned by `RegExp#exec`.
|
6153
6217
|
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
@@ -6264,7 +6328,7 @@
|
|
6264
6328
|
return !!length &&
|
6265
6329
|
(type == 'number' ||
|
6266
6330
|
(type != 'symbol' && reIsUint.test(value))) &&
|
6267
|
-
|
6331
|
+
(value > -1 && value % 1 == 0 && value < length);
|
6268
6332
|
}
|
6269
6333
|
|
6270
6334
|
/**
|
@@ -6283,9 +6347,9 @@
|
|
6283
6347
|
}
|
6284
6348
|
var type = typeof index;
|
6285
6349
|
if (type == 'number'
|
6286
|
-
|
6287
|
-
|
6288
|
-
|
6350
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
6351
|
+
: (type == 'string' && index in object)
|
6352
|
+
) {
|
6289
6353
|
return eq(object[index], value);
|
6290
6354
|
}
|
6291
6355
|
return false;
|
@@ -6305,7 +6369,7 @@
|
|
6305
6369
|
}
|
6306
6370
|
var type = typeof value;
|
6307
6371
|
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
6308
|
-
|
6372
|
+
value == null || isSymbol(value)) {
|
6309
6373
|
return true;
|
6310
6374
|
}
|
6311
6375
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
@@ -6336,7 +6400,7 @@
|
|
6336
6400
|
*/
|
6337
6401
|
function isLaziable(func) {
|
6338
6402
|
var funcName = getFuncName(func),
|
6339
|
-
|
6403
|
+
other = lodash[funcName];
|
6340
6404
|
|
6341
6405
|
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
|
6342
6406
|
return false;
|
@@ -6377,7 +6441,7 @@
|
|
6377
6441
|
*/
|
6378
6442
|
function isPrototype(value) {
|
6379
6443
|
var Ctor = value && value.constructor,
|
6380
|
-
|
6444
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
6381
6445
|
|
6382
6446
|
return value === proto;
|
6383
6447
|
}
|
@@ -6451,9 +6515,9 @@
|
|
6451
6515
|
*/
|
6452
6516
|
function mergeData(data, source) {
|
6453
6517
|
var bitmask = data[1],
|
6454
|
-
|
6455
|
-
|
6456
|
-
|
6518
|
+
srcBitmask = source[1],
|
6519
|
+
newBitmask = bitmask | srcBitmask,
|
6520
|
+
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
|
6457
6521
|
|
6458
6522
|
var isCombo =
|
6459
6523
|
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
|
@@ -6547,9 +6611,9 @@
|
|
6547
6611
|
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
6548
6612
|
return function() {
|
6549
6613
|
var args = arguments,
|
6550
|
-
|
6551
|
-
|
6552
|
-
|
6614
|
+
index = -1,
|
6615
|
+
length = nativeMax(args.length - start, 0),
|
6616
|
+
array = Array(length);
|
6553
6617
|
|
6554
6618
|
while (++index < length) {
|
6555
6619
|
array[index] = args[start + index];
|
@@ -6588,8 +6652,8 @@
|
|
6588
6652
|
*/
|
6589
6653
|
function reorder(array, indexes) {
|
6590
6654
|
var arrLength = array.length,
|
6591
|
-
|
6592
|
-
|
6655
|
+
length = nativeMin(indexes.length, arrLength),
|
6656
|
+
oldArray = copyArray(array);
|
6593
6657
|
|
6594
6658
|
while (length--) {
|
6595
6659
|
var index = indexes[length];
|
@@ -6682,11 +6746,11 @@
|
|
6682
6746
|
*/
|
6683
6747
|
function shortOut(func) {
|
6684
6748
|
var count = 0,
|
6685
|
-
|
6749
|
+
lastCalled = 0;
|
6686
6750
|
|
6687
6751
|
return function() {
|
6688
6752
|
var stamp = nativeNow(),
|
6689
|
-
|
6753
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
6690
6754
|
|
6691
6755
|
lastCalled = stamp;
|
6692
6756
|
if (remaining > 0) {
|
@@ -6710,13 +6774,13 @@
|
|
6710
6774
|
*/
|
6711
6775
|
function shuffleSelf(array, size) {
|
6712
6776
|
var index = -1,
|
6713
|
-
|
6714
|
-
|
6777
|
+
length = array.length,
|
6778
|
+
lastIndex = length - 1;
|
6715
6779
|
|
6716
6780
|
size = size === undefined ? length : size;
|
6717
6781
|
while (++index < size) {
|
6718
6782
|
var rand = baseRandom(index, lastIndex),
|
6719
|
-
|
6783
|
+
value = array[rand];
|
6720
6784
|
|
6721
6785
|
array[rand] = array[index];
|
6722
6786
|
array[index] = value;
|
@@ -6847,8 +6911,8 @@
|
|
6847
6911
|
return [];
|
6848
6912
|
}
|
6849
6913
|
var index = 0,
|
6850
|
-
|
6851
|
-
|
6914
|
+
resIndex = 0,
|
6915
|
+
result = Array(nativeCeil(length / size));
|
6852
6916
|
|
6853
6917
|
while (index < length) {
|
6854
6918
|
result[resIndex++] = baseSlice(array, index, (index += size));
|
@@ -6873,9 +6937,9 @@
|
|
6873
6937
|
*/
|
6874
6938
|
function compact(array) {
|
6875
6939
|
var index = -1,
|
6876
|
-
|
6877
|
-
|
6878
|
-
|
6940
|
+
length = array == null ? 0 : array.length,
|
6941
|
+
resIndex = 0,
|
6942
|
+
result = [];
|
6879
6943
|
|
6880
6944
|
while (++index < length) {
|
6881
6945
|
var value = array[index];
|
@@ -6914,8 +6978,8 @@
|
|
6914
6978
|
return [];
|
6915
6979
|
}
|
6916
6980
|
var args = Array(length - 1),
|
6917
|
-
|
6918
|
-
|
6981
|
+
array = arguments[0],
|
6982
|
+
index = length;
|
6919
6983
|
|
6920
6984
|
while (index--) {
|
6921
6985
|
args[index - 1] = arguments[index];
|
@@ -7392,8 +7456,8 @@
|
|
7392
7456
|
*/
|
7393
7457
|
function fromPairs(pairs) {
|
7394
7458
|
var index = -1,
|
7395
|
-
|
7396
|
-
|
7459
|
+
length = pairs == null ? 0 : pairs.length,
|
7460
|
+
result = {};
|
7397
7461
|
|
7398
7462
|
while (++index < length) {
|
7399
7463
|
var pair = pairs[index];
|
@@ -7527,7 +7591,7 @@
|
|
7527
7591
|
*/
|
7528
7592
|
var intersectionBy = baseRest(function(arrays) {
|
7529
7593
|
var iteratee = last(arrays),
|
7530
|
-
|
7594
|
+
mapped = arrayMap(arrays, castArrayLikeObject);
|
7531
7595
|
|
7532
7596
|
if (iteratee === last(mapped)) {
|
7533
7597
|
iteratee = undefined;
|
@@ -7562,7 +7626,7 @@
|
|
7562
7626
|
*/
|
7563
7627
|
var intersectionWith = baseRest(function(arrays) {
|
7564
7628
|
var comparator = last(arrays),
|
7565
|
-
|
7629
|
+
mapped = arrayMap(arrays, castArrayLikeObject);
|
7566
7630
|
|
7567
7631
|
comparator = typeof comparator == 'function' ? comparator : undefined;
|
7568
7632
|
if (comparator) {
|
@@ -7807,7 +7871,7 @@
|
|
7807
7871
|
*/
|
7808
7872
|
var pullAt = flatRest(function(array, indexes) {
|
7809
7873
|
var length = array == null ? 0 : array.length,
|
7810
|
-
|
7874
|
+
result = baseAt(array, indexes);
|
7811
7875
|
|
7812
7876
|
basePullAt(array, arrayMap(indexes, function(index) {
|
7813
7877
|
return isIndex(index, length) ? +index : index;
|
@@ -7850,8 +7914,8 @@
|
|
7850
7914
|
return result;
|
7851
7915
|
}
|
7852
7916
|
var index = -1,
|
7853
|
-
|
7854
|
-
|
7917
|
+
indexes = [],
|
7918
|
+
length = array.length;
|
7855
7919
|
|
7856
7920
|
predicate = getIteratee(predicate, 3);
|
7857
7921
|
while (++index < length) {
|
@@ -8697,7 +8761,7 @@
|
|
8697
8761
|
*/
|
8698
8762
|
var zipWith = baseRest(function(arrays) {
|
8699
8763
|
var length = arrays.length,
|
8700
|
-
|
8764
|
+
iteratee = length > 1 ? arrays[length - 1] : undefined;
|
8701
8765
|
|
8702
8766
|
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
|
8703
8767
|
return unzipWith(arrays, iteratee);
|
@@ -8813,12 +8877,12 @@
|
|
8813
8877
|
*/
|
8814
8878
|
var wrapperAt = flatRest(function(paths) {
|
8815
8879
|
var length = paths.length,
|
8816
|
-
|
8817
|
-
|
8818
|
-
|
8880
|
+
start = length ? paths[0] : 0,
|
8881
|
+
value = this.__wrapped__,
|
8882
|
+
interceptor = function(object) { return baseAt(object, paths); };
|
8819
8883
|
|
8820
8884
|
if (length > 1 || this.__actions__.length ||
|
8821
|
-
|
8885
|
+
!(value instanceof LazyWrapper) || !isIndex(start)) {
|
8822
8886
|
return this.thru(interceptor);
|
8823
8887
|
}
|
8824
8888
|
value = value.slice(start, +start + (length ? 1 : 0));
|
@@ -8923,7 +8987,7 @@
|
|
8923
8987
|
this.__values__ = toArray(this.value());
|
8924
8988
|
}
|
8925
8989
|
var done = this.__index__ >= this.__values__.length,
|
8926
|
-
|
8990
|
+
value = done ? undefined : this.__values__[this.__index__++];
|
8927
8991
|
|
8928
8992
|
return { 'done': done, 'value': value };
|
8929
8993
|
}
|
@@ -8976,7 +9040,7 @@
|
|
8976
9040
|
*/
|
8977
9041
|
function wrapperPlant(value) {
|
8978
9042
|
var result,
|
8979
|
-
|
9043
|
+
parent = this;
|
8980
9044
|
|
8981
9045
|
while (parent instanceof baseLodash) {
|
8982
9046
|
var clone = wrapperClone(parent);
|
@@ -9167,6 +9231,10 @@
|
|
9167
9231
|
* // The `_.property` iteratee shorthand.
|
9168
9232
|
* _.filter(users, 'active');
|
9169
9233
|
* // => objects for ['barney']
|
9234
|
+
*
|
9235
|
+
* // Combining several predicates using `_.overEvery` or `_.overSome`.
|
9236
|
+
* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
|
9237
|
+
* // => objects for ['fred', 'barney']
|
9170
9238
|
*/
|
9171
9239
|
function filter(collection, predicate) {
|
9172
9240
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
@@ -9466,8 +9534,8 @@
|
|
9466
9534
|
*/
|
9467
9535
|
var invokeMap = baseRest(function(collection, path, args) {
|
9468
9536
|
var index = -1,
|
9469
|
-
|
9470
|
-
|
9537
|
+
isFunc = typeof path == 'function',
|
9538
|
+
result = isArrayLike(collection) ? Array(collection.length) : [];
|
9471
9539
|
|
9472
9540
|
baseEach(collection, function(value) {
|
9473
9541
|
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
@@ -9676,7 +9744,7 @@
|
|
9676
9744
|
*/
|
9677
9745
|
function reduce(collection, iteratee, accumulator) {
|
9678
9746
|
var func = isArray(collection) ? arrayReduce : baseReduce,
|
9679
|
-
|
9747
|
+
initAccum = arguments.length < 3;
|
9680
9748
|
|
9681
9749
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
|
9682
9750
|
}
|
@@ -9705,7 +9773,7 @@
|
|
9705
9773
|
*/
|
9706
9774
|
function reduceRight(collection, iteratee, accumulator) {
|
9707
9775
|
var func = isArray(collection) ? arrayReduceRight : baseReduce,
|
9708
|
-
|
9776
|
+
initAccum = arguments.length < 3;
|
9709
9777
|
|
9710
9778
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
|
9711
9779
|
}
|
@@ -9916,15 +9984,15 @@
|
|
9916
9984
|
* var users = [
|
9917
9985
|
* { 'user': 'fred', 'age': 48 },
|
9918
9986
|
* { 'user': 'barney', 'age': 36 },
|
9919
|
-
* { 'user': 'fred', 'age':
|
9987
|
+
* { 'user': 'fred', 'age': 30 },
|
9920
9988
|
* { 'user': 'barney', 'age': 34 }
|
9921
9989
|
* ];
|
9922
9990
|
*
|
9923
9991
|
* _.sortBy(users, [function(o) { return o.user; }]);
|
9924
|
-
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred',
|
9992
|
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
|
9925
9993
|
*
|
9926
9994
|
* _.sortBy(users, ['user', 'age']);
|
9927
|
-
* // => objects for [['barney', 34], ['barney', 36], ['fred',
|
9995
|
+
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
|
9928
9996
|
*/
|
9929
9997
|
var sortBy = baseRest(function(collection, iteratees) {
|
9930
9998
|
if (collection == null) {
|
@@ -10303,15 +10371,15 @@
|
|
10303
10371
|
*/
|
10304
10372
|
function debounce(func, wait, options) {
|
10305
10373
|
var lastArgs,
|
10306
|
-
|
10307
|
-
|
10308
|
-
|
10309
|
-
|
10310
|
-
|
10311
|
-
|
10312
|
-
|
10313
|
-
|
10314
|
-
|
10374
|
+
lastThis,
|
10375
|
+
maxWait,
|
10376
|
+
result,
|
10377
|
+
timerId,
|
10378
|
+
lastCallTime,
|
10379
|
+
lastInvokeTime = 0,
|
10380
|
+
leading = false,
|
10381
|
+
maxing = false,
|
10382
|
+
trailing = true;
|
10315
10383
|
|
10316
10384
|
if (typeof func != 'function') {
|
10317
10385
|
throw new TypeError(FUNC_ERROR_TEXT);
|
@@ -10326,7 +10394,7 @@
|
|
10326
10394
|
|
10327
10395
|
function invokeFunc(time) {
|
10328
10396
|
var args = lastArgs,
|
10329
|
-
|
10397
|
+
thisArg = lastThis;
|
10330
10398
|
|
10331
10399
|
lastArgs = lastThis = undefined;
|
10332
10400
|
lastInvokeTime = time;
|
@@ -10345,8 +10413,8 @@
|
|
10345
10413
|
|
10346
10414
|
function remainingWait(time) {
|
10347
10415
|
var timeSinceLastCall = time - lastCallTime,
|
10348
|
-
|
10349
|
-
|
10416
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
10417
|
+
timeWaiting = wait - timeSinceLastCall;
|
10350
10418
|
|
10351
10419
|
return maxing
|
10352
10420
|
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
@@ -10355,7 +10423,7 @@
|
|
10355
10423
|
|
10356
10424
|
function shouldInvoke(time) {
|
10357
10425
|
var timeSinceLastCall = time - lastCallTime,
|
10358
|
-
|
10426
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
10359
10427
|
|
10360
10428
|
// Either this is the first call, activity has stopped and we're at the
|
10361
10429
|
// trailing edge, the system time has gone backwards and we're treating
|
@@ -10399,7 +10467,7 @@
|
|
10399
10467
|
|
10400
10468
|
function debounced() {
|
10401
10469
|
var time = now(),
|
10402
|
-
|
10470
|
+
isInvoking = shouldInvoke(time);
|
10403
10471
|
|
10404
10472
|
lastArgs = arguments;
|
10405
10473
|
lastThis = this;
|
@@ -10543,8 +10611,8 @@
|
|
10543
10611
|
}
|
10544
10612
|
var memoized = function() {
|
10545
10613
|
var args = arguments,
|
10546
|
-
|
10547
|
-
|
10614
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
10615
|
+
cache = memoized.cache;
|
10548
10616
|
|
10549
10617
|
if (cache.has(key)) {
|
10550
10618
|
return cache.get(key);
|
@@ -10657,7 +10725,7 @@
|
|
10657
10725
|
var funcsLength = transforms.length;
|
10658
10726
|
return baseRest(function(args) {
|
10659
10727
|
var index = -1,
|
10660
|
-
|
10728
|
+
length = nativeMin(args.length, funcsLength);
|
10661
10729
|
|
10662
10730
|
while (++index < length) {
|
10663
10731
|
args[index] = transforms[index].call(this, args[index]);
|
@@ -10841,7 +10909,7 @@
|
|
10841
10909
|
start = start == null ? 0 : nativeMax(toInteger(start), 0);
|
10842
10910
|
return baseRest(function(args) {
|
10843
10911
|
var array = args[start],
|
10844
|
-
|
10912
|
+
otherArgs = castSlice(args, 0, start);
|
10845
10913
|
|
10846
10914
|
if (array) {
|
10847
10915
|
arrayPush(otherArgs, array);
|
@@ -10896,7 +10964,7 @@
|
|
10896
10964
|
*/
|
10897
10965
|
function throttle(func, wait, options) {
|
10898
10966
|
var leading = true,
|
10899
|
-
|
10967
|
+
trailing = true;
|
10900
10968
|
|
10901
10969
|
if (typeof func != 'function') {
|
10902
10970
|
throw new TypeError(FUNC_ERROR_TEXT);
|
@@ -11481,8 +11549,8 @@
|
|
11481
11549
|
return true;
|
11482
11550
|
}
|
11483
11551
|
if (isArrayLike(value) &&
|
11484
|
-
|
11485
|
-
|
11552
|
+
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
11553
|
+
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
11486
11554
|
return !value.length;
|
11487
11555
|
}
|
11488
11556
|
var tag = getTag(value);
|
@@ -12327,7 +12395,7 @@
|
|
12327
12395
|
return iteratorToArray(value[symIterator]());
|
12328
12396
|
}
|
12329
12397
|
var tag = getTag(value),
|
12330
|
-
|
12398
|
+
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
|
12331
12399
|
|
12332
12400
|
return func(value);
|
12333
12401
|
}
|
@@ -12395,7 +12463,7 @@
|
|
12395
12463
|
*/
|
12396
12464
|
function toInteger(value) {
|
12397
12465
|
var result = toFinite(value),
|
12398
|
-
|
12466
|
+
remainder = result % 1;
|
12399
12467
|
|
12400
12468
|
return result === result ? (remainder ? result - remainder : result) : 0;
|
12401
12469
|
}
|
@@ -12468,7 +12536,7 @@
|
|
12468
12536
|
if (typeof value != 'string') {
|
12469
12537
|
return value === 0 ? value : +value;
|
12470
12538
|
}
|
12471
|
-
value = value
|
12539
|
+
value = baseTrim(value);
|
12472
12540
|
var isBinary = reIsBinary.test(value);
|
12473
12541
|
return (isBinary || reIsOctal.test(value))
|
12474
12542
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
@@ -12805,7 +12873,7 @@
|
|
12805
12873
|
var value = object[key];
|
12806
12874
|
|
12807
12875
|
if (value === undefined ||
|
12808
|
-
|
12876
|
+
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
12809
12877
|
object[key] = source[key];
|
12810
12878
|
}
|
12811
12879
|
}
|
@@ -13209,7 +13277,7 @@
|
|
13209
13277
|
*/
|
13210
13278
|
var invert = createInverter(function(result, value, key) {
|
13211
13279
|
if (value != null &&
|
13212
|
-
|
13280
|
+
typeof value.toString != 'function') {
|
13213
13281
|
value = nativeObjectToString.call(value);
|
13214
13282
|
}
|
13215
13283
|
|
@@ -13244,7 +13312,7 @@
|
|
13244
13312
|
*/
|
13245
13313
|
var invertBy = createInverter(function(result, value, key) {
|
13246
13314
|
if (value != null &&
|
13247
|
-
|
13315
|
+
typeof value.toString != 'function') {
|
13248
13316
|
value = nativeObjectToString.call(value);
|
13249
13317
|
}
|
13250
13318
|
|
@@ -13624,7 +13692,7 @@
|
|
13624
13692
|
path = castPath(path, object);
|
13625
13693
|
|
13626
13694
|
var index = -1,
|
13627
|
-
|
13695
|
+
length = path.length;
|
13628
13696
|
|
13629
13697
|
// Ensure the loop is entered when path is empty.
|
13630
13698
|
if (!length) {
|
@@ -13787,7 +13855,7 @@
|
|
13787
13855
|
*/
|
13788
13856
|
function transform(object, iteratee, accumulator) {
|
13789
13857
|
var isArr = isArray(object),
|
13790
|
-
|
13858
|
+
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
13791
13859
|
|
13792
13860
|
iteratee = getIteratee(iteratee, 4);
|
13793
13861
|
if (accumulator == null) {
|
@@ -14535,7 +14603,7 @@
|
|
14535
14603
|
*/
|
14536
14604
|
function replace() {
|
14537
14605
|
var args = arguments,
|
14538
|
-
|
14606
|
+
string = toString(args[0]);
|
14539
14607
|
|
14540
14608
|
return args.length < 3 ? string : string.replace(args[1], args[2]);
|
14541
14609
|
}
|
@@ -14594,9 +14662,9 @@
|
|
14594
14662
|
}
|
14595
14663
|
string = toString(string);
|
14596
14664
|
if (string && (
|
14597
|
-
|
14598
|
-
|
14599
|
-
|
14665
|
+
typeof separator == 'string' ||
|
14666
|
+
(separator != null && !isRegExp(separator))
|
14667
|
+
)) {
|
14600
14668
|
separator = baseToString(separator);
|
14601
14669
|
if (!separator && hasUnicode(string)) {
|
14602
14670
|
return castSlice(stringToArray(string), 0, limit);
|
@@ -14780,14 +14848,14 @@
|
|
14780
14848
|
options = assignInWith({}, options, settings, customDefaultsAssignIn);
|
14781
14849
|
|
14782
14850
|
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
|
14783
|
-
|
14784
|
-
|
14851
|
+
importsKeys = keys(imports),
|
14852
|
+
importsValues = baseValues(imports, importsKeys);
|
14785
14853
|
|
14786
14854
|
var isEscaping,
|
14787
|
-
|
14788
|
-
|
14789
|
-
|
14790
|
-
|
14855
|
+
isEvaluating,
|
14856
|
+
index = 0,
|
14857
|
+
interpolate = options.interpolate || reNoMatch,
|
14858
|
+
source = "__p += '";
|
14791
14859
|
|
14792
14860
|
// Compile the regexp to match each delimiter.
|
14793
14861
|
var reDelimiters = RegExp(
|
@@ -14795,16 +14863,16 @@
|
|
14795
14863
|
interpolate.source + '|' +
|
14796
14864
|
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
|
14797
14865
|
(options.evaluate || reNoMatch).source + '|$'
|
14798
|
-
|
14866
|
+
, 'g');
|
14799
14867
|
|
14800
14868
|
// Use a sourceURL for easier debugging.
|
14801
14869
|
// The sourceURL gets injected into the source that's eval-ed, so be careful
|
14802
|
-
//
|
14803
|
-
//
|
14870
|
+
// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
|
14871
|
+
// and escape the comment, thus injecting code that gets evaled.
|
14804
14872
|
var sourceURL = '//# sourceURL=' +
|
14805
14873
|
(hasOwnProperty.call(options, 'sourceURL')
|
14806
|
-
|
14807
|
-
|
14874
|
+
? (options.sourceURL + '').replace(/\s/g, ' ')
|
14875
|
+
: ('lodash.templateSources[' + (++templateCounter) + ']')
|
14808
14876
|
) + '\n';
|
14809
14877
|
|
14810
14878
|
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
@@ -14836,12 +14904,16 @@
|
|
14836
14904
|
|
14837
14905
|
// If `variable` is not specified wrap a with-statement around the generated
|
14838
14906
|
// code to add the data object to the top of the scope chain.
|
14839
|
-
// Like with sourceURL, we take care to not check the option's prototype,
|
14840
|
-
// as this configuration is a code injection vector.
|
14841
14907
|
var variable = hasOwnProperty.call(options, 'variable') && options.variable;
|
14842
14908
|
if (!variable) {
|
14843
14909
|
source = 'with (obj) {\n' + source + '\n}\n';
|
14844
14910
|
}
|
14911
|
+
// Throw an error if a forbidden character was found in `variable`, to prevent
|
14912
|
+
// potential command injection attacks.
|
14913
|
+
else if (reForbiddenIdentifierChars.test(variable)) {
|
14914
|
+
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
|
14915
|
+
}
|
14916
|
+
|
14845
14917
|
// Cleanup code by stripping empty strings.
|
14846
14918
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
|
14847
14919
|
.replace(reEmptyStringMiddle, '$1')
|
@@ -14850,18 +14922,18 @@
|
|
14850
14922
|
// Frame code as the function body.
|
14851
14923
|
source = 'function(' + (variable || 'obj') + ') {\n' +
|
14852
14924
|
(variable
|
14853
|
-
|
14854
|
-
|
14925
|
+
? ''
|
14926
|
+
: 'obj || (obj = {});\n'
|
14855
14927
|
) +
|
14856
14928
|
"var __t, __p = ''" +
|
14857
14929
|
(isEscaping
|
14858
|
-
|
14859
|
-
|
14930
|
+
? ', __e = _.escape'
|
14931
|
+
: ''
|
14860
14932
|
) +
|
14861
14933
|
(isEvaluating
|
14862
|
-
|
14934
|
+
? ', __j = Array.prototype.join;\n' +
|
14863
14935
|
"function print() { __p += __j.call(arguments, '') }\n"
|
14864
|
-
|
14936
|
+
: ';\n'
|
14865
14937
|
) +
|
14866
14938
|
source +
|
14867
14939
|
'return __p\n}';
|
@@ -14955,15 +15027,15 @@
|
|
14955
15027
|
function trim(string, chars, guard) {
|
14956
15028
|
string = toString(string);
|
14957
15029
|
if (string && (guard || chars === undefined)) {
|
14958
|
-
return string
|
15030
|
+
return baseTrim(string);
|
14959
15031
|
}
|
14960
15032
|
if (!string || !(chars = baseToString(chars))) {
|
14961
15033
|
return string;
|
14962
15034
|
}
|
14963
15035
|
var strSymbols = stringToArray(string),
|
14964
|
-
|
14965
|
-
|
14966
|
-
|
15036
|
+
chrSymbols = stringToArray(chars),
|
15037
|
+
start = charsStartIndex(strSymbols, chrSymbols),
|
15038
|
+
end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
14967
15039
|
|
14968
15040
|
return castSlice(strSymbols, start, end).join('');
|
14969
15041
|
}
|
@@ -14990,13 +15062,13 @@
|
|
14990
15062
|
function trimEnd(string, chars, guard) {
|
14991
15063
|
string = toString(string);
|
14992
15064
|
if (string && (guard || chars === undefined)) {
|
14993
|
-
return string.
|
15065
|
+
return string.slice(0, trimmedEndIndex(string) + 1);
|
14994
15066
|
}
|
14995
15067
|
if (!string || !(chars = baseToString(chars))) {
|
14996
15068
|
return string;
|
14997
15069
|
}
|
14998
15070
|
var strSymbols = stringToArray(string),
|
14999
|
-
|
15071
|
+
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
|
15000
15072
|
|
15001
15073
|
return castSlice(strSymbols, 0, end).join('');
|
15002
15074
|
}
|
@@ -15029,7 +15101,7 @@
|
|
15029
15101
|
return string;
|
15030
15102
|
}
|
15031
15103
|
var strSymbols = stringToArray(string),
|
15032
|
-
|
15104
|
+
start = charsStartIndex(strSymbols, stringToArray(chars));
|
15033
15105
|
|
15034
15106
|
return castSlice(strSymbols, start).join('');
|
15035
15107
|
}
|
@@ -15073,7 +15145,7 @@
|
|
15073
15145
|
*/
|
15074
15146
|
function truncate(string, options) {
|
15075
15147
|
var length = DEFAULT_TRUNC_LENGTH,
|
15076
|
-
|
15148
|
+
omission = DEFAULT_TRUNC_OMISSION;
|
15077
15149
|
|
15078
15150
|
if (isObject(options)) {
|
15079
15151
|
var separator = 'separator' in options ? options.separator : separator;
|
@@ -15107,7 +15179,7 @@
|
|
15107
15179
|
if (isRegExp(separator)) {
|
15108
15180
|
if (string.slice(end).search(separator)) {
|
15109
15181
|
var match,
|
15110
|
-
|
15182
|
+
substring = result;
|
15111
15183
|
|
15112
15184
|
if (!separator.global) {
|
15113
15185
|
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
|
@@ -15322,7 +15394,7 @@
|
|
15322
15394
|
*/
|
15323
15395
|
function cond(pairs) {
|
15324
15396
|
var length = pairs == null ? 0 : pairs.length,
|
15325
|
-
|
15397
|
+
toIteratee = getIteratee();
|
15326
15398
|
|
15327
15399
|
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
15328
15400
|
if (typeof pair[1] != 'function') {
|
@@ -15544,6 +15616,9 @@
|
|
15544
15616
|
* values against any array or object value, respectively. See `_.isEqual`
|
15545
15617
|
* for a list of supported value comparisons.
|
15546
15618
|
*
|
15619
|
+
* **Note:** Multiple values can be checked by combining several matchers
|
15620
|
+
* using `_.overSome`
|
15621
|
+
*
|
15547
15622
|
* @static
|
15548
15623
|
* @memberOf _
|
15549
15624
|
* @since 3.0.0
|
@@ -15559,6 +15634,10 @@
|
|
15559
15634
|
*
|
15560
15635
|
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
|
15561
15636
|
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
|
15637
|
+
*
|
15638
|
+
* // Checking for several possible values
|
15639
|
+
* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
|
15640
|
+
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
|
15562
15641
|
*/
|
15563
15642
|
function matches(source) {
|
15564
15643
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
@@ -15573,6 +15652,9 @@
|
|
15573
15652
|
* `srcValue` values against any array or object value, respectively. See
|
15574
15653
|
* `_.isEqual` for a list of supported value comparisons.
|
15575
15654
|
*
|
15655
|
+
* **Note:** Multiple values can be checked by combining several matchers
|
15656
|
+
* using `_.overSome`
|
15657
|
+
*
|
15576
15658
|
* @static
|
15577
15659
|
* @memberOf _
|
15578
15660
|
* @since 3.2.0
|
@@ -15589,6 +15671,10 @@
|
|
15589
15671
|
*
|
15590
15672
|
* _.find(objects, _.matchesProperty('a', 4));
|
15591
15673
|
* // => { 'a': 4, 'b': 5, 'c': 6 }
|
15674
|
+
*
|
15675
|
+
* // Checking for several possible values
|
15676
|
+
* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
|
15677
|
+
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
|
15592
15678
|
*/
|
15593
15679
|
function matchesProperty(path, srcValue) {
|
15594
15680
|
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
|
@@ -15691,17 +15777,17 @@
|
|
15691
15777
|
*/
|
15692
15778
|
function mixin(object, source, options) {
|
15693
15779
|
var props = keys(source),
|
15694
|
-
|
15780
|
+
methodNames = baseFunctions(source, props);
|
15695
15781
|
|
15696
15782
|
if (options == null &&
|
15697
|
-
|
15783
|
+
!(isObject(source) && (methodNames.length || !props.length))) {
|
15698
15784
|
options = source;
|
15699
15785
|
source = object;
|
15700
15786
|
object = this;
|
15701
15787
|
methodNames = baseFunctions(source, keys(source));
|
15702
15788
|
}
|
15703
15789
|
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
|
15704
|
-
|
15790
|
+
isFunc = isFunction(object);
|
15705
15791
|
|
15706
15792
|
arrayEach(methodNames, function(methodName) {
|
15707
15793
|
var func = source[methodName];
|
@@ -15711,7 +15797,7 @@
|
|
15711
15797
|
var chainAll = this.__chain__;
|
15712
15798
|
if (chain || chainAll) {
|
15713
15799
|
var result = object(this.__wrapped__),
|
15714
|
-
|
15800
|
+
actions = result.__actions__ = copyArray(this.__actions__);
|
15715
15801
|
|
15716
15802
|
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
|
15717
15803
|
result.__chain__ = chainAll;
|
@@ -15812,6 +15898,10 @@
|
|
15812
15898
|
* Creates a function that checks if **all** of the `predicates` return
|
15813
15899
|
* truthy when invoked with the arguments it receives.
|
15814
15900
|
*
|
15901
|
+
* Following shorthands are possible for providing predicates.
|
15902
|
+
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
|
15903
|
+
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
|
15904
|
+
*
|
15815
15905
|
* @static
|
15816
15906
|
* @memberOf _
|
15817
15907
|
* @since 4.0.0
|
@@ -15838,6 +15928,10 @@
|
|
15838
15928
|
* Creates a function that checks if **any** of the `predicates` return
|
15839
15929
|
* truthy when invoked with the arguments it receives.
|
15840
15930
|
*
|
15931
|
+
* Following shorthands are possible for providing predicates.
|
15932
|
+
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
|
15933
|
+
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
|
15934
|
+
*
|
15841
15935
|
* @static
|
15842
15936
|
* @memberOf _
|
15843
15937
|
* @since 4.0.0
|
@@ -15857,6 +15951,9 @@
|
|
15857
15951
|
*
|
15858
15952
|
* func(NaN);
|
15859
15953
|
* // => false
|
15954
|
+
*
|
15955
|
+
* var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
|
15956
|
+
* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
|
15860
15957
|
*/
|
15861
15958
|
var overSome = createOver(arraySome);
|
15862
15959
|
|
@@ -16114,7 +16211,7 @@
|
|
16114
16211
|
return [];
|
16115
16212
|
}
|
16116
16213
|
var index = MAX_ARRAY_LENGTH,
|
16117
|
-
|
16214
|
+
length = nativeMin(n, MAX_ARRAY_LENGTH);
|
16118
16215
|
|
16119
16216
|
iteratee = getIteratee(iteratee);
|
16120
16217
|
n -= MAX_ARRAY_LENGTH;
|
@@ -16893,7 +16990,7 @@
|
|
16893
16990
|
// Add `LazyWrapper` methods that accept an `iteratee` value.
|
16894
16991
|
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
|
16895
16992
|
var type = index + 1,
|
16896
|
-
|
16993
|
+
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
|
16897
16994
|
|
16898
16995
|
LazyWrapper.prototype[methodName] = function(iteratee) {
|
16899
16996
|
var result = this.clone();
|
@@ -16979,19 +17076,19 @@
|
|
16979
17076
|
// Add `LazyWrapper` methods to `lodash.prototype`.
|
16980
17077
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
16981
17078
|
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
|
16982
|
-
|
16983
|
-
|
16984
|
-
|
17079
|
+
isTaker = /^(?:head|last)$/.test(methodName),
|
17080
|
+
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
|
17081
|
+
retUnwrapped = isTaker || /^find/.test(methodName);
|
16985
17082
|
|
16986
17083
|
if (!lodashFunc) {
|
16987
17084
|
return;
|
16988
17085
|
}
|
16989
17086
|
lodash.prototype[methodName] = function() {
|
16990
17087
|
var value = this.__wrapped__,
|
16991
|
-
|
16992
|
-
|
16993
|
-
|
16994
|
-
|
17088
|
+
args = isTaker ? [1] : arguments,
|
17089
|
+
isLazy = value instanceof LazyWrapper,
|
17090
|
+
iteratee = args[0],
|
17091
|
+
useLazy = isLazy || isArray(value);
|
16995
17092
|
|
16996
17093
|
var interceptor = function(value) {
|
16997
17094
|
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
@@ -17003,9 +17100,9 @@
|
|
17003
17100
|
isLazy = useLazy = false;
|
17004
17101
|
}
|
17005
17102
|
var chainAll = this.__chain__,
|
17006
|
-
|
17007
|
-
|
17008
|
-
|
17103
|
+
isHybrid = !!this.__actions__.length,
|
17104
|
+
isUnwrapped = retUnwrapped && !chainAll,
|
17105
|
+
onlyLazy = isLazy && !isHybrid;
|
17009
17106
|
|
17010
17107
|
if (!retUnwrapped && useLazy) {
|
17011
17108
|
value = onlyLazy ? value : new LazyWrapper(this);
|
@@ -17024,8 +17121,8 @@
|
|
17024
17121
|
// Add `Array` methods to `lodash.prototype`.
|
17025
17122
|
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
17026
17123
|
var func = arrayProto[methodName],
|
17027
|
-
|
17028
|
-
|
17124
|
+
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
|
17125
|
+
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
17029
17126
|
|
17030
17127
|
lodash.prototype[methodName] = function() {
|
17031
17128
|
var args = arguments;
|