logstash-filter-javascript 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+
2
+ function filter(event) {
3
+ var error = event.getField('error');
4
+ if (error) throw new TypeError(error)
5
+ event.setField('filtered', true)
6
+ }
@@ -0,0 +1,1939 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define('underscore', factory) :
4
+ (global = global || self, (function () {
5
+ var current = global._;
6
+ var exports = global._ = factory();
7
+ exports.noConflict = function () { global._ = current; return exports; };
8
+ }()));
9
+ }(this, (function () {
10
+ // Underscore.js 1.11.0
11
+ // https://underscorejs.org
12
+ // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
+ // Underscore may be freely distributed under the MIT license.
14
+
15
+ // Current version.
16
+ var VERSION = '1.11.0';
17
+
18
+ // Establish the root object, `window` (`self`) in the browser, `global`
19
+ // on the server, or `this` in some virtual machines. We use `self`
20
+ // instead of `window` for `WebWorker` support.
21
+ var root = typeof self == 'object' && self.self === self && self ||
22
+ typeof global == 'object' && global.global === global && global ||
23
+ Function('return this')() ||
24
+ {};
25
+
26
+ // Save bytes in the minified (but not gzipped) version:
27
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype;
28
+ var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
29
+
30
+ // Create quick reference variables for speed access to core prototypes.
31
+ var push = ArrayProto.push,
32
+ slice = ArrayProto.slice,
33
+ toString = ObjProto.toString,
34
+ hasOwnProperty = ObjProto.hasOwnProperty;
35
+
36
+ // Modern feature detection.
37
+ var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined';
38
+
39
+ // All **ECMAScript 5+** native function implementations that we hope to use
40
+ // are declared here.
41
+ var nativeIsArray = Array.isArray,
42
+ nativeKeys = Object.keys,
43
+ nativeCreate = Object.create,
44
+ nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
45
+
46
+ // Create references to these builtin functions because we override them.
47
+ var _isNaN = isNaN,
48
+ _isFinite = isFinite;
49
+
50
+ // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
51
+ var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
52
+ var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
53
+ 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
54
+
55
+ // The largest integer that can be represented exactly.
56
+ var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
57
+
58
+ // Some functions take a variable number of arguments, or a few expected
59
+ // arguments at the beginning and then a variable number of values to operate
60
+ // on. This helper accumulates all remaining arguments past the function’s
61
+ // argument length (or an explicit `startIndex`), into an array that becomes
62
+ // the last argument. Similar to ES6’s "rest parameter".
63
+ function restArguments(func, startIndex) {
64
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
65
+ return function() {
66
+ var length = Math.max(arguments.length - startIndex, 0),
67
+ rest = Array(length),
68
+ index = 0;
69
+ for (; index < length; index++) {
70
+ rest[index] = arguments[index + startIndex];
71
+ }
72
+ switch (startIndex) {
73
+ case 0: return func.call(this, rest);
74
+ case 1: return func.call(this, arguments[0], rest);
75
+ case 2: return func.call(this, arguments[0], arguments[1], rest);
76
+ }
77
+ var args = Array(startIndex + 1);
78
+ for (index = 0; index < startIndex; index++) {
79
+ args[index] = arguments[index];
80
+ }
81
+ args[startIndex] = rest;
82
+ return func.apply(this, args);
83
+ };
84
+ }
85
+
86
+ // Is a given variable an object?
87
+ function isObject(obj) {
88
+ var type = typeof obj;
89
+ return type === 'function' || type === 'object' && !!obj;
90
+ }
91
+
92
+ // Is a given value equal to null?
93
+ function isNull(obj) {
94
+ return obj === null;
95
+ }
96
+
97
+ // Is a given variable undefined?
98
+ function isUndefined(obj) {
99
+ return obj === void 0;
100
+ }
101
+
102
+ // Is a given value a boolean?
103
+ function isBoolean(obj) {
104
+ return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
105
+ }
106
+
107
+ // Is a given value a DOM element?
108
+ function isElement(obj) {
109
+ return !!(obj && obj.nodeType === 1);
110
+ }
111
+
112
+ // Internal function for creating a `toString`-based type tester.
113
+ function tagTester(name) {
114
+ return function(obj) {
115
+ return toString.call(obj) === '[object ' + name + ']';
116
+ };
117
+ }
118
+
119
+ var isString = tagTester('String');
120
+
121
+ var isNumber = tagTester('Number');
122
+
123
+ var isDate = tagTester('Date');
124
+
125
+ var isRegExp = tagTester('RegExp');
126
+
127
+ var isError = tagTester('Error');
128
+
129
+ var isSymbol = tagTester('Symbol');
130
+
131
+ var isMap = tagTester('Map');
132
+
133
+ var isWeakMap = tagTester('WeakMap');
134
+
135
+ var isSet = tagTester('Set');
136
+
137
+ var isWeakSet = tagTester('WeakSet');
138
+
139
+ var isArrayBuffer = tagTester('ArrayBuffer');
140
+
141
+ var isDataView = tagTester('DataView');
142
+
143
+ // Is a given value an array?
144
+ // Delegates to ECMA5's native `Array.isArray`.
145
+ var isArray = nativeIsArray || tagTester('Array');
146
+
147
+ var isFunction = tagTester('Function');
148
+
149
+ // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
150
+ // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
151
+ var nodelist = root.document && root.document.childNodes;
152
+ if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
153
+ isFunction = function(obj) {
154
+ return typeof obj == 'function' || false;
155
+ };
156
+ }
157
+
158
+ var isFunction$1 = isFunction;
159
+
160
+ // Internal function to check whether `key` is an own property name of `obj`.
161
+ function has(obj, key) {
162
+ return obj != null && hasOwnProperty.call(obj, key);
163
+ }
164
+
165
+ var isArguments = tagTester('Arguments');
166
+
167
+ // Define a fallback version of the method in browsers (ahem, IE < 9), where
168
+ // there isn't any inspectable "Arguments" type.
169
+ (function() {
170
+ if (!isArguments(arguments)) {
171
+ isArguments = function(obj) {
172
+ return has(obj, 'callee');
173
+ };
174
+ }
175
+ }());
176
+
177
+ var isArguments$1 = isArguments;
178
+
179
+ // Is a given object a finite number?
180
+ function isFinite$1(obj) {
181
+ return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
182
+ }
183
+
184
+ // Is the given value `NaN`?
185
+ function isNaN$1(obj) {
186
+ return isNumber(obj) && _isNaN(obj);
187
+ }
188
+
189
+ // Predicate-generating function. Often useful outside of Underscore.
190
+ function constant(value) {
191
+ return function() {
192
+ return value;
193
+ };
194
+ }
195
+
196
+ // Common internal logic for `isArrayLike` and `isBufferLike`.
197
+ function createSizePropertyCheck(getSizeProperty) {
198
+ return function(collection) {
199
+ var sizeProperty = getSizeProperty(collection);
200
+ return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
201
+ }
202
+ }
203
+
204
+ // Internal helper to generate a function to obtain property `key` from `obj`.
205
+ function shallowProperty(key) {
206
+ return function(obj) {
207
+ return obj == null ? void 0 : obj[key];
208
+ };
209
+ }
210
+
211
+ // Internal helper to obtain the `byteLength` property of an object.
212
+ var getByteLength = shallowProperty('byteLength');
213
+
214
+ // Internal helper to determine whether we should spend extensive checks against
215
+ // `ArrayBuffer` et al.
216
+ var isBufferLike = createSizePropertyCheck(getByteLength);
217
+
218
+ // Is a given value a typed array?
219
+ var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
220
+ function isTypedArray(obj) {
221
+ // `ArrayBuffer.isView` is the most future-proof, so use it when available.
222
+ // Otherwise, fall back on the above regular expression.
223
+ return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :
224
+ isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
225
+ }
226
+
227
+ var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
228
+
229
+ // Internal helper to obtain the `length` property of an object.
230
+ var getLength = shallowProperty('length');
231
+
232
+ // Internal helper for collection methods to determine whether a collection
233
+ // should be iterated as an array or as an object.
234
+ // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
235
+ // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
236
+ var isArrayLike = createSizePropertyCheck(getLength);
237
+
238
+ // Internal helper to create a simple lookup structure.
239
+ // `collectNonEnumProps` used to depend on `_.contains`, but this led to
240
+ // circular imports. `emulatedSet` is a one-off solution that only works for
241
+ // arrays of strings.
242
+ function emulatedSet(keys) {
243
+ var hash = {};
244
+ for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
245
+ return {
246
+ contains: function(key) { return hash[key]; },
247
+ push: function(key) {
248
+ hash[key] = true;
249
+ return keys.push(key);
250
+ }
251
+ };
252
+ }
253
+
254
+ // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
255
+ // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
256
+ // needed.
257
+ function collectNonEnumProps(obj, keys) {
258
+ keys = emulatedSet(keys);
259
+ var nonEnumIdx = nonEnumerableProps.length;
260
+ var constructor = obj.constructor;
261
+ var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
262
+
263
+ // Constructor is a special case.
264
+ var prop = 'constructor';
265
+ if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);
266
+
267
+ while (nonEnumIdx--) {
268
+ prop = nonEnumerableProps[nonEnumIdx];
269
+ if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
270
+ keys.push(prop);
271
+ }
272
+ }
273
+ }
274
+
275
+ // Retrieve the names of an object's own properties.
276
+ // Delegates to **ECMAScript 5**'s native `Object.keys`.
277
+ function keys(obj) {
278
+ if (!isObject(obj)) return [];
279
+ if (nativeKeys) return nativeKeys(obj);
280
+ var keys = [];
281
+ for (var key in obj) if (has(obj, key)) keys.push(key);
282
+ // Ahem, IE < 9.
283
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
284
+ return keys;
285
+ }
286
+
287
+ // Is a given array, string, or object empty?
288
+ // An "empty" object has no enumerable own-properties.
289
+ function isEmpty(obj) {
290
+ if (obj == null) return true;
291
+ // Skip the more expensive `toString`-based type checks if `obj` has no
292
+ // `.length`.
293
+ if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments$1(obj))) return obj.length === 0;
294
+ return keys(obj).length === 0;
295
+ }
296
+
297
+ // Returns whether an object has a given set of `key:value` pairs.
298
+ function isMatch(object, attrs) {
299
+ var _keys = keys(attrs), length = _keys.length;
300
+ if (object == null) return !length;
301
+ var obj = Object(object);
302
+ for (var i = 0; i < length; i++) {
303
+ var key = _keys[i];
304
+ if (attrs[key] !== obj[key] || !(key in obj)) return false;
305
+ }
306
+ return true;
307
+ }
308
+
309
+ // If Underscore is called as a function, it returns a wrapped object that can
310
+ // be used OO-style. This wrapper holds altered versions of all functions added
311
+ // through `_.mixin`. Wrapped objects may be chained.
312
+ function _(obj) {
313
+ if (obj instanceof _) return obj;
314
+ if (!(this instanceof _)) return new _(obj);
315
+ this._wrapped = obj;
316
+ }
317
+
318
+ _.VERSION = VERSION;
319
+
320
+ // Extracts the result from a wrapped and chained object.
321
+ _.prototype.value = function() {
322
+ return this._wrapped;
323
+ };
324
+
325
+ // Provide unwrapping proxies for some methods used in engine operations
326
+ // such as arithmetic and JSON stringification.
327
+ _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
328
+
329
+ _.prototype.toString = function() {
330
+ return String(this._wrapped);
331
+ };
332
+
333
+ // Internal recursive comparison function for `_.isEqual`.
334
+ function eq(a, b, aStack, bStack) {
335
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
336
+ // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
337
+ if (a === b) return a !== 0 || 1 / a === 1 / b;
338
+ // `null` or `undefined` only equal to itself (strict comparison).
339
+ if (a == null || b == null) return false;
340
+ // `NaN`s are equivalent, but non-reflexive.
341
+ if (a !== a) return b !== b;
342
+ // Exhaust primitive checks
343
+ var type = typeof a;
344
+ if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
345
+ return deepEq(a, b, aStack, bStack);
346
+ }
347
+
348
+ // Internal recursive comparison function for `_.isEqual`.
349
+ function deepEq(a, b, aStack, bStack) {
350
+ // Unwrap any wrapped objects.
351
+ if (a instanceof _) a = a._wrapped;
352
+ if (b instanceof _) b = b._wrapped;
353
+ // Compare `[[Class]]` names.
354
+ var className = toString.call(a);
355
+ if (className !== toString.call(b)) return false;
356
+ switch (className) {
357
+ // These types are compared by value.
358
+ case '[object RegExp]':
359
+ // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
360
+ case '[object String]':
361
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
362
+ // equivalent to `new String("5")`.
363
+ return '' + a === '' + b;
364
+ case '[object Number]':
365
+ // `NaN`s are equivalent, but non-reflexive.
366
+ // Object(NaN) is equivalent to NaN.
367
+ if (+a !== +a) return +b !== +b;
368
+ // An `egal` comparison is performed for other numeric values.
369
+ return +a === 0 ? 1 / +a === 1 / b : +a === +b;
370
+ case '[object Date]':
371
+ case '[object Boolean]':
372
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
373
+ // millisecond representations. Note that invalid dates with millisecond representations
374
+ // of `NaN` are not equivalent.
375
+ return +a === +b;
376
+ case '[object Symbol]':
377
+ return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
378
+ case '[object ArrayBuffer]':
379
+ // Coerce to `DataView` so we can fall through to the next case.
380
+ return deepEq(new DataView(a), new DataView(b), aStack, bStack);
381
+ case '[object DataView]':
382
+ var byteLength = getByteLength(a);
383
+ if (byteLength !== getByteLength(b)) {
384
+ return false;
385
+ }
386
+ while (byteLength--) {
387
+ if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {
388
+ return false;
389
+ }
390
+ }
391
+ return true;
392
+ }
393
+
394
+ if (isTypedArray$1(a)) {
395
+ // Coerce typed arrays to `DataView`.
396
+ return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack);
397
+ }
398
+
399
+ var areArrays = className === '[object Array]';
400
+ if (!areArrays) {
401
+ if (typeof a != 'object' || typeof b != 'object') return false;
402
+
403
+ // Objects with different constructors are not equivalent, but `Object`s or `Array`s
404
+ // from different frames are.
405
+ var aCtor = a.constructor, bCtor = b.constructor;
406
+ if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
407
+ isFunction$1(bCtor) && bCtor instanceof bCtor)
408
+ && ('constructor' in a && 'constructor' in b)) {
409
+ return false;
410
+ }
411
+ }
412
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
413
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
414
+
415
+ // Initializing stack of traversed objects.
416
+ // It's done here since we only need them for objects and arrays comparison.
417
+ aStack = aStack || [];
418
+ bStack = bStack || [];
419
+ var length = aStack.length;
420
+ while (length--) {
421
+ // Linear search. Performance is inversely proportional to the number of
422
+ // unique nested structures.
423
+ if (aStack[length] === a) return bStack[length] === b;
424
+ }
425
+
426
+ // Add the first object to the stack of traversed objects.
427
+ aStack.push(a);
428
+ bStack.push(b);
429
+
430
+ // Recursively compare objects and arrays.
431
+ if (areArrays) {
432
+ // Compare array lengths to determine if a deep comparison is necessary.
433
+ length = a.length;
434
+ if (length !== b.length) return false;
435
+ // Deep compare the contents, ignoring non-numeric properties.
436
+ while (length--) {
437
+ if (!eq(a[length], b[length], aStack, bStack)) return false;
438
+ }
439
+ } else {
440
+ // Deep compare objects.
441
+ var _keys = keys(a), key;
442
+ length = _keys.length;
443
+ // Ensure that both objects contain the same number of properties before comparing deep equality.
444
+ if (keys(b).length !== length) return false;
445
+ while (length--) {
446
+ // Deep compare each member
447
+ key = _keys[length];
448
+ if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
449
+ }
450
+ }
451
+ // Remove the first object from the stack of traversed objects.
452
+ aStack.pop();
453
+ bStack.pop();
454
+ return true;
455
+ }
456
+
457
+ // Perform a deep comparison to check if two objects are equal.
458
+ function isEqual(a, b) {
459
+ return eq(a, b);
460
+ }
461
+
462
+ // Retrieve all the enumerable property names of an object.
463
+ function allKeys(obj) {
464
+ if (!isObject(obj)) return [];
465
+ var keys = [];
466
+ for (var key in obj) keys.push(key);
467
+ // Ahem, IE < 9.
468
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
469
+ return keys;
470
+ }
471
+
472
+ // Retrieve the values of an object's properties.
473
+ function values(obj) {
474
+ var _keys = keys(obj);
475
+ var length = _keys.length;
476
+ var values = Array(length);
477
+ for (var i = 0; i < length; i++) {
478
+ values[i] = obj[_keys[i]];
479
+ }
480
+ return values;
481
+ }
482
+
483
+ // Convert an object into a list of `[key, value]` pairs.
484
+ // The opposite of `_.object` with one argument.
485
+ function pairs(obj) {
486
+ var _keys = keys(obj);
487
+ var length = _keys.length;
488
+ var pairs = Array(length);
489
+ for (var i = 0; i < length; i++) {
490
+ pairs[i] = [_keys[i], obj[_keys[i]]];
491
+ }
492
+ return pairs;
493
+ }
494
+
495
+ // Invert the keys and values of an object. The values must be serializable.
496
+ function invert(obj) {
497
+ var result = {};
498
+ var _keys = keys(obj);
499
+ for (var i = 0, length = _keys.length; i < length; i++) {
500
+ result[obj[_keys[i]]] = _keys[i];
501
+ }
502
+ return result;
503
+ }
504
+
505
+ // Return a sorted list of the function names available on the object.
506
+ function functions(obj) {
507
+ var names = [];
508
+ for (var key in obj) {
509
+ if (isFunction$1(obj[key])) names.push(key);
510
+ }
511
+ return names.sort();
512
+ }
513
+
514
+ // An internal function for creating assigner functions.
515
+ function createAssigner(keysFunc, defaults) {
516
+ return function(obj) {
517
+ var length = arguments.length;
518
+ if (defaults) obj = Object(obj);
519
+ if (length < 2 || obj == null) return obj;
520
+ for (var index = 1; index < length; index++) {
521
+ var source = arguments[index],
522
+ keys = keysFunc(source),
523
+ l = keys.length;
524
+ for (var i = 0; i < l; i++) {
525
+ var key = keys[i];
526
+ if (!defaults || obj[key] === void 0) obj[key] = source[key];
527
+ }
528
+ }
529
+ return obj;
530
+ };
531
+ }
532
+
533
+ // Extend a given object with all the properties in passed-in object(s).
534
+ var extend = createAssigner(allKeys);
535
+
536
+ // Assigns a given object with all the own properties in the passed-in
537
+ // object(s).
538
+ // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
539
+ var extendOwn = createAssigner(keys);
540
+
541
+ // Fill in a given object with default properties.
542
+ var defaults = createAssigner(allKeys, true);
543
+
544
+ // Create a naked function reference for surrogate-prototype-swapping.
545
+ function ctor() {
546
+ return function(){};
547
+ }
548
+
549
+ // An internal function for creating a new object that inherits from another.
550
+ function baseCreate(prototype) {
551
+ if (!isObject(prototype)) return {};
552
+ if (nativeCreate) return nativeCreate(prototype);
553
+ var Ctor = ctor();
554
+ Ctor.prototype = prototype;
555
+ var result = new Ctor;
556
+ Ctor.prototype = null;
557
+ return result;
558
+ }
559
+
560
+ // Creates an object that inherits from the given prototype object.
561
+ // If additional properties are provided then they will be added to the
562
+ // created object.
563
+ function create(prototype, props) {
564
+ var result = baseCreate(prototype);
565
+ if (props) extendOwn(result, props);
566
+ return result;
567
+ }
568
+
569
+ // Create a (shallow-cloned) duplicate of an object.
570
+ function clone(obj) {
571
+ if (!isObject(obj)) return obj;
572
+ return isArray(obj) ? obj.slice() : extend({}, obj);
573
+ }
574
+
575
+ // Invokes `interceptor` with the `obj` and then returns `obj`.
576
+ // The primary purpose of this method is to "tap into" a method chain, in
577
+ // order to perform operations on intermediate results within the chain.
578
+ function tap(obj, interceptor) {
579
+ interceptor(obj);
580
+ return obj;
581
+ }
582
+
583
+ // Shortcut function for checking if an object has a given property directly on
584
+ // itself (in other words, not on a prototype). Unlike the internal `has`
585
+ // function, this public version can also traverse nested properties.
586
+ function has$1(obj, path) {
587
+ if (!isArray(path)) {
588
+ return has(obj, path);
589
+ }
590
+ var length = path.length;
591
+ for (var i = 0; i < length; i++) {
592
+ var key = path[i];
593
+ if (obj == null || !hasOwnProperty.call(obj, key)) {
594
+ return false;
595
+ }
596
+ obj = obj[key];
597
+ }
598
+ return !!length;
599
+ }
600
+
601
+ // Keep the identity function around for default iteratees.
602
+ function identity(value) {
603
+ return value;
604
+ }
605
+
606
+ // Returns a predicate for checking whether an object has a given set of
607
+ // `key:value` pairs.
608
+ function matcher(attrs) {
609
+ attrs = extendOwn({}, attrs);
610
+ return function(obj) {
611
+ return isMatch(obj, attrs);
612
+ };
613
+ }
614
+
615
+ // Internal function to obtain a nested property in `obj` along `path`.
616
+ function deepGet(obj, path) {
617
+ var length = path.length;
618
+ for (var i = 0; i < length; i++) {
619
+ if (obj == null) return void 0;
620
+ obj = obj[path[i]];
621
+ }
622
+ return length ? obj : void 0;
623
+ }
624
+
625
+ // Creates a function that, when passed an object, will traverse that object’s
626
+ // properties down the given `path`, specified as an array of keys or indices.
627
+ function property(path) {
628
+ if (!isArray(path)) {
629
+ return shallowProperty(path);
630
+ }
631
+ return function(obj) {
632
+ return deepGet(obj, path);
633
+ };
634
+ }
635
+
636
+ // Internal function that returns an efficient (for current engines) version
637
+ // of the passed-in callback, to be repeatedly applied in other Underscore
638
+ // functions.
639
+ function optimizeCb(func, context, argCount) {
640
+ if (context === void 0) return func;
641
+ switch (argCount == null ? 3 : argCount) {
642
+ case 1: return function(value) {
643
+ return func.call(context, value);
644
+ };
645
+ // The 2-argument case is omitted because we’re not using it.
646
+ case 3: return function(value, index, collection) {
647
+ return func.call(context, value, index, collection);
648
+ };
649
+ case 4: return function(accumulator, value, index, collection) {
650
+ return func.call(context, accumulator, value, index, collection);
651
+ };
652
+ }
653
+ return function() {
654
+ return func.apply(context, arguments);
655
+ };
656
+ }
657
+
658
+ // An internal function to generate callbacks that can be applied to each
659
+ // element in a collection, returning the desired result — either `_.identity`,
660
+ // an arbitrary callback, a property matcher, or a property accessor.
661
+ function baseIteratee(value, context, argCount) {
662
+ if (value == null) return identity;
663
+ if (isFunction$1(value)) return optimizeCb(value, context, argCount);
664
+ if (isObject(value) && !isArray(value)) return matcher(value);
665
+ return property(value);
666
+ }
667
+
668
+ // External wrapper for our callback generator. Users may customize
669
+ // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
670
+ // This abstraction hides the internal-only `argCount` argument.
671
+ function iteratee(value, context) {
672
+ return baseIteratee(value, context, Infinity);
673
+ }
674
+ _.iteratee = iteratee;
675
+
676
+ // The function we call internally to generate a callback. It invokes
677
+ // `_.iteratee` if overridden, otherwise `baseIteratee`.
678
+ function cb(value, context, argCount) {
679
+ if (_.iteratee !== iteratee) return _.iteratee(value, context);
680
+ return baseIteratee(value, context, argCount);
681
+ }
682
+
683
+ // Returns the results of applying the `iteratee` to each element of `obj`.
684
+ // In contrast to `_.map` it returns an object.
685
+ function mapObject(obj, iteratee, context) {
686
+ iteratee = cb(iteratee, context);
687
+ var _keys = keys(obj),
688
+ length = _keys.length,
689
+ results = {};
690
+ for (var index = 0; index < length; index++) {
691
+ var currentKey = _keys[index];
692
+ results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
693
+ }
694
+ return results;
695
+ }
696
+
697
+ // Predicate-generating function. Often useful outside of Underscore.
698
+ function noop(){}
699
+
700
+ // Generates a function for a given object that returns a given property.
701
+ function propertyOf(obj) {
702
+ if (obj == null) {
703
+ return function(){};
704
+ }
705
+ return function(path) {
706
+ return !isArray(path) ? obj[path] : deepGet(obj, path);
707
+ };
708
+ }
709
+
710
+ // Run a function **n** times.
711
+ function times(n, iteratee, context) {
712
+ var accum = Array(Math.max(0, n));
713
+ iteratee = optimizeCb(iteratee, context, 1);
714
+ for (var i = 0; i < n; i++) accum[i] = iteratee(i);
715
+ return accum;
716
+ }
717
+
718
+ // Return a random integer between `min` and `max` (inclusive).
719
+ function random(min, max) {
720
+ if (max == null) {
721
+ max = min;
722
+ min = 0;
723
+ }
724
+ return min + Math.floor(Math.random() * (max - min + 1));
725
+ }
726
+
727
+ // A (possibly faster) way to get the current timestamp as an integer.
728
+ var now = Date.now || function() {
729
+ return new Date().getTime();
730
+ };
731
+
732
+ // Internal helper to generate functions for escaping and unescaping strings
733
+ // to/from HTML interpolation.
734
+ function createEscaper(map) {
735
+ var escaper = function(match) {
736
+ return map[match];
737
+ };
738
+ // Regexes for identifying a key that needs to be escaped.
739
+ var source = '(?:' + keys(map).join('|') + ')';
740
+ var testRegexp = RegExp(source);
741
+ var replaceRegexp = RegExp(source, 'g');
742
+ return function(string) {
743
+ string = string == null ? '' : '' + string;
744
+ return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
745
+ };
746
+ }
747
+
748
+ // Internal list of HTML entities for escaping.
749
+ var escapeMap = {
750
+ '&': '&amp;',
751
+ '<': '&lt;',
752
+ '>': '&gt;',
753
+ '"': '&quot;',
754
+ "'": '&#x27;',
755
+ '`': '&#x60;'
756
+ };
757
+
758
+ // Function for escaping strings to HTML interpolation.
759
+ var _escape = createEscaper(escapeMap);
760
+
761
+ // Internal list of HTML entities for unescaping.
762
+ var unescapeMap = invert(escapeMap);
763
+
764
+ // Function for unescaping strings from HTML interpolation.
765
+ var _unescape = createEscaper(unescapeMap);
766
+
767
+ // By default, Underscore uses ERB-style template delimiters. Change the
768
+ // following template settings to use alternative delimiters.
769
+ var templateSettings = _.templateSettings = {
770
+ evaluate: /<%([\s\S]+?)%>/g,
771
+ interpolate: /<%=([\s\S]+?)%>/g,
772
+ escape: /<%-([\s\S]+?)%>/g
773
+ };
774
+
775
+ // When customizing `_.templateSettings`, if you don't want to define an
776
+ // interpolation, evaluation or escaping regex, we need one that is
777
+ // guaranteed not to match.
778
+ var noMatch = /(.)^/;
779
+
780
+ // Certain characters need to be escaped so that they can be put into a
781
+ // string literal.
782
+ var escapes = {
783
+ "'": "'",
784
+ '\\': '\\',
785
+ '\r': 'r',
786
+ '\n': 'n',
787
+ '\u2028': 'u2028',
788
+ '\u2029': 'u2029'
789
+ };
790
+
791
+ var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
792
+
793
+ function escapeChar(match) {
794
+ return '\\' + escapes[match];
795
+ }
796
+
797
+ // JavaScript micro-templating, similar to John Resig's implementation.
798
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
799
+ // and correctly escapes quotes within interpolated code.
800
+ // NB: `oldSettings` only exists for backwards compatibility.
801
+ function template(text, settings, oldSettings) {
802
+ if (!settings && oldSettings) settings = oldSettings;
803
+ settings = defaults({}, settings, _.templateSettings);
804
+
805
+ // Combine delimiters into one regular expression via alternation.
806
+ var matcher = RegExp([
807
+ (settings.escape || noMatch).source,
808
+ (settings.interpolate || noMatch).source,
809
+ (settings.evaluate || noMatch).source
810
+ ].join('|') + '|$', 'g');
811
+
812
+ // Compile the template source, escaping string literals appropriately.
813
+ var index = 0;
814
+ var source = "__p+='";
815
+ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
816
+ source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
817
+ index = offset + match.length;
818
+
819
+ if (escape) {
820
+ source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
821
+ } else if (interpolate) {
822
+ source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
823
+ } else if (evaluate) {
824
+ source += "';\n" + evaluate + "\n__p+='";
825
+ }
826
+
827
+ // Adobe VMs need the match returned to produce the correct offset.
828
+ return match;
829
+ });
830
+ source += "';\n";
831
+
832
+ // If a variable is not specified, place data values in local scope.
833
+ if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
834
+
835
+ source = "var __t,__p='',__j=Array.prototype.join," +
836
+ "print=function(){__p+=__j.call(arguments,'');};\n" +
837
+ source + 'return __p;\n';
838
+
839
+ var render;
840
+ try {
841
+ render = new Function(settings.variable || 'obj', '_', source);
842
+ } catch (e) {
843
+ e.source = source;
844
+ throw e;
845
+ }
846
+
847
+ var template = function(data) {
848
+ return render.call(this, data, _);
849
+ };
850
+
851
+ // Provide the compiled source as a convenience for precompilation.
852
+ var argument = settings.variable || 'obj';
853
+ template.source = 'function(' + argument + '){\n' + source + '}';
854
+
855
+ return template;
856
+ }
857
+
858
+ // Traverses the children of `obj` along `path`. If a child is a function, it
859
+ // is invoked with its parent as context. Returns the value of the final
860
+ // child, or `fallback` if any child is undefined.
861
+ function result(obj, path, fallback) {
862
+ if (!isArray(path)) path = [path];
863
+ var length = path.length;
864
+ if (!length) {
865
+ return isFunction$1(fallback) ? fallback.call(obj) : fallback;
866
+ }
867
+ for (var i = 0; i < length; i++) {
868
+ var prop = obj == null ? void 0 : obj[path[i]];
869
+ if (prop === void 0) {
870
+ prop = fallback;
871
+ i = length; // Ensure we don't continue iterating.
872
+ }
873
+ obj = isFunction$1(prop) ? prop.call(obj) : prop;
874
+ }
875
+ return obj;
876
+ }
877
+
878
+ // Generate a unique integer id (unique within the entire client session).
879
+ // Useful for temporary DOM ids.
880
+ var idCounter = 0;
881
+ function uniqueId(prefix) {
882
+ var id = ++idCounter + '';
883
+ return prefix ? prefix + id : id;
884
+ }
885
+
886
+ // Start chaining a wrapped Underscore object.
887
+ function chain(obj) {
888
+ var instance = _(obj);
889
+ instance._chain = true;
890
+ return instance;
891
+ }
892
+
893
+ // Internal function to execute `sourceFunc` bound to `context` with optional
894
+ // `args`. Determines whether to execute a function as a constructor or as a
895
+ // normal function.
896
+ function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
897
+ if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
898
+ var self = baseCreate(sourceFunc.prototype);
899
+ var result = sourceFunc.apply(self, args);
900
+ if (isObject(result)) return result;
901
+ return self;
902
+ }
903
+
904
+ // Partially apply a function by creating a version that has had some of its
905
+ // arguments pre-filled, without changing its dynamic `this` context. `_` acts
906
+ // as a placeholder by default, allowing any combination of arguments to be
907
+ // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
908
+ var partial = restArguments(function(func, boundArgs) {
909
+ var placeholder = partial.placeholder;
910
+ var bound = function() {
911
+ var position = 0, length = boundArgs.length;
912
+ var args = Array(length);
913
+ for (var i = 0; i < length; i++) {
914
+ args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
915
+ }
916
+ while (position < arguments.length) args.push(arguments[position++]);
917
+ return executeBound(func, bound, this, this, args);
918
+ };
919
+ return bound;
920
+ });
921
+
922
+ partial.placeholder = _;
923
+
924
+ // Create a function bound to a given object (assigning `this`, and arguments,
925
+ // optionally).
926
+ var bind = restArguments(function(func, context, args) {
927
+ if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
928
+ var bound = restArguments(function(callArgs) {
929
+ return executeBound(func, bound, context, this, args.concat(callArgs));
930
+ });
931
+ return bound;
932
+ });
933
+
934
+ // Internal implementation of a recursive `flatten` function.
935
+ function flatten(input, depth, strict, output) {
936
+ output = output || [];
937
+ if (!depth && depth !== 0) {
938
+ depth = Infinity;
939
+ } else if (depth <= 0) {
940
+ return output.concat(input);
941
+ }
942
+ var idx = output.length;
943
+ for (var i = 0, length = getLength(input); i < length; i++) {
944
+ var value = input[i];
945
+ if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
946
+ // Flatten current level of array or arguments object.
947
+ if (depth > 1) {
948
+ flatten(value, depth - 1, strict, output);
949
+ idx = output.length;
950
+ } else {
951
+ var j = 0, len = value.length;
952
+ while (j < len) output[idx++] = value[j++];
953
+ }
954
+ } else if (!strict) {
955
+ output[idx++] = value;
956
+ }
957
+ }
958
+ return output;
959
+ }
960
+
961
+ // Bind a number of an object's methods to that object. Remaining arguments
962
+ // are the method names to be bound. Useful for ensuring that all callbacks
963
+ // defined on an object belong to it.
964
+ var bindAll = restArguments(function(obj, keys) {
965
+ keys = flatten(keys, false, false);
966
+ var index = keys.length;
967
+ if (index < 1) throw new Error('bindAll must be passed function names');
968
+ while (index--) {
969
+ var key = keys[index];
970
+ obj[key] = bind(obj[key], obj);
971
+ }
972
+ return obj;
973
+ });
974
+
975
+ // Memoize an expensive function by storing its results.
976
+ function memoize(func, hasher) {
977
+ var memoize = function(key) {
978
+ var cache = memoize.cache;
979
+ var address = '' + (hasher ? hasher.apply(this, arguments) : key);
980
+ if (!has(cache, address)) cache[address] = func.apply(this, arguments);
981
+ return cache[address];
982
+ };
983
+ memoize.cache = {};
984
+ return memoize;
985
+ }
986
+
987
+ // Delays a function for the given number of milliseconds, and then calls
988
+ // it with the arguments supplied.
989
+ var delay = restArguments(function(func, wait, args) {
990
+ return setTimeout(function() {
991
+ return func.apply(null, args);
992
+ }, wait);
993
+ });
994
+
995
+ // Defers a function, scheduling it to run after the current call stack has
996
+ // cleared.
997
+ var defer = partial(delay, _, 1);
998
+
999
+ // Returns a function, that, when invoked, will only be triggered at most once
1000
+ // during a given window of time. Normally, the throttled function will run
1001
+ // as much as it can, without ever going more than once per `wait` duration;
1002
+ // but if you'd like to disable the execution on the leading edge, pass
1003
+ // `{leading: false}`. To disable execution on the trailing edge, ditto.
1004
+ function throttle(func, wait, options) {
1005
+ var timeout, context, args, result;
1006
+ var previous = 0;
1007
+ if (!options) options = {};
1008
+
1009
+ var later = function() {
1010
+ previous = options.leading === false ? 0 : now();
1011
+ timeout = null;
1012
+ result = func.apply(context, args);
1013
+ if (!timeout) context = args = null;
1014
+ };
1015
+
1016
+ var throttled = function() {
1017
+ var _now = now();
1018
+ if (!previous && options.leading === false) previous = _now;
1019
+ var remaining = wait - (_now - previous);
1020
+ context = this;
1021
+ args = arguments;
1022
+ if (remaining <= 0 || remaining > wait) {
1023
+ if (timeout) {
1024
+ clearTimeout(timeout);
1025
+ timeout = null;
1026
+ }
1027
+ previous = _now;
1028
+ result = func.apply(context, args);
1029
+ if (!timeout) context = args = null;
1030
+ } else if (!timeout && options.trailing !== false) {
1031
+ timeout = setTimeout(later, remaining);
1032
+ }
1033
+ return result;
1034
+ };
1035
+
1036
+ throttled.cancel = function() {
1037
+ clearTimeout(timeout);
1038
+ previous = 0;
1039
+ timeout = context = args = null;
1040
+ };
1041
+
1042
+ return throttled;
1043
+ }
1044
+
1045
+ // When a sequence of calls of the returned function ends, the argument
1046
+ // function is triggered. The end of a sequence is defined by the `wait`
1047
+ // parameter. If `immediate` is passed, the argument function will be
1048
+ // triggered at the beginning of the sequence instead of at the end.
1049
+ function debounce(func, wait, immediate) {
1050
+ var timeout, result;
1051
+
1052
+ var later = function(context, args) {
1053
+ timeout = null;
1054
+ if (args) result = func.apply(context, args);
1055
+ };
1056
+
1057
+ var debounced = restArguments(function(args) {
1058
+ if (timeout) clearTimeout(timeout);
1059
+ if (immediate) {
1060
+ var callNow = !timeout;
1061
+ timeout = setTimeout(later, wait);
1062
+ if (callNow) result = func.apply(this, args);
1063
+ } else {
1064
+ timeout = delay(later, wait, this, args);
1065
+ }
1066
+
1067
+ return result;
1068
+ });
1069
+
1070
+ debounced.cancel = function() {
1071
+ clearTimeout(timeout);
1072
+ timeout = null;
1073
+ };
1074
+
1075
+ return debounced;
1076
+ }
1077
+
1078
+ // Returns the first function passed as an argument to the second,
1079
+ // allowing you to adjust arguments, run code before and after, and
1080
+ // conditionally execute the original function.
1081
+ function wrap(func, wrapper) {
1082
+ return partial(wrapper, func);
1083
+ }
1084
+
1085
+ // Returns a negated version of the passed-in predicate.
1086
+ function negate(predicate) {
1087
+ return function() {
1088
+ return !predicate.apply(this, arguments);
1089
+ };
1090
+ }
1091
+
1092
+ // Returns a function that is the composition of a list of functions, each
1093
+ // consuming the return value of the function that follows.
1094
+ function compose() {
1095
+ var args = arguments;
1096
+ var start = args.length - 1;
1097
+ return function() {
1098
+ var i = start;
1099
+ var result = args[start].apply(this, arguments);
1100
+ while (i--) result = args[i].call(this, result);
1101
+ return result;
1102
+ };
1103
+ }
1104
+
1105
+ // Returns a function that will only be executed on and after the Nth call.
1106
+ function after(times, func) {
1107
+ return function() {
1108
+ if (--times < 1) {
1109
+ return func.apply(this, arguments);
1110
+ }
1111
+ };
1112
+ }
1113
+
1114
+ // Returns a function that will only be executed up to (but not including) the
1115
+ // Nth call.
1116
+ function before(times, func) {
1117
+ var memo;
1118
+ return function() {
1119
+ if (--times > 0) {
1120
+ memo = func.apply(this, arguments);
1121
+ }
1122
+ if (times <= 1) func = null;
1123
+ return memo;
1124
+ };
1125
+ }
1126
+
1127
+ // Returns a function that will be executed at most one time, no matter how
1128
+ // often you call it. Useful for lazy initialization.
1129
+ var once = partial(before, 2);
1130
+
1131
+ // Returns the first key on an object that passes a truth test.
1132
+ function findKey(obj, predicate, context) {
1133
+ predicate = cb(predicate, context);
1134
+ var _keys = keys(obj), key;
1135
+ for (var i = 0, length = _keys.length; i < length; i++) {
1136
+ key = _keys[i];
1137
+ if (predicate(obj[key], key, obj)) return key;
1138
+ }
1139
+ }
1140
+
1141
+ // Internal function to generate `_.findIndex` and `_.findLastIndex`.
1142
+ function createPredicateIndexFinder(dir) {
1143
+ return function(array, predicate, context) {
1144
+ predicate = cb(predicate, context);
1145
+ var length = getLength(array);
1146
+ var index = dir > 0 ? 0 : length - 1;
1147
+ for (; index >= 0 && index < length; index += dir) {
1148
+ if (predicate(array[index], index, array)) return index;
1149
+ }
1150
+ return -1;
1151
+ };
1152
+ }
1153
+
1154
+ // Returns the first index on an array-like that passes a truth test.
1155
+ var findIndex = createPredicateIndexFinder(1);
1156
+
1157
+ // Returns the last index on an array-like that passes a truth test.
1158
+ var findLastIndex = createPredicateIndexFinder(-1);
1159
+
1160
+ // Use a comparator function to figure out the smallest index at which
1161
+ // an object should be inserted so as to maintain order. Uses binary search.
1162
+ function sortedIndex(array, obj, iteratee, context) {
1163
+ iteratee = cb(iteratee, context, 1);
1164
+ var value = iteratee(obj);
1165
+ var low = 0, high = getLength(array);
1166
+ while (low < high) {
1167
+ var mid = Math.floor((low + high) / 2);
1168
+ if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
1169
+ }
1170
+ return low;
1171
+ }
1172
+
1173
+ // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
1174
+ function createIndexFinder(dir, predicateFind, sortedIndex) {
1175
+ return function(array, item, idx) {
1176
+ var i = 0, length = getLength(array);
1177
+ if (typeof idx == 'number') {
1178
+ if (dir > 0) {
1179
+ i = idx >= 0 ? idx : Math.max(idx + length, i);
1180
+ } else {
1181
+ length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
1182
+ }
1183
+ } else if (sortedIndex && idx && length) {
1184
+ idx = sortedIndex(array, item);
1185
+ return array[idx] === item ? idx : -1;
1186
+ }
1187
+ if (item !== item) {
1188
+ idx = predicateFind(slice.call(array, i, length), isNaN$1);
1189
+ return idx >= 0 ? idx + i : -1;
1190
+ }
1191
+ for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
1192
+ if (array[idx] === item) return idx;
1193
+ }
1194
+ return -1;
1195
+ };
1196
+ }
1197
+
1198
+ // Return the position of the first occurrence of an item in an array,
1199
+ // or -1 if the item is not included in the array.
1200
+ // If the array is large and already in sort order, pass `true`
1201
+ // for **isSorted** to use binary search.
1202
+ var indexOf = createIndexFinder(1, findIndex, sortedIndex);
1203
+
1204
+ // Return the position of the last occurrence of an item in an array,
1205
+ // or -1 if the item is not included in the array.
1206
+ var lastIndexOf = createIndexFinder(-1, findLastIndex);
1207
+
1208
+ // Return the first value which passes a truth test.
1209
+ function find(obj, predicate, context) {
1210
+ var keyFinder = isArrayLike(obj) ? findIndex : findKey;
1211
+ var key = keyFinder(obj, predicate, context);
1212
+ if (key !== void 0 && key !== -1) return obj[key];
1213
+ }
1214
+
1215
+ // Convenience version of a common use case of `_.find`: getting the first
1216
+ // object containing specific `key:value` pairs.
1217
+ function findWhere(obj, attrs) {
1218
+ return find(obj, matcher(attrs));
1219
+ }
1220
+
1221
+ // The cornerstone for collection functions, an `each`
1222
+ // implementation, aka `forEach`.
1223
+ // Handles raw objects in addition to array-likes. Treats all
1224
+ // sparse array-likes as if they were dense.
1225
+ function each(obj, iteratee, context) {
1226
+ iteratee = optimizeCb(iteratee, context);
1227
+ var i, length;
1228
+ if (isArrayLike(obj)) {
1229
+ for (i = 0, length = obj.length; i < length; i++) {
1230
+ iteratee(obj[i], i, obj);
1231
+ }
1232
+ } else {
1233
+ var _keys = keys(obj);
1234
+ for (i = 0, length = _keys.length; i < length; i++) {
1235
+ iteratee(obj[_keys[i]], _keys[i], obj);
1236
+ }
1237
+ }
1238
+ return obj;
1239
+ }
1240
+
1241
+ // Return the results of applying the iteratee to each element.
1242
+ function map(obj, iteratee, context) {
1243
+ iteratee = cb(iteratee, context);
1244
+ var _keys = !isArrayLike(obj) && keys(obj),
1245
+ length = (_keys || obj).length,
1246
+ results = Array(length);
1247
+ for (var index = 0; index < length; index++) {
1248
+ var currentKey = _keys ? _keys[index] : index;
1249
+ results[index] = iteratee(obj[currentKey], currentKey, obj);
1250
+ }
1251
+ return results;
1252
+ }
1253
+
1254
+ // Internal helper to create a reducing function, iterating left or right.
1255
+ function createReduce(dir) {
1256
+ // Wrap code that reassigns argument variables in a separate function than
1257
+ // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
1258
+ var reducer = function(obj, iteratee, memo, initial) {
1259
+ var _keys = !isArrayLike(obj) && keys(obj),
1260
+ length = (_keys || obj).length,
1261
+ index = dir > 0 ? 0 : length - 1;
1262
+ if (!initial) {
1263
+ memo = obj[_keys ? _keys[index] : index];
1264
+ index += dir;
1265
+ }
1266
+ for (; index >= 0 && index < length; index += dir) {
1267
+ var currentKey = _keys ? _keys[index] : index;
1268
+ memo = iteratee(memo, obj[currentKey], currentKey, obj);
1269
+ }
1270
+ return memo;
1271
+ };
1272
+
1273
+ return function(obj, iteratee, memo, context) {
1274
+ var initial = arguments.length >= 3;
1275
+ return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
1276
+ };
1277
+ }
1278
+
1279
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
1280
+ // or `foldl`.
1281
+ var reduce = createReduce(1);
1282
+
1283
+ // The right-associative version of reduce, also known as `foldr`.
1284
+ var reduceRight = createReduce(-1);
1285
+
1286
+ // Return all the elements that pass a truth test.
1287
+ function filter(obj, predicate, context) {
1288
+ var results = [];
1289
+ predicate = cb(predicate, context);
1290
+ each(obj, function(value, index, list) {
1291
+ if (predicate(value, index, list)) results.push(value);
1292
+ });
1293
+ return results;
1294
+ }
1295
+
1296
+ // Return all the elements for which a truth test fails.
1297
+ function reject(obj, predicate, context) {
1298
+ return filter(obj, negate(cb(predicate)), context);
1299
+ }
1300
+
1301
+ // Determine whether all of the elements pass a truth test.
1302
+ function every(obj, predicate, context) {
1303
+ predicate = cb(predicate, context);
1304
+ var _keys = !isArrayLike(obj) && keys(obj),
1305
+ length = (_keys || obj).length;
1306
+ for (var index = 0; index < length; index++) {
1307
+ var currentKey = _keys ? _keys[index] : index;
1308
+ if (!predicate(obj[currentKey], currentKey, obj)) return false;
1309
+ }
1310
+ return true;
1311
+ }
1312
+
1313
+ // Determine if at least one element in the object passes a truth test.
1314
+ function some(obj, predicate, context) {
1315
+ predicate = cb(predicate, context);
1316
+ var _keys = !isArrayLike(obj) && keys(obj),
1317
+ length = (_keys || obj).length;
1318
+ for (var index = 0; index < length; index++) {
1319
+ var currentKey = _keys ? _keys[index] : index;
1320
+ if (predicate(obj[currentKey], currentKey, obj)) return true;
1321
+ }
1322
+ return false;
1323
+ }
1324
+
1325
+ // Determine if the array or object contains a given item (using `===`).
1326
+ function contains(obj, item, fromIndex, guard) {
1327
+ if (!isArrayLike(obj)) obj = values(obj);
1328
+ if (typeof fromIndex != 'number' || guard) fromIndex = 0;
1329
+ return indexOf(obj, item, fromIndex) >= 0;
1330
+ }
1331
+
1332
+ // Invoke a method (with arguments) on every item in a collection.
1333
+ var invoke = restArguments(function(obj, path, args) {
1334
+ var contextPath, func;
1335
+ if (isFunction$1(path)) {
1336
+ func = path;
1337
+ } else if (isArray(path)) {
1338
+ contextPath = path.slice(0, -1);
1339
+ path = path[path.length - 1];
1340
+ }
1341
+ return map(obj, function(context) {
1342
+ var method = func;
1343
+ if (!method) {
1344
+ if (contextPath && contextPath.length) {
1345
+ context = deepGet(context, contextPath);
1346
+ }
1347
+ if (context == null) return void 0;
1348
+ method = context[path];
1349
+ }
1350
+ return method == null ? method : method.apply(context, args);
1351
+ });
1352
+ });
1353
+
1354
+ // Convenience version of a common use case of `_.map`: fetching a property.
1355
+ function pluck(obj, key) {
1356
+ return map(obj, property(key));
1357
+ }
1358
+
1359
+ // Convenience version of a common use case of `_.filter`: selecting only
1360
+ // objects containing specific `key:value` pairs.
1361
+ function where(obj, attrs) {
1362
+ return filter(obj, matcher(attrs));
1363
+ }
1364
+
1365
+ // Return the maximum element (or element-based computation).
1366
+ function max(obj, iteratee, context) {
1367
+ var result = -Infinity, lastComputed = -Infinity,
1368
+ value, computed;
1369
+ if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
1370
+ obj = isArrayLike(obj) ? obj : values(obj);
1371
+ for (var i = 0, length = obj.length; i < length; i++) {
1372
+ value = obj[i];
1373
+ if (value != null && value > result) {
1374
+ result = value;
1375
+ }
1376
+ }
1377
+ } else {
1378
+ iteratee = cb(iteratee, context);
1379
+ each(obj, function(v, index, list) {
1380
+ computed = iteratee(v, index, list);
1381
+ if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
1382
+ result = v;
1383
+ lastComputed = computed;
1384
+ }
1385
+ });
1386
+ }
1387
+ return result;
1388
+ }
1389
+
1390
+ // Return the minimum element (or element-based computation).
1391
+ function min(obj, iteratee, context) {
1392
+ var result = Infinity, lastComputed = Infinity,
1393
+ value, computed;
1394
+ if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
1395
+ obj = isArrayLike(obj) ? obj : values(obj);
1396
+ for (var i = 0, length = obj.length; i < length; i++) {
1397
+ value = obj[i];
1398
+ if (value != null && value < result) {
1399
+ result = value;
1400
+ }
1401
+ }
1402
+ } else {
1403
+ iteratee = cb(iteratee, context);
1404
+ each(obj, function(v, index, list) {
1405
+ computed = iteratee(v, index, list);
1406
+ if (computed < lastComputed || computed === Infinity && result === Infinity) {
1407
+ result = v;
1408
+ lastComputed = computed;
1409
+ }
1410
+ });
1411
+ }
1412
+ return result;
1413
+ }
1414
+
1415
+ // Sample **n** random values from a collection using the modern version of the
1416
+ // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
1417
+ // If **n** is not specified, returns a single random element.
1418
+ // The internal `guard` argument allows it to work with `_.map`.
1419
+ function sample(obj, n, guard) {
1420
+ if (n == null || guard) {
1421
+ if (!isArrayLike(obj)) obj = values(obj);
1422
+ return obj[random(obj.length - 1)];
1423
+ }
1424
+ var sample = isArrayLike(obj) ? clone(obj) : values(obj);
1425
+ var length = getLength(sample);
1426
+ n = Math.max(Math.min(n, length), 0);
1427
+ var last = length - 1;
1428
+ for (var index = 0; index < n; index++) {
1429
+ var rand = random(index, last);
1430
+ var temp = sample[index];
1431
+ sample[index] = sample[rand];
1432
+ sample[rand] = temp;
1433
+ }
1434
+ return sample.slice(0, n);
1435
+ }
1436
+
1437
+ // Shuffle a collection.
1438
+ function shuffle(obj) {
1439
+ return sample(obj, Infinity);
1440
+ }
1441
+
1442
+ // Sort the object's values by a criterion produced by an iteratee.
1443
+ function sortBy(obj, iteratee, context) {
1444
+ var index = 0;
1445
+ iteratee = cb(iteratee, context);
1446
+ return pluck(map(obj, function(value, key, list) {
1447
+ return {
1448
+ value: value,
1449
+ index: index++,
1450
+ criteria: iteratee(value, key, list)
1451
+ };
1452
+ }).sort(function(left, right) {
1453
+ var a = left.criteria;
1454
+ var b = right.criteria;
1455
+ if (a !== b) {
1456
+ if (a > b || a === void 0) return 1;
1457
+ if (a < b || b === void 0) return -1;
1458
+ }
1459
+ return left.index - right.index;
1460
+ }), 'value');
1461
+ }
1462
+
1463
+ // An internal function used for aggregate "group by" operations.
1464
+ function group(behavior, partition) {
1465
+ return function(obj, iteratee, context) {
1466
+ var result = partition ? [[], []] : {};
1467
+ iteratee = cb(iteratee, context);
1468
+ each(obj, function(value, index) {
1469
+ var key = iteratee(value, index, obj);
1470
+ behavior(result, value, key);
1471
+ });
1472
+ return result;
1473
+ };
1474
+ }
1475
+
1476
+ // Groups the object's values by a criterion. Pass either a string attribute
1477
+ // to group by, or a function that returns the criterion.
1478
+ var groupBy = group(function(result, value, key) {
1479
+ if (has(result, key)) result[key].push(value); else result[key] = [value];
1480
+ });
1481
+
1482
+ // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
1483
+ // when you know that your index values will be unique.
1484
+ var indexBy = group(function(result, value, key) {
1485
+ result[key] = value;
1486
+ });
1487
+
1488
+ // Counts instances of an object that group by a certain criterion. Pass
1489
+ // either a string attribute to count by, or a function that returns the
1490
+ // criterion.
1491
+ var countBy = group(function(result, value, key) {
1492
+ if (has(result, key)) result[key]++; else result[key] = 1;
1493
+ });
1494
+
1495
+ // Split a collection into two arrays: one whose elements all pass the given
1496
+ // truth test, and one whose elements all do not pass the truth test.
1497
+ var partition = group(function(result, value, pass) {
1498
+ result[pass ? 0 : 1].push(value);
1499
+ }, true);
1500
+
1501
+ // Safely create a real, live array from anything iterable.
1502
+ var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
1503
+ function toArray(obj) {
1504
+ if (!obj) return [];
1505
+ if (isArray(obj)) return slice.call(obj);
1506
+ if (isString(obj)) {
1507
+ // Keep surrogate pair characters together.
1508
+ return obj.match(reStrSymbol);
1509
+ }
1510
+ if (isArrayLike(obj)) return map(obj, identity);
1511
+ return values(obj);
1512
+ }
1513
+
1514
+ // Return the number of elements in a collection.
1515
+ function size(obj) {
1516
+ if (obj == null) return 0;
1517
+ return isArrayLike(obj) ? obj.length : keys(obj).length;
1518
+ }
1519
+
1520
+ // Internal `_.pick` helper function to determine whether `key` is an enumerable
1521
+ // property name of `obj`.
1522
+ function keyInObj(value, key, obj) {
1523
+ return key in obj;
1524
+ }
1525
+
1526
+ // Return a copy of the object only containing the allowed properties.
1527
+ var pick = restArguments(function(obj, keys) {
1528
+ var result = {}, iteratee = keys[0];
1529
+ if (obj == null) return result;
1530
+ if (isFunction$1(iteratee)) {
1531
+ if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
1532
+ keys = allKeys(obj);
1533
+ } else {
1534
+ iteratee = keyInObj;
1535
+ keys = flatten(keys, false, false);
1536
+ obj = Object(obj);
1537
+ }
1538
+ for (var i = 0, length = keys.length; i < length; i++) {
1539
+ var key = keys[i];
1540
+ var value = obj[key];
1541
+ if (iteratee(value, key, obj)) result[key] = value;
1542
+ }
1543
+ return result;
1544
+ });
1545
+
1546
+ // Return a copy of the object without the disallowed properties.
1547
+ var omit = restArguments(function(obj, keys) {
1548
+ var iteratee = keys[0], context;
1549
+ if (isFunction$1(iteratee)) {
1550
+ iteratee = negate(iteratee);
1551
+ if (keys.length > 1) context = keys[1];
1552
+ } else {
1553
+ keys = map(flatten(keys, false, false), String);
1554
+ iteratee = function(value, key) {
1555
+ return !contains(keys, key);
1556
+ };
1557
+ }
1558
+ return pick(obj, iteratee, context);
1559
+ });
1560
+
1561
+ // Returns everything but the last entry of the array. Especially useful on
1562
+ // the arguments object. Passing **n** will return all the values in
1563
+ // the array, excluding the last N.
1564
+ function initial(array, n, guard) {
1565
+ return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
1566
+ }
1567
+
1568
+ // Get the first element of an array. Passing **n** will return the first N
1569
+ // values in the array. The **guard** check allows it to work with `_.map`.
1570
+ function first(array, n, guard) {
1571
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
1572
+ if (n == null || guard) return array[0];
1573
+ return initial(array, array.length - n);
1574
+ }
1575
+
1576
+ // Returns everything but the first entry of the `array`. Especially useful on
1577
+ // the `arguments` object. Passing an **n** will return the rest N values in the
1578
+ // `array`.
1579
+ function rest(array, n, guard) {
1580
+ return slice.call(array, n == null || guard ? 1 : n);
1581
+ }
1582
+
1583
+ // Get the last element of an array. Passing **n** will return the last N
1584
+ // values in the array.
1585
+ function last(array, n, guard) {
1586
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
1587
+ if (n == null || guard) return array[array.length - 1];
1588
+ return rest(array, Math.max(0, array.length - n));
1589
+ }
1590
+
1591
+ // Trim out all falsy values from an array.
1592
+ function compact(array) {
1593
+ return filter(array, Boolean);
1594
+ }
1595
+
1596
+ // Flatten out an array, either recursively (by default), or up to `depth`.
1597
+ // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
1598
+ function flatten$1(array, depth) {
1599
+ return flatten(array, depth, false);
1600
+ }
1601
+
1602
+ // Take the difference between one array and a number of other arrays.
1603
+ // Only the elements present in just the first array will remain.
1604
+ var difference = restArguments(function(array, rest) {
1605
+ rest = flatten(rest, true, true);
1606
+ return filter(array, function(value){
1607
+ return !contains(rest, value);
1608
+ });
1609
+ });
1610
+
1611
+ // Return a version of the array that does not contain the specified value(s).
1612
+ var without = restArguments(function(array, otherArrays) {
1613
+ return difference(array, otherArrays);
1614
+ });
1615
+
1616
+ // Produce a duplicate-free version of the array. If the array has already
1617
+ // been sorted, you have the option of using a faster algorithm.
1618
+ // The faster algorithm will not work with an iteratee if the iteratee
1619
+ // is not a one-to-one function, so providing an iteratee will disable
1620
+ // the faster algorithm.
1621
+ function uniq(array, isSorted, iteratee, context) {
1622
+ if (!isBoolean(isSorted)) {
1623
+ context = iteratee;
1624
+ iteratee = isSorted;
1625
+ isSorted = false;
1626
+ }
1627
+ if (iteratee != null) iteratee = cb(iteratee, context);
1628
+ var result = [];
1629
+ var seen = [];
1630
+ for (var i = 0, length = getLength(array); i < length; i++) {
1631
+ var value = array[i],
1632
+ computed = iteratee ? iteratee(value, i, array) : value;
1633
+ if (isSorted && !iteratee) {
1634
+ if (!i || seen !== computed) result.push(value);
1635
+ seen = computed;
1636
+ } else if (iteratee) {
1637
+ if (!contains(seen, computed)) {
1638
+ seen.push(computed);
1639
+ result.push(value);
1640
+ }
1641
+ } else if (!contains(result, value)) {
1642
+ result.push(value);
1643
+ }
1644
+ }
1645
+ return result;
1646
+ }
1647
+
1648
+ // Produce an array that contains the union: each distinct element from all of
1649
+ // the passed-in arrays.
1650
+ var union = restArguments(function(arrays) {
1651
+ return uniq(flatten(arrays, true, true));
1652
+ });
1653
+
1654
+ // Produce an array that contains every item shared between all the
1655
+ // passed-in arrays.
1656
+ function intersection(array) {
1657
+ var result = [];
1658
+ var argsLength = arguments.length;
1659
+ for (var i = 0, length = getLength(array); i < length; i++) {
1660
+ var item = array[i];
1661
+ if (contains(result, item)) continue;
1662
+ var j;
1663
+ for (j = 1; j < argsLength; j++) {
1664
+ if (!contains(arguments[j], item)) break;
1665
+ }
1666
+ if (j === argsLength) result.push(item);
1667
+ }
1668
+ return result;
1669
+ }
1670
+
1671
+ // Complement of zip. Unzip accepts an array of arrays and groups
1672
+ // each array's elements on shared indices.
1673
+ function unzip(array) {
1674
+ var length = array && max(array, getLength).length || 0;
1675
+ var result = Array(length);
1676
+
1677
+ for (var index = 0; index < length; index++) {
1678
+ result[index] = pluck(array, index);
1679
+ }
1680
+ return result;
1681
+ }
1682
+
1683
+ // Zip together multiple lists into a single array -- elements that share
1684
+ // an index go together.
1685
+ var zip = restArguments(unzip);
1686
+
1687
+ // Converts lists into objects. Pass either a single array of `[key, value]`
1688
+ // pairs, or two parallel arrays of the same length -- one of keys, and one of
1689
+ // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
1690
+ function object(list, values) {
1691
+ var result = {};
1692
+ for (var i = 0, length = getLength(list); i < length; i++) {
1693
+ if (values) {
1694
+ result[list[i]] = values[i];
1695
+ } else {
1696
+ result[list[i][0]] = list[i][1];
1697
+ }
1698
+ }
1699
+ return result;
1700
+ }
1701
+
1702
+ // Generate an integer Array containing an arithmetic progression. A port of
1703
+ // the native Python `range()` function. See
1704
+ // [the Python documentation](https://docs.python.org/library/functions.html#range).
1705
+ function range(start, stop, step) {
1706
+ if (stop == null) {
1707
+ stop = start || 0;
1708
+ start = 0;
1709
+ }
1710
+ if (!step) {
1711
+ step = stop < start ? -1 : 1;
1712
+ }
1713
+
1714
+ var length = Math.max(Math.ceil((stop - start) / step), 0);
1715
+ var range = Array(length);
1716
+
1717
+ for (var idx = 0; idx < length; idx++, start += step) {
1718
+ range[idx] = start;
1719
+ }
1720
+
1721
+ return range;
1722
+ }
1723
+
1724
+ // Chunk a single array into multiple arrays, each containing `count` or fewer
1725
+ // items.
1726
+ function chunk(array, count) {
1727
+ if (count == null || count < 1) return [];
1728
+ var result = [];
1729
+ var i = 0, length = array.length;
1730
+ while (i < length) {
1731
+ result.push(slice.call(array, i, i += count));
1732
+ }
1733
+ return result;
1734
+ }
1735
+
1736
+ // Helper function to continue chaining intermediate results.
1737
+ function chainResult(instance, obj) {
1738
+ return instance._chain ? _(obj).chain() : obj;
1739
+ }
1740
+
1741
+ // Add your own custom functions to the Underscore object.
1742
+ function mixin(obj) {
1743
+ each(functions(obj), function(name) {
1744
+ var func = _[name] = obj[name];
1745
+ _.prototype[name] = function() {
1746
+ var args = [this._wrapped];
1747
+ push.apply(args, arguments);
1748
+ return chainResult(this, func.apply(_, args));
1749
+ };
1750
+ });
1751
+ return _;
1752
+ }
1753
+
1754
+ // Add all mutator `Array` functions to the wrapper.
1755
+ each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
1756
+ var method = ArrayProto[name];
1757
+ _.prototype[name] = function() {
1758
+ var obj = this._wrapped;
1759
+ if (obj != null) {
1760
+ method.apply(obj, arguments);
1761
+ if ((name === 'shift' || name === 'splice') && obj.length === 0) {
1762
+ delete obj[0];
1763
+ }
1764
+ }
1765
+ return chainResult(this, obj);
1766
+ };
1767
+ });
1768
+
1769
+ // Add all accessor `Array` functions to the wrapper.
1770
+ each(['concat', 'join', 'slice'], function(name) {
1771
+ var method = ArrayProto[name];
1772
+ _.prototype[name] = function() {
1773
+ var obj = this._wrapped;
1774
+ if (obj != null) obj = method.apply(obj, arguments);
1775
+ return chainResult(this, obj);
1776
+ };
1777
+ });
1778
+
1779
+ // Named Exports
1780
+
1781
+ var allExports = {
1782
+ __proto__: null,
1783
+ VERSION: VERSION,
1784
+ restArguments: restArguments,
1785
+ isObject: isObject,
1786
+ isNull: isNull,
1787
+ isUndefined: isUndefined,
1788
+ isBoolean: isBoolean,
1789
+ isElement: isElement,
1790
+ isString: isString,
1791
+ isNumber: isNumber,
1792
+ isDate: isDate,
1793
+ isRegExp: isRegExp,
1794
+ isError: isError,
1795
+ isSymbol: isSymbol,
1796
+ isMap: isMap,
1797
+ isWeakMap: isWeakMap,
1798
+ isSet: isSet,
1799
+ isWeakSet: isWeakSet,
1800
+ isArrayBuffer: isArrayBuffer,
1801
+ isDataView: isDataView,
1802
+ isArray: isArray,
1803
+ isFunction: isFunction$1,
1804
+ isArguments: isArguments$1,
1805
+ isFinite: isFinite$1,
1806
+ isNaN: isNaN$1,
1807
+ isTypedArray: isTypedArray$1,
1808
+ isEmpty: isEmpty,
1809
+ isMatch: isMatch,
1810
+ isEqual: isEqual,
1811
+ keys: keys,
1812
+ allKeys: allKeys,
1813
+ values: values,
1814
+ pairs: pairs,
1815
+ invert: invert,
1816
+ functions: functions,
1817
+ methods: functions,
1818
+ extend: extend,
1819
+ extendOwn: extendOwn,
1820
+ assign: extendOwn,
1821
+ defaults: defaults,
1822
+ create: create,
1823
+ clone: clone,
1824
+ tap: tap,
1825
+ has: has$1,
1826
+ mapObject: mapObject,
1827
+ identity: identity,
1828
+ constant: constant,
1829
+ noop: noop,
1830
+ property: property,
1831
+ propertyOf: propertyOf,
1832
+ matcher: matcher,
1833
+ matches: matcher,
1834
+ times: times,
1835
+ random: random,
1836
+ now: now,
1837
+ escape: _escape,
1838
+ unescape: _unescape,
1839
+ templateSettings: templateSettings,
1840
+ template: template,
1841
+ result: result,
1842
+ uniqueId: uniqueId,
1843
+ chain: chain,
1844
+ iteratee: iteratee,
1845
+ partial: partial,
1846
+ bind: bind,
1847
+ bindAll: bindAll,
1848
+ memoize: memoize,
1849
+ delay: delay,
1850
+ defer: defer,
1851
+ throttle: throttle,
1852
+ debounce: debounce,
1853
+ wrap: wrap,
1854
+ negate: negate,
1855
+ compose: compose,
1856
+ after: after,
1857
+ before: before,
1858
+ once: once,
1859
+ findKey: findKey,
1860
+ findIndex: findIndex,
1861
+ findLastIndex: findLastIndex,
1862
+ sortedIndex: sortedIndex,
1863
+ indexOf: indexOf,
1864
+ lastIndexOf: lastIndexOf,
1865
+ find: find,
1866
+ detect: find,
1867
+ findWhere: findWhere,
1868
+ each: each,
1869
+ forEach: each,
1870
+ map: map,
1871
+ collect: map,
1872
+ reduce: reduce,
1873
+ foldl: reduce,
1874
+ inject: reduce,
1875
+ reduceRight: reduceRight,
1876
+ foldr: reduceRight,
1877
+ filter: filter,
1878
+ select: filter,
1879
+ reject: reject,
1880
+ every: every,
1881
+ all: every,
1882
+ some: some,
1883
+ any: some,
1884
+ contains: contains,
1885
+ includes: contains,
1886
+ include: contains,
1887
+ invoke: invoke,
1888
+ pluck: pluck,
1889
+ where: where,
1890
+ max: max,
1891
+ min: min,
1892
+ shuffle: shuffle,
1893
+ sample: sample,
1894
+ sortBy: sortBy,
1895
+ groupBy: groupBy,
1896
+ indexBy: indexBy,
1897
+ countBy: countBy,
1898
+ partition: partition,
1899
+ toArray: toArray,
1900
+ size: size,
1901
+ pick: pick,
1902
+ omit: omit,
1903
+ first: first,
1904
+ head: first,
1905
+ take: first,
1906
+ initial: initial,
1907
+ last: last,
1908
+ rest: rest,
1909
+ tail: rest,
1910
+ drop: rest,
1911
+ compact: compact,
1912
+ flatten: flatten$1,
1913
+ without: without,
1914
+ uniq: uniq,
1915
+ unique: uniq,
1916
+ union: union,
1917
+ intersection: intersection,
1918
+ difference: difference,
1919
+ unzip: unzip,
1920
+ transpose: unzip,
1921
+ zip: zip,
1922
+ object: object,
1923
+ range: range,
1924
+ chunk: chunk,
1925
+ mixin: mixin,
1926
+ 'default': _
1927
+ };
1928
+
1929
+ // Default Export
1930
+
1931
+ // Add all of the Underscore functions to the wrapper object.
1932
+ var _$1 = mixin(allExports);
1933
+ // Legacy Node.js API.
1934
+ _$1._ = _$1;
1935
+
1936
+ return _$1;
1937
+
1938
+ })));
1939
+ //# sourceMappingURL=underscore.js.map