mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Update docs and rebuild files.
Former-commit-id: 6265fed04ac7d6da6c6ded82095c22c1a60d9193
This commit is contained in:
393
dist/lodash.js
vendored
393
dist/lodash.js
vendored
@@ -1314,6 +1314,11 @@
|
||||
(!b || (otherType != 'function' && otherType != 'object'))) {
|
||||
return false;
|
||||
}
|
||||
// exit early for `null` and `undefined`, avoiding ES3's Function#call behavior
|
||||
// http://es5.github.com/#x15.3.4.4
|
||||
if (a == null || b == null) {
|
||||
return a === b;
|
||||
}
|
||||
// compare [[Class]] names
|
||||
var className = toString.call(a),
|
||||
otherClass = toString.call(b);
|
||||
@@ -2032,18 +2037,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys returned from running each element of
|
||||
* `collection` through a `callback`. The corresponding value of each key is
|
||||
* the number of times the key was returned by `callback`. The `callback` is
|
||||
* bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to count by (e.g. 'length').
|
||||
* Creates an object composed of keys returned from running each element of the
|
||||
* `collection` through the given `callback`. The corresponding value of each key
|
||||
* is the number of times the key was returned by the `callback`. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to count by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -2073,12 +2085,21 @@
|
||||
* `collection`. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias all
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Boolean} Returns `true` if all elements pass the callback check,
|
||||
* else `false`.
|
||||
@@ -2092,13 +2113,13 @@
|
||||
* { 'name': 'larry', 'age': 50 }
|
||||
* ];
|
||||
*
|
||||
* // using callback "where" shorthand
|
||||
* _.every(stooges, { 'age': 50 });
|
||||
* // => false
|
||||
*
|
||||
* // using callback "pluck" shorthand
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.every(stooges, 'age');
|
||||
* // => true
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.every(stooges, { 'age': 50 });
|
||||
* // => false
|
||||
*/
|
||||
function every(collection, callback, thisArg) {
|
||||
var result = true;
|
||||
@@ -2126,18 +2147,40 @@
|
||||
* the `callback` returns truthy for. The `callback` is bound to `thisArg` and
|
||||
* invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias select
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of elements that passed the callback check.
|
||||
* @example
|
||||
*
|
||||
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
* // => [2, 4, 6]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.filter(food, 'organic');
|
||||
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.filter(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
|
||||
*/
|
||||
function filter(collection, callback, thisArg) {
|
||||
var result = [];
|
||||
@@ -2164,18 +2207,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Examines each element in a `collection`, returning the first that the
|
||||
* `callback` returns truthy for. The function returns as soon as it finds
|
||||
* an acceptable element, and does not iterate over the entire `collection`.
|
||||
* The `callback` is bound to `thisArg` and invoked with three arguments;
|
||||
* (value, index|key, collection).
|
||||
* Examines each element in a `collection`, returning the first that the `callback`
|
||||
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias detect
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the element that passed the callback check,
|
||||
* else `undefined`.
|
||||
@@ -2191,11 +2241,11 @@
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using callback "where" shorthand
|
||||
* // using "_.where" callback shorthand
|
||||
* var veggie = _.find(food, { 'type': 'vegetable' });
|
||||
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
||||
*
|
||||
* // using callback "pluck" shorthand
|
||||
* // using "_.pluck" callback shorthand
|
||||
* var healthy = _.find(food, 'organic');
|
||||
* // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
|
||||
*/
|
||||
@@ -2251,18 +2301,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys returned from running each element of
|
||||
* `collection` through a `callback`. The corresponding value of each key is an
|
||||
* array of elements passed to `callback` that returned the key. The `callback`
|
||||
* Creates an object composed of keys returned from running each element of the
|
||||
* `collection` through the `callback`. The corresponding value of each key is
|
||||
* an array of elements passed to `callback` that returned the key. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to group by (e.g. 'length').
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to group by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -2273,6 +2330,7 @@
|
||||
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
* // => { '4': [4.2], '6': [6.1, 6.4] }
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.groupBy(['one', 'two', 'three'], 'length');
|
||||
* // => { '3': ['one', 'two'], '5': ['three'] }
|
||||
*/
|
||||
@@ -2324,15 +2382,24 @@
|
||||
|
||||
/**
|
||||
* Creates an array of values by running each element in the `collection`
|
||||
* through a `callback`. The `callback` is bound to `thisArg` and invoked with
|
||||
* through the `callback`. The `callback` is bound to `thisArg` and invoked with
|
||||
* three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias collect
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of the results of each `callback` execution.
|
||||
* @example
|
||||
@@ -2342,6 +2409,15 @@
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
* { 'name': 'larry', 'age': 50 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.map(stooges, 'name');
|
||||
* // => ['moe', 'larry']
|
||||
*/
|
||||
function map(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
@@ -2367,11 +2443,20 @@
|
||||
* criterion by which the value is ranked. The `callback` is bound to
|
||||
* `thisArg` and invoked with three arguments; (value, index, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the maximum value.
|
||||
* @example
|
||||
@@ -2386,6 +2471,10 @@
|
||||
*
|
||||
* _.max(stooges, function(stooge) { return stooge.age; });
|
||||
* // => { 'name': 'larry', 'age': 50 };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.max(stooges, 'age');
|
||||
* // => { 'name': 'larry', 'age': 50 };
|
||||
*/
|
||||
function max(collection, callback, thisArg) {
|
||||
var computed = -Infinity,
|
||||
@@ -2423,11 +2512,20 @@
|
||||
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
|
||||
* and invoked with three arguments; (value, index, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the minimum value.
|
||||
* @example
|
||||
@@ -2442,6 +2540,10 @@
|
||||
*
|
||||
* _.min(stooges, function(stooge) { return stooge.age; });
|
||||
* // => { 'name': 'moe', 'age': 40 };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.min(stooges, 'age');
|
||||
* // => { 'name': 'moe', 'age': 40 };
|
||||
*/
|
||||
function min(collection, callback, thisArg) {
|
||||
var computed = Infinity,
|
||||
@@ -2474,8 +2576,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value of a specified property from all elements in
|
||||
* the `collection`.
|
||||
* Retrieves the value of a specified property from all elements in the `collection`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -2583,11 +2684,20 @@
|
||||
* The opposite of `_.filter`, this method returns the elements of a
|
||||
* `collection` that `callback` does **not** return truthy for.
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of elements that did **not** pass the
|
||||
* callback check.
|
||||
@@ -2595,6 +2705,19 @@
|
||||
*
|
||||
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
* // => [1, 3, 5]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.reject(food, 'organic');
|
||||
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.reject(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
|
||||
*/
|
||||
function reject(collection, callback, thisArg) {
|
||||
callback = createCallback(callback, thisArg);
|
||||
@@ -2661,12 +2784,21 @@
|
||||
* does not iterate over the entire `collection`. The `callback` is bound to
|
||||
* `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias any
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Boolean} Returns `true` if any element passes the callback check,
|
||||
* else `false`.
|
||||
@@ -2674,6 +2806,19 @@
|
||||
*
|
||||
* _.some([null, 0, 'yes', false], Boolean);
|
||||
* // => true
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.some(food, 'organic');
|
||||
* // => true
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.some(food, { 'type': 'meat' });
|
||||
* // => false
|
||||
*/
|
||||
function some(collection, callback, thisArg) {
|
||||
var result;
|
||||
@@ -2698,16 +2843,24 @@
|
||||
|
||||
/**
|
||||
* Creates an array, stable sorted in ascending order by the results of
|
||||
* running each element of `collection` through a `callback`. The `callback`
|
||||
* running each element of `collection` through the `callback`. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to sort by (e.g. 'length').
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to sort by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of sorted elements.
|
||||
* @example
|
||||
@@ -2718,6 +2871,7 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
*/
|
||||
@@ -2771,6 +2925,7 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
@@ -2785,9 +2940,7 @@
|
||||
* _.where(stooges, { 'age': 40 });
|
||||
* // => [{ 'name': 'moe', 'age': 40 }]
|
||||
*/
|
||||
function where(collection, properties) {
|
||||
return filter(collection, properties);
|
||||
}
|
||||
var where = filter;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -2857,13 +3010,21 @@
|
||||
* the first elements the `callback` returns truthy for are returned. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head, take
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n] The function called per element or
|
||||
* the number of elements to return.
|
||||
* @param {Function|Object|Number|String} [callback|n] The function called per
|
||||
* element or the number of elements to return. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the first element(s) of `array`.
|
||||
* @example
|
||||
@@ -2878,6 +3039,25 @@
|
||||
* return num < 3;
|
||||
* });
|
||||
* // => [1, 2]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'organic': true },
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.first(food, 'organic');
|
||||
* // => [{ 'name': 'banana', 'organic': true }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'type': 'fruit' },
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.first(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
|
||||
*/
|
||||
function first(array, callback, thisArg) {
|
||||
if (array) {
|
||||
@@ -2985,12 +3165,20 @@
|
||||
* from the result. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n=1] The function called per element or
|
||||
* the number of elements to exclude.
|
||||
* @param {Function|Object|Number|String} [callback|n=1] The function called per
|
||||
* element or the number of elements to exclude. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a slice of `array`.
|
||||
* @example
|
||||
@@ -3005,6 +3193,25 @@
|
||||
* return num > 1;
|
||||
* });
|
||||
* // => [1]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* { 'name': 'carrot', 'organic': true }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.initial(food, 'organic');
|
||||
* // => [{ 'name': 'beet', 'organic': false }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' },
|
||||
* { 'name': 'carrot', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.initial(food, { 'type': 'vegetable' });
|
||||
* // => [{ 'name': 'banana', 'type': 'fruit' }]
|
||||
*/
|
||||
function initial(array, callback, thisArg) {
|
||||
if (!array) {
|
||||
@@ -3081,12 +3288,21 @@
|
||||
* the last elements the `callback` returns truthy for are returned. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n] The function called per element or
|
||||
* the number of elements to return.
|
||||
* @param {Function|Object|Number|String} [callback|n] The function called per
|
||||
* element or the number of elements to return. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the last element(s) of `array`.
|
||||
* @example
|
||||
@@ -3101,6 +3317,25 @@
|
||||
* return num > 1;
|
||||
* });
|
||||
* // => [2, 3]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* { 'name': 'carrot', 'organic': true }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.last(food, 'organic');
|
||||
* // => [{ 'name': 'carrot', 'organic': true }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' },
|
||||
* { 'name': 'carrot', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.last(food, { 'type': 'vegetable' });
|
||||
* // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
|
||||
*/
|
||||
function last(array, callback, thisArg) {
|
||||
if (array) {
|
||||
@@ -3245,13 +3480,21 @@
|
||||
* truthy for are excluded from the result. The `callback` is bound to `thisArg`
|
||||
* and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias drop, tail
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n=1] The function called per element or
|
||||
* the number of elements to exclude.
|
||||
* @param {Function|Object|Number|String} [callback|n=1] The function called per
|
||||
* element or the number of elements to exclude. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a slice of `array`.
|
||||
* @example
|
||||
@@ -3266,6 +3509,25 @@
|
||||
* return num < 3;
|
||||
* });
|
||||
* // => [3]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'organic': true },
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.rest(food, 'organic');
|
||||
* // => [{ 'name': 'beet', 'organic': false }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'type': 'fruit' },
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.rest(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'beet', 'type': 'vegetable' }]
|
||||
*/
|
||||
function rest(array, callback, thisArg) {
|
||||
if (typeof callback == 'function') {
|
||||
@@ -3288,16 +3550,23 @@
|
||||
* should be inserted into `array` in order to maintain the sort order of the
|
||||
* sorted `array`. If `callback` is passed, it will be executed for `value` and
|
||||
* each element in `array` to compute their sort ranking. The `callback` is
|
||||
* bound to `thisArg` and invoked with one argument; (value). The `callback`
|
||||
* argument may also be the name of a property to order by.
|
||||
* bound to `thisArg` and invoked with one argument; (value).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Mixed} value The value to evaluate.
|
||||
* @param {Function|String} [callback=identity|property] The function called
|
||||
* per iteration or property name to order by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Number} Returns the index at which the value should be inserted
|
||||
* into `array`.
|
||||
@@ -3306,6 +3575,7 @@
|
||||
* _.sortedIndex([20, 30, 50], 40);
|
||||
* // => 2
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
|
||||
* // => 2
|
||||
*
|
||||
@@ -3366,13 +3636,22 @@
|
||||
* element of `array` is passed through a callback` before uniqueness is computed.
|
||||
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias unique
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to process.
|
||||
* @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a duplicate-value-free array.
|
||||
* @example
|
||||
@@ -3388,6 +3667,10 @@
|
||||
*
|
||||
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
function uniq(array, isSorted, callback, thisArg) {
|
||||
var index = -1,
|
||||
|
||||
66
dist/lodash.min.js
vendored
66
dist/lodash.min.js
vendored
@@ -4,36 +4,36 @@
|
||||
* Build: `lodash strict modern -o ./dist/lodash.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n,t){"use strict";function r(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=_t(t))&&_t(r);if(r)n=n==r||_t(n)==r&&!h(n);else{var e=W;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!w(t)||t instanceof t?(Yt(n,function(n,t){e=t}),n=e===W||bt.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||et);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";
|
||||
(bt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return bt.call(o,e)&&-1<P(o[e],r)}return-1<P(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function f(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=Q,a=n.apply(c,a),j(a)?a:c):n.apply(c,a)
|
||||
}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function a(n,r,e){if(!n)return G;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=tr(n);return function(r){for(var e=o.length,u=W;e--&&(u=b(r[o[e]],n[o[e]],t,t,rt)););return u}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function c(){for(var n,t={g:Ut,b:"k(m)",c:"",h:"",l:"",m:L},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];
|
||||
return n=t.a,t.d=/^[^,]+/.exec(n)[0],r="'use strict';var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b&&(r+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?r+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(r+="for(i in m){",t.m&&(r+="if(",t.m&&(r+="h.call(m,i)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",Function("e,h,j,k,l,q,o,t","return function("+n+"){"+r+"}")(a,bt,h,nr,A,Ht,qt,jt)}function l(n){return"\\"+Jt[n]}function p(n){return rr[n]
|
||||
}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return er[n]}function h(n){return xt.call(n)==$t}function y(n){var t=[];return Zt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var f=n;if(typeof r=="function"&&(u=e,e=r,r=W),typeof e=="function"){e=typeof u=="undefined"?e:a(e,u,1);var f=e(f),c=typeof f!="undefined";c||(f=n)}if(u=j(f)){var l=xt.call(f);if(!Vt[l])return f;var p=nr(f)
|
||||
}if(!u||!r)return u&&!c?p?v(f):ur({},f):f;switch(u=Gt[l],l){case Dt:case Tt:return c?f:new u(+f);case Bt:case zt:return c?f:new u(f);case Mt:return c?f:u(f.source,ct.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(f=p?u(f.length):{},p&&(bt.call(n,"index")&&(f.index=n.index),bt.call(n,"input")&&(f.input=n.input))),o.push(n),i.push(f),(p?R:Zt)(c?f:n,function(n,u){f[u]=m(n,r,e,t,o,i)}),f}function d(n){var t=[];return Yt(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=tr(n),e=r.length,u={};++t<e;){var o=r[t];
|
||||
u[n[o]]=o}return u}function b(n,r,e,u,o,i,f){if(e){e=typeof u=="undefined"?e:a(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return W;if(l=xt.call(n),u=xt.call(r),l==$t&&(l=It),u==$t&&(u=It),l!=u)return W;switch(l){case Dt:case Tt:return+n==+r;case Bt:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Mt:case zt:return n==r+""}if(u=l==Ft,!u){if(n.__wrapped__||r.__wrapped__)return b(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,f);
|
||||
if(l!=It)return W;var l=n.constructor,p=r.constructor;if(l!=p&&(!w(l)||!(l instanceof l&&w(p)&&p instanceof p)))return W}for(i||(i=[]),f||(f=[]),l=i.length;l--;)if(i[l]==n)return f[l]==r;var s=0,c=L;if(i.push(n),f.push(r),u){if(s=r.length,c=o==rt||s==n.length)for(;s--&&(c=b(n[s],r[s],e,t,o,i,f)););return c}return Yt(r,function(r,u,a){return bt.call(a,u)?(s++,c=bt.call(n,u)&&b(n[u],r,e,t,o,i,f)):void 0}),c&&o!=rt&&Yt(n,function(n,t,r){return bt.call(r,t)?c=-1<--s:void 0}),c}function w(n){return typeof n=="function"
|
||||
}function j(n){return n?Ht[typeof n]:W}function x(n){return typeof n=="number"||xt.call(n)==Bt}function A(n){return typeof n=="string"||xt.call(n)==zt}function O(n,t,e){var u=arguments,o=0,i=2;if(!j(n))return n;if(e===rt)var f=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length,f=typeof(f=u[i-2])=="function"?a(f,u[--i],2):typeof(f=u[i-1])=="function"&&f);for(;++o<i;)(nr(u[o])?R:Zt)(u[o],function(t,e){var u,o,i=t,a=n[e];if(t&&((o=nr(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){a=l[i];
|
||||
break}u||(a=o?nr(a)?a:[]:r(a)?a:{},f&&(i=f(a,t),typeof i!="undefined"&&(a=i)),c.push(t),l.push(a),f||(a=O(a,t,rt,f,c,l)))}else f&&(i=f(a,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(a=i);n[e]=a});return n}function E(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?kt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):P(n,t,r)):Xt(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function q(n,t,r){var e=L;
|
||||
if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Xt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function k(n,t,r){var e=[];if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Xt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function N(n,t,r){var e;return t=a(t,r),R(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function R(n,t,r){if(t&&typeof r=="undefined"&&nr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==W;);}else Xt(n,t,r);
|
||||
return n}function $(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),nr(n))for(;++e<u;)o[e]=t(n[e],e,n);else Xt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function F(n,t,r){var e=-1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t){return $(n,t+"")}function T(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),nr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
|
||||
}else Xt(n,function(n,e,o){r=u?(u=W,n):t(r,n,e,o)});return r}function B(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=tr(n),u=i.length;return t=a(t,e,4),R(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=W,n[f]):t(r,n[f],f,a)}),r}function I(n,t,r){var e;if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Xt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++
|
||||
}else if(e=t,e==Q||r)return n[0];return v(n,0,Nt(kt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];nr(o)?wt.apply(u,t?o:z(o)):u.push(o)}return u}function P(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?kt(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==Q||r?1:kt(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=W);var c=!t&&75<=o;if(c)var l={};for(r&&(f=[],r=a(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=bt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>P(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function V(n,t){return Kt||At&&2<arguments.length?At.call.apply(At,arguments):f(n,t,v(arguments,2))}function G(n){return n}function H(n){R(d(n),function(t){var r=e[t]=n[t];
|
||||
e.prototype[t]=function(){var n=[this.__wrapped__];return wt.apply(n,arguments),new e(r.apply(e,n))}})}function J(){return this.__wrapped__}var L=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z=[],nt={},tt=0,rt=nt,et=30,ut=n._,ot=/&(?:amp|lt|gt|quot|#x27);/g,it=/\b__p\+='';/g,ft=/\b(__p\+=)''\+/g,at=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/\w*$/,lt=RegExp("^"+(nt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,st=/<%=([\s\S]+?)%>/g,vt=/($^)/,gt=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,yt=Math.ceil,mt=Z.concat,dt=Math.floor,_t=lt.test(_t=Object.getPrototypeOf)&&_t,bt=nt.hasOwnProperty,wt=Z.push,jt=nt.propertyIsEnumerable,xt=nt.toString,At=lt.test(At=v.bind)&&At,Ot=lt.test(Ot=Array.isArray)&&Ot,Et=n.isFinite,St=n.isNaN,qt=lt.test(qt=Object.keys)&&qt,kt=Math.max,Nt=Math.min,Rt=Math.random,$t="[object Arguments]",Ft="[object Array]",Dt="[object Boolean]",Tt="[object Date]",Bt="[object Number]",It="[object Object]",Mt="[object RegExp]",zt="[object String]",Pt=!!n.attachEvent,Ct=At&&!/\n|true/.test(At+Pt),Kt=At&&!Ct,Ut=qt&&(Pt||Ct),Vt={"[object Function]":W};
|
||||
Vt[$t]=Vt[Ft]=Vt[Dt]=Vt[Tt]=Vt[Bt]=Vt[It]=Vt[Mt]=Vt[zt]=L;var Gt={};Gt[Ft]=Array,Gt[Dt]=Boolean,Gt[Tt]=Date,Gt[It]=Object,Gt[Bt]=Number,Gt[Mt]=RegExp,Gt[zt]=String;var Ht={"boolean":W,"function":L,object:L,number:W,string:W,undefined:W},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:st,variable:"",imports:{_:e}};var Lt={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},Qt={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},Wt={l:"if(!q[typeof m])return u;"+Qt.l,b:W},Xt=c(Qt),Yt=c(Qt,Wt,{m:W}),Zt=c(Qt,Wt),nr=Ot||function(n){return n instanceof Array||xt.call(n)==Ft
|
||||
},tr=qt?function(n){return j(n)?qt(n):[]}:y,rr={"&":"&","<":"<",">":">",'"':""","'":"'"},er=_(rr),ur=c(Lt),or=c(Lt,{h:"if(u[i]==null)"+Lt.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==xt.call(n)}),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},e.assign=ur,e.at=function(n){for(var t=-1,r=mt.apply(Z,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},e.bind=V,e.bindAll=function(n){for(var t=mt.apply(Z,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];
|
||||
n[u]=V(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",bt.call(e,r)?e[r]++:e[r]=1}),e},e.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;
|
||||
return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=or,e.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=mt.apply(Z,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.filter=k,e.flatten=z,e.forEach=R,e.forIn=Yt,e.forOwn=Zt,e.functions=d,e.groupBy=function(n,t,r){var e={};
|
||||
return t=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",(bt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,Nt(kt(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=bt.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>P(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;
|
||||
a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return R(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=tr,e.map=$,e.max=F,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return bt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)
|
||||
}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=mt.apply(Z,arguments);return Yt(n,function(n,r,i){(e?!t(n,r,i):0>P(o,r,1))&&(u[r]=n)}),u},e.once=function(n){var t,r;return function(){return t?r:(t=L,r=n.apply(this,arguments),n=Q,r)}},e.pairs=function(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
|
||||
u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),Q,rt)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=mt.apply(Z,arguments),i=j(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Yt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=D,e.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=kt(0,yt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),k(n,function(n,r,e){return!t(n,r,e)
|
||||
})},e.rest=C,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return R(n,function(n){var r=dt(Rt()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),R(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
|
||||
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return U(mt.apply(Z,arguments))},e.uniq=U,e.values=E,e.where=function(n,t){return k(n,t)},e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];
|
||||
return wt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?F(D(arguments,"length")):0,e=Array(r);++t<r;)e[t]=D(arguments,t);return e},e.collect=$,e.drop=C,e.each=R,e.extend=ur,e.methods=d,e.select=k,e.tail=C,e.unique=U,H(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,L,t,r)},e.contains=S,e.escape=function(n){return n==Q?"":(n+"").replace(gt,p)},e.every=q,e.find=N,e.has=function(n,t){return n?bt.call(n,t):W},e.identity=G,e.indexOf=P,e.isArguments=h,e.isArray=nr,e.isBoolean=function(n){return n===L||n===W||xt.call(n)==Dt
|
||||
},e.isDate=function(n){return n instanceof Date||xt.call(n)==Tt},e.isElement=function(n){return n?1===n.nodeType:W},e.isEmpty=function(n){var t=L;if(!n)return t;var r=xt.call(n),e=n.length;return r==Ft||r==zt||r==$t||r==It&&typeof e=="number"&&w(n.splice)?!e:(Zt(n,function(){return t=W}),t)},e.isEqual=b,e.isFinite=function(n){return Et(n)&&!St(parseFloat(n))},e.isFunction=w,e.isNaN=function(n){return x(n)&&n!=+n},e.isNull=function(n){return n===Q},e.isNumber=x,e.isObject=j,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||xt.call(n)==Mt
|
||||
},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kt(0,e+r):Nt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=H,e.noConflict=function(){return n._=ut,this},e.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+dt(Rt()*((+t||0)-n+1))},e.reduce=T,e.reduceRight=B,e.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:tr(n).length
|
||||
},e.some=I,e.sortedIndex=K,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=or({},u,o);var i,f=or({},u.imports,o.imports),o=tr(f),f=E(f),a=0,c=u.interpolate||vt,p="__p+='";n.replace(RegExp((u.escape||vt).source+"|"+c.source+"|"+(c===st?pt:vt).source+"|"+(u.evaluate||vt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(ht,l),r&&(p+="'+__e("+r+")+'"),o&&(i=L,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(it,""):p).replace(ft,"$1").replace(at,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
|
||||
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==Q?"":(n+"").replace(ot,g)},e.uniqueId=function(n){var t=++tt;return(n==Q?"":n+"")+t},e.all=q,e.any=I,e.detect=N,e.foldl=T,e.foldr=B,e.include=S,e.inject=T,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return wt.apply(t,arguments),n.apply(e,t)})}),e.first=M,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
|
||||
for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,kt(0,u-e))}},e.take=M,e.head=M,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r);return t==Q||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.0-rc.3",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=J,e.prototype.valueOf=J,Xt(["join","pop","shift"],function(n){var t=Z[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}
|
||||
}),Xt(["push","reverse","sort","unshift"],function(n){var t=Z[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xt(["concat","slice","splice"],function(n){var t=Z[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments))}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=e)._=e:X._=e:n._=e})(this);
|
||||
;(function(n,t){"use strict";function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||Z);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(yt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return yt.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;
|
||||
if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=s(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(p.prototype=n.prototype,c=new p,p.prototype=null,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)}var o=b(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,r,e){if(!n)return V;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=Xt(n);return function(r){for(var e=o.length,u=!1;e--&&(u=d(r[o[e]],n[o[e]],t,t,Y)););return u
|
||||
}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function a(){for(var n,t={g:zt,b:"k(m)",c:"",h:"",l:"",m:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];return n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="'use strict';var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b&&(e+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?e+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(e+="for(i in m){",t.m&&(e+="if(",t.m&&(e+="h.call(m,i)"),e+="){"),e+=t.h+";",t.m&&(e+="}"),e+="}"),t.b&&(e+="}"),e+=t.c+";return u",r("e,h,j,k,l,q,o,t","return function("+n+"){"+e+"}")(f,yt,g,Wt,x,Kt,At,_t)
|
||||
}function c(n){return"\\"+Ut[n]}function l(n){return Yt[n]}function p(){}function s(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function v(n){return Zt[n]}function g(n){return dt.call(n)==qt}function h(n){var t=[];return Qt(n,function(n,r){t.push(r)}),t}function y(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=!1),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";
|
||||
c||(a=n)}if(u=w(a)){var l=dt.call(a);if(!Pt[l])return a;var p=Wt(a)}if(!u||!r)return u&&!c?p?s(a):nr({},a):a;switch(u=Ct[l],l){case Nt:case Rt:return c?a:new u(+a);case $t:case Tt:return c?a:new u(a);case Dt:return c?a:u(a.source,ot.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=p?u(a.length):{},p&&(yt.call(n,"index")&&(a.index=n.index),yt.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(p?N:Qt)(c?a:n,function(n,u){a[u]=y(n,r,e,t,o,i)}),a}function m(n){var t=[];
|
||||
return Lt(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Xt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return!1;if(null==n||null==r)return n===r;if(l=dt.call(n),u=dt.call(r),l==qt&&(l=Ft),u==qt&&(u=Ft),l!=u)return!1;
|
||||
switch(l){case Nt:case Rt:return+n==+r;case $t:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Dt:case Tt:return n==r+""}if(u=l==kt,!u){if(n.__wrapped__||r.__wrapped__)return d(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);if(l!=Ft)return!1;var l=n.constructor,p=r.constructor;if(l!=p&&(!b(l)||!(l instanceof l&&b(p)&&p instanceof p)))return!1}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var s=0,c=!0;if(i.push(n),a.push(r),u){if(s=r.length,c=o==Y||s==n.length)for(;s--&&(c=d(n[s],r[s],e,t,o,i,a)););return c
|
||||
}return Lt(r,function(r,u,f){return yt.call(f,u)?(s++,c=yt.call(n,u)&&d(n[u],r,e,t,o,i,a)):void 0}),c&&o!=Y&&Lt(n,function(n,t,r){return yt.call(r,t)?c=-1<--s:void 0}),c}function b(n){return typeof n=="function"}function w(n){return n?Kt[typeof n]:!1}function j(n){return typeof n=="number"||dt.call(n)==$t}function x(n){return typeof n=="string"||dt.call(n)==Tt}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===Y)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?f(i,e[--o],2):typeof(i=e[o-1])=="function"&&i);
|
||||
for(;++u<o;)(Wt(e[u])?N:Qt)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=Wt(t))||rr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?Wt(f)?f:[]:rr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=A(f,t,Y,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function O(n){for(var t=-1,r=Xt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function E(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?Ot(0,u+r):r)||0,typeof u=="number"?o=-1<(x(n)?n.indexOf(t,r):z(n,t,r)):Jt(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
}),o}function S(n,t,r){var e=!0;if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Jt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function q(n,t,r){var e=[];if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Jt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function k(n,t,r){var e;return t=f(t,r),N(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function N(n,t,r){if(t&&typeof r=="undefined"&&Wt(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else Jt(n,t,r);
|
||||
return n}function R(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),Wt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Jt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function $(n,t,r){var e=-1/0,o=e;if(!t&&Wt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Jt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function F(n,t){return R(n,t+"")}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),Wt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
|
||||
}else Jt(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Xt(n),u=i.length;return t=f(t,e,4),N(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=!1,n[f]):t(r,n[f],f,a)}),r}function B(n,t,r){var e;if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Jt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++
|
||||
}else if(e=t,null==e||r)return n[0];return s(n,0,Et(Ot(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Wt(o)?mt.apply(u,t?o:M(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ot(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=null==t||r?1:Ot(0,t);return s(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?f(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=yt.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Mt||bt&&2<arguments.length?bt.call.apply(bt,arguments):i(n,t,s(arguments,2))}function V(n){return n}function G(n){N(m(n),function(t){var e=r[t]=n[t];
|
||||
r.prototype[t]=function(){var n=[this.__wrapped__];return mt.apply(n,arguments),new r(e.apply(r,n))}})}function H(){return this.__wrapped__}var J=typeof exports=="object"&&exports,L=typeof global=="object"&&global;L.global===L&&(n=L);var Q=[],W={},X=0,Y=W,Z=30,nt=n._,tt=/&(?:amp|lt|gt|quot|#x27);/g,rt=/\b__p\+='';/g,et=/\b(__p\+=)''\+/g,ut=/(__e\(.*?\)|\b__t\))\+'';/g,ot=/\w*$/,it=RegExp("^"+(W.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ft=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,at=/<%=([\s\S]+?)%>/g,ct=/($^)/,lt=/[&<>"']/g,pt=/['\n\r\t\u2028\u2029\\]/g,st=Math.ceil,vt=Q.concat,gt=Math.floor,ht=it.test(ht=Object.getPrototypeOf)&&ht,yt=W.hasOwnProperty,mt=Q.push,_t=W.propertyIsEnumerable,dt=W.toString,bt=it.test(bt=s.bind)&&bt,wt=it.test(wt=Array.isArray)&&wt,jt=n.isFinite,xt=n.isNaN,At=it.test(At=Object.keys)&&At,Ot=Math.max,Et=Math.min,St=Math.random,qt="[object Arguments]",kt="[object Array]",Nt="[object Boolean]",Rt="[object Date]",$t="[object Number]",Ft="[object Object]",Dt="[object RegExp]",Tt="[object String]",Bt=!!n.attachEvent,It=bt&&!/\n|true/.test(bt+Bt),Mt=bt&&!It,zt=At&&(Bt||It),Pt={"[object Function]":!1};
|
||||
Pt[qt]=Pt[kt]=Pt[Nt]=Pt[Rt]=Pt[$t]=Pt[Ft]=Pt[Dt]=Pt[Tt]=!0;var Ct={};Ct[kt]=Array,Ct[Nt]=Boolean,Ct[Rt]=Date,Ct[Ft]=Object,Ct[$t]=Number,Ct[Dt]=RegExp,Ct[Tt]=String;var Kt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Ut={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:at,variable:"",imports:{_:r}};var Vt={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},Gt={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},Ht={l:"if(!q[typeof m])return u;"+Gt.l,b:!1},Jt=a(Gt),Lt=a(Gt,Ht,{m:!1}),Qt=a(Gt,Ht),Wt=wt||function(n){return n instanceof Array||dt.call(n)==kt
|
||||
},Xt=At?function(n){return w(n)?At(n):[]}:h,Yt={"&":"&","<":"<",">":">",'"':""","'":"'"},Zt=_(Yt),nr=a(Vt),tr=a(Vt,{h:"if(u[i]==null)"+Vt.h});b(/x/)&&(b=function(n){return n instanceof Function||"[object Function]"==dt.call(n)});var rr=function(n){if(!n||typeof n!="object")return!1;var t=n.valueOf,r=typeof t=="function"&&(r=ht(t))&&ht(r);if(r)n=n==r||ht(n)==r&&!g(n);else{var e=!1;!n||typeof n!="object"||g(n)?n=e:(t=n.constructor,!b(t)||t instanceof t?(Lt(n,function(n,t){e=t}),n=!1===e||yt.call(n,e)):n=e)
|
||||
}return n};r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=nr,r.at=function(n){for(var t=-1,r=vt.apply(Q,s(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},r.bind=U,r.bindAll=function(n){for(var t=vt.apply(Q,arguments),r=1<t.length?0:(t=m(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,s(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];
|
||||
u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",yt.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=null,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=tr,r.defer=function(n){var r=s(arguments,1);
|
||||
return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=s(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=vt.apply(Q,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=q,r.flatten=M,r.forEach=N,r.forIn=Lt,r.forOwn=Qt,r.functions=m,r.groupBy=function(n,t,r){var e={};return t=f(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",(yt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];
|
||||
var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return s(n,0,Et(Ot(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=yt.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;a.push(l)}}return a},r.invert=_,r.invoke=function(n,t){var r=s(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
|
||||
return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=Xt,r.map=R,r.max=$,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return yt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=A,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&Wt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Jt(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
|
||||
t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=vt.apply(Q,arguments);return Lt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},r.pairs=function(n){for(var t=-1,r=Xt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,s(arguments,1))},r.partialRight=function(n){return i(n,s(arguments,1),null,Y)
|
||||
},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=vt.apply(Q,arguments),i=w(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),Lt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=F,r.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Ot(0,st((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),q(n,function(n,r,e){return!t(n,r,e)})},r.rest=P,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
|
||||
return N(n,function(n){var r=gt(St()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),N(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=null,f=a,u=n.apply(o,e)),u
|
||||
}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?s(n):O(n)},r.union=function(){return K(vt.apply(Q,arguments))},r.uniq=K,r.values=O,r.where=q,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];return mt.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?$(F(arguments,"length")):0,e=Array(r);++t<r;)e[t]=F(arguments,t);
|
||||
return e},r.collect=R,r.drop=P,r.each=N,r.extend=nr,r.methods=m,r.select=q,r.tail=P,r.unique=K,G(r),r.clone=y,r.cloneDeep=function(n,t,r){return y(n,!0,t,r)},r.contains=E,r.escape=function(n){return null==n?"":(n+"").replace(lt,l)},r.every=S,r.find=k,r.has=function(n,t){return n?yt.call(n,t):!1},r.identity=V,r.indexOf=z,r.isArguments=g,r.isArray=Wt,r.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==Nt},r.isDate=function(n){return n instanceof Date||dt.call(n)==Rt},r.isElement=function(n){return n?1===n.nodeType:!1
|
||||
},r.isEmpty=function(n){var t=!0;if(!n)return t;var r=dt.call(n),e=n.length;return r==kt||r==Tt||r==qt||r==Ft&&typeof e=="number"&&b(n.splice)?!e:(Qt(n,function(){return t=!1}),t)},r.isEqual=d,r.isFinite=function(n){return jt(n)&&!xt(parseFloat(n))},r.isFunction=b,r.isNaN=function(n){return j(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=j,r.isObject=w,r.isPlainObject=rr,r.isRegExp=function(n){return n instanceof RegExp||dt.call(n)==Dt},r.isString=x,r.isUndefined=function(n){return typeof n=="undefined"
|
||||
},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ot(0,e+r):Et(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=G,r.noConflict=function(){return n._=nt,this},r.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+gt(St()*((+t||0)-n+1))},r.reduce=D,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return b(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Xt(n).length},r.some=B,r.sortedIndex=C,r.template=function(n,e,u){var o=r.templateSettings;
|
||||
n||(n=""),u=tr({},u,o);var i,f=tr({},u.imports,o.imports),o=Xt(f),f=O(f),a=0,l=u.interpolate||ct,p="__p+='";n.replace(RegExp((u.escape||ct).source+"|"+l.source+"|"+(l===at?ft:ct).source+"|"+(u.evaluate||ct).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(pt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=!0,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(rt,""):p).replace(et,"$1").replace(ut,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
|
||||
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return null==n?"":(n+"").replace(tt,v)},r.uniqueId=function(n){var t=++X;return(null==n?"":n+"")+t},r.all=S,r.any=B,r.detect=k,r.foldl=D,r.foldr=T,r.include=E,r.inject=D,Qt(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return mt.apply(t,arguments),n.apply(r,t)})}),r.first=I,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
|
||||
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return s(n,Ot(0,u-e))}},r.take=I,r.head=I,Qt(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=H,r.prototype.valueOf=H,Jt(["join","pop","shift"],function(n){var t=Q[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||
}}),Jt(["push","reverse","sort","unshift"],function(n){var t=Q[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Jt(["concat","slice","splice"],function(n){var t=Q[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):J?typeof module=="object"&&module&&module.exports==J?(module.exports=r)._=r:J._=r:n._=r})(this);
|
||||
387
dist/lodash.underscore.js
vendored
387
dist/lodash.underscore.js
vendored
@@ -1127,6 +1127,9 @@
|
||||
(!b || (otherType != 'function' && otherType != 'object'))) {
|
||||
return false;
|
||||
}
|
||||
if (a == null || b == null) {
|
||||
return a === b;
|
||||
}
|
||||
var className = toString.call(a),
|
||||
otherClass = toString.call(b);
|
||||
|
||||
@@ -1585,18 +1588,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys returned from running each element of
|
||||
* `collection` through a `callback`. The corresponding value of each key is
|
||||
* the number of times the key was returned by `callback`. The `callback` is
|
||||
* bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to count by (e.g. 'length').
|
||||
* Creates an object composed of keys returned from running each element of the
|
||||
* `collection` through the given `callback`. The corresponding value of each key
|
||||
* is the number of times the key was returned by the `callback`. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to count by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -1626,12 +1636,21 @@
|
||||
* `collection`. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias all
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Boolean} Returns `true` if all elements pass the callback check,
|
||||
* else `false`.
|
||||
@@ -1645,13 +1664,13 @@
|
||||
* { 'name': 'larry', 'age': 50 }
|
||||
* ];
|
||||
*
|
||||
* // using callback "where" shorthand
|
||||
* _.every(stooges, { 'age': 50 });
|
||||
* // => false
|
||||
*
|
||||
* // using callback "pluck" shorthand
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.every(stooges, 'age');
|
||||
* // => true
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.every(stooges, { 'age': 50 });
|
||||
* // => false
|
||||
*/
|
||||
function every(collection, callback, thisArg) {
|
||||
var result = true;
|
||||
@@ -1679,18 +1698,40 @@
|
||||
* the `callback` returns truthy for. The `callback` is bound to `thisArg` and
|
||||
* invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias select
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of elements that passed the callback check.
|
||||
* @example
|
||||
*
|
||||
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
* // => [2, 4, 6]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.filter(food, 'organic');
|
||||
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.filter(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
|
||||
*/
|
||||
function filter(collection, callback, thisArg) {
|
||||
var result = [];
|
||||
@@ -1717,18 +1758,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Examines each element in a `collection`, returning the first that the
|
||||
* `callback` returns truthy for. The function returns as soon as it finds
|
||||
* an acceptable element, and does not iterate over the entire `collection`.
|
||||
* The `callback` is bound to `thisArg` and invoked with three arguments;
|
||||
* (value, index|key, collection).
|
||||
* Examines each element in a `collection`, returning the first that the `callback`
|
||||
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias detect
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the element that passed the callback check,
|
||||
* else `undefined`.
|
||||
@@ -1744,11 +1792,11 @@
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using callback "where" shorthand
|
||||
* // using "_.where" callback shorthand
|
||||
* var veggie = _.find(food, { 'type': 'vegetable' });
|
||||
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
||||
*
|
||||
* // using callback "pluck" shorthand
|
||||
* // using "_.pluck" callback shorthand
|
||||
* var healthy = _.find(food, 'organic');
|
||||
* // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
|
||||
*/
|
||||
@@ -1807,18 +1855,25 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys returned from running each element of
|
||||
* `collection` through a `callback`. The corresponding value of each key is an
|
||||
* array of elements passed to `callback` that returned the key. The `callback`
|
||||
* Creates an object composed of keys returned from running each element of the
|
||||
* `collection` through the `callback`. The corresponding value of each key is
|
||||
* an array of elements passed to `callback` that returned the key. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to group by (e.g. 'length').
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to group by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -1829,6 +1884,7 @@
|
||||
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
* // => { '4': [4.2], '6': [6.1, 6.4] }
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.groupBy(['one', 'two', 'three'], 'length');
|
||||
* // => { '3': ['one', 'two'], '5': ['three'] }
|
||||
*/
|
||||
@@ -1880,15 +1936,24 @@
|
||||
|
||||
/**
|
||||
* Creates an array of values by running each element in the `collection`
|
||||
* through a `callback`. The `callback` is bound to `thisArg` and invoked with
|
||||
* through the `callback`. The `callback` is bound to `thisArg` and invoked with
|
||||
* three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias collect
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of the results of each `callback` execution.
|
||||
* @example
|
||||
@@ -1898,6 +1963,15 @@
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
* { 'name': 'larry', 'age': 50 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.map(stooges, 'name');
|
||||
* // => ['moe', 'larry']
|
||||
*/
|
||||
function map(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
@@ -1923,11 +1997,20 @@
|
||||
* criterion by which the value is ranked. The `callback` is bound to
|
||||
* `thisArg` and invoked with three arguments; (value, index, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the maximum value.
|
||||
* @example
|
||||
@@ -1942,6 +2025,10 @@
|
||||
*
|
||||
* _.max(stooges, function(stooge) { return stooge.age; });
|
||||
* // => { 'name': 'larry', 'age': 50 };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.max(stooges, 'age');
|
||||
* // => { 'name': 'larry', 'age': 50 };
|
||||
*/
|
||||
function max(collection, callback, thisArg) {
|
||||
var computed = -Infinity,
|
||||
@@ -1977,11 +2064,20 @@
|
||||
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
|
||||
* and invoked with three arguments; (value, index, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the minimum value.
|
||||
* @example
|
||||
@@ -1996,6 +2092,10 @@
|
||||
*
|
||||
* _.min(stooges, function(stooge) { return stooge.age; });
|
||||
* // => { 'name': 'moe', 'age': 40 };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.min(stooges, 'age');
|
||||
* // => { 'name': 'moe', 'age': 40 };
|
||||
*/
|
||||
function min(collection, callback, thisArg) {
|
||||
var computed = Infinity,
|
||||
@@ -2026,8 +2126,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value of a specified property from all elements in
|
||||
* the `collection`.
|
||||
* Retrieves the value of a specified property from all elements in the `collection`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -2135,11 +2234,20 @@
|
||||
* The opposite of `_.filter`, this method returns the elements of a
|
||||
* `collection` that `callback` does **not** return truthy for.
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of elements that did **not** pass the
|
||||
* callback check.
|
||||
@@ -2147,6 +2255,19 @@
|
||||
*
|
||||
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
* // => [1, 3, 5]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.reject(food, 'organic');
|
||||
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.reject(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
|
||||
*/
|
||||
function reject(collection, callback, thisArg) {
|
||||
callback = createCallback(callback, thisArg);
|
||||
@@ -2213,12 +2334,21 @@
|
||||
* does not iterate over the entire `collection`. The `callback` is bound to
|
||||
* `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias any
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Boolean} Returns `true` if any element passes the callback check,
|
||||
* else `false`.
|
||||
@@ -2226,6 +2356,19 @@
|
||||
*
|
||||
* _.some([null, 0, 'yes', false], Boolean);
|
||||
* // => true
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.some(food, 'organic');
|
||||
* // => true
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.some(food, { 'type': 'meat' });
|
||||
* // => false
|
||||
*/
|
||||
function some(collection, callback, thisArg) {
|
||||
var result;
|
||||
@@ -2250,16 +2393,24 @@
|
||||
|
||||
/**
|
||||
* Creates an array, stable sorted in ascending order by the results of
|
||||
* running each element of `collection` through a `callback`. The `callback`
|
||||
* running each element of `collection` through the `callback`. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
|
||||
* The `callback` argument may also be the name of a property to sort by (e.g. 'length').
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|String} callback|property The function called per iteration
|
||||
* or property name to sort by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new array of sorted elements.
|
||||
* @example
|
||||
@@ -2270,6 +2421,7 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
*/
|
||||
@@ -2323,6 +2475,7 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
@@ -2410,13 +2563,21 @@
|
||||
* the first elements the `callback` returns truthy for are returned. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head, take
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n] The function called per element or
|
||||
* the number of elements to return.
|
||||
* @param {Function|Object|Number|String} [callback|n] The function called per
|
||||
* element or the number of elements to return. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the first element(s) of `array`.
|
||||
* @example
|
||||
@@ -2431,6 +2592,25 @@
|
||||
* return num < 3;
|
||||
* });
|
||||
* // => [1, 2]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'organic': true },
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.first(food, 'organic');
|
||||
* // => [{ 'name': 'banana', 'organic': true }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'type': 'fruit' },
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.first(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
|
||||
*/
|
||||
function first(array, callback, thisArg) {
|
||||
if (array) {
|
||||
@@ -2538,12 +2718,20 @@
|
||||
* from the result. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n=1] The function called per element or
|
||||
* the number of elements to exclude.
|
||||
* @param {Function|Object|Number|String} [callback|n=1] The function called per
|
||||
* element or the number of elements to exclude. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a slice of `array`.
|
||||
* @example
|
||||
@@ -2558,6 +2746,25 @@
|
||||
* return num > 1;
|
||||
* });
|
||||
* // => [1]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* { 'name': 'carrot', 'organic': true }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.initial(food, 'organic');
|
||||
* // => [{ 'name': 'beet', 'organic': false }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' },
|
||||
* { 'name': 'carrot', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.initial(food, { 'type': 'vegetable' });
|
||||
* // => [{ 'name': 'banana', 'type': 'fruit' }]
|
||||
*/
|
||||
function initial(array, callback, thisArg) {
|
||||
if (!array) {
|
||||
@@ -2622,12 +2829,21 @@
|
||||
* the last elements the `callback` returns truthy for are returned. The `callback`
|
||||
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n] The function called per element or
|
||||
* the number of elements to return.
|
||||
* @param {Function|Object|Number|String} [callback|n] The function called per
|
||||
* element or the number of elements to return. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the last element(s) of `array`.
|
||||
* @example
|
||||
@@ -2642,6 +2858,25 @@
|
||||
* return num > 1;
|
||||
* });
|
||||
* // => [2, 3]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* { 'name': 'carrot', 'organic': true }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.last(food, 'organic');
|
||||
* // => [{ 'name': 'carrot', 'organic': true }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' },
|
||||
* { 'name': 'carrot', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.last(food, { 'type': 'vegetable' });
|
||||
* // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
|
||||
*/
|
||||
function last(array, callback, thisArg) {
|
||||
if (array) {
|
||||
@@ -2786,13 +3021,21 @@
|
||||
* truthy for are excluded from the result. The `callback` is bound to `thisArg`
|
||||
* and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias drop, tail
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Number} [callback|n=1] The function called per element or
|
||||
* the number of elements to exclude.
|
||||
* @param {Function|Object|Number|String} [callback|n=1] The function called per
|
||||
* element or the number of elements to exclude. If a string or object is passed,
|
||||
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a slice of `array`.
|
||||
* @example
|
||||
@@ -2807,6 +3050,25 @@
|
||||
* return num < 3;
|
||||
* });
|
||||
* // => [3]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'banana', 'organic': true },
|
||||
* { 'name': 'beet', 'organic': false },
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.rest(food, 'organic');
|
||||
* // => [{ 'name': 'beet', 'organic': false }]
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'type': 'fruit' },
|
||||
* { 'name': 'banana', 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* // using "_.where" callback shorthand
|
||||
* _.rest(food, { 'type': 'fruit' });
|
||||
* // => [{ 'name': 'beet', 'type': 'vegetable' }]
|
||||
*/
|
||||
function rest(array, callback, thisArg) {
|
||||
if (typeof callback == 'function') {
|
||||
@@ -2829,16 +3091,23 @@
|
||||
* should be inserted into `array` in order to maintain the sort order of the
|
||||
* sorted `array`. If `callback` is passed, it will be executed for `value` and
|
||||
* each element in `array` to compute their sort ranking. The `callback` is
|
||||
* bound to `thisArg` and invoked with one argument; (value). The `callback`
|
||||
* argument may also be the name of a property to order by.
|
||||
* bound to `thisArg` and invoked with one argument; (value).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Mixed} value The value to evaluate.
|
||||
* @param {Function|String} [callback=identity|property] The function called
|
||||
* per iteration or property name to order by.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Number} Returns the index at which the value should be inserted
|
||||
* into `array`.
|
||||
@@ -2847,6 +3116,7 @@
|
||||
* _.sortedIndex([20, 30, 50], 40);
|
||||
* // => 2
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
|
||||
* // => 2
|
||||
*
|
||||
@@ -2907,13 +3177,22 @@
|
||||
* element of `array` is passed through a callback` before uniqueness is computed.
|
||||
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
|
||||
*
|
||||
* If a property name is passed for `callback`, the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is passed for `callback`, the created "_.where" style callback
|
||||
* will return `true` for elements that have the propeties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias unique
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to process.
|
||||
* @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a string or object is passed, it will be used to create a
|
||||
* "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a duplicate-value-free array.
|
||||
* @example
|
||||
@@ -2929,6 +3208,10 @@
|
||||
*
|
||||
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
function uniq(array, isSorted, callback, thisArg) {
|
||||
var index = -1,
|
||||
|
||||
17
dist/lodash.underscore.min.js
vendored
17
dist/lodash.underscore.min.js
vendored
@@ -8,14 +8,15 @@
|
||||
}return r<e?-1:1}function i(n,t,r){function e(){var a=arguments,f=o?this:t;return u||(n=t[i]),r.length&&(a=a.length?(a=p(a),r.concat(a)):r),this instanceof e?(l.prototype=n.prototype,f=new l,l.prototype=K,a=n.apply(f,a),w(a)?a:f):n.apply(f,a)}var u=j(n),o=!r,i=t;return o&&(r=t),u||(t=n),e}function a(n,t,r){if(!n)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Dt(n);return function(t){for(var r=u.length,e=L;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)
|
||||
}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function f(n){return"\\"+qt[n]}function c(n){return Mt[n]}function l(){}function p(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function s(n){return $t[n]}function v(n){return st.call(n)==jt}function h(n){var t,r=[],e=function(n,t){r.push(t)};if(n&&Tt[typeof n])for(t in e||(e=G),n)if(lt.call(n,t)&&e(n[t],t,n)===nt)break;
|
||||
return r}function g(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==K&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function m(n){for(var t=-1,r=Dt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n){if(!n)return J;if(Bt(n)||A(n))return!n.length;for(var t in n)if(lt.call(n,t))return L;
|
||||
return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(i=st.call(n),o=st.call(t),i!=o)return L;switch(i){case xt:case At:return+n==+t;case Et:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case St:case Nt:return n==t+""}if(o=i==wt,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=Ot)return L;var i=n.constructor,a=t.constructor;if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L
|
||||
}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return lt.call(o,r)?(c++,!(f=lt.call(n,r)&&b(n[r],t,e,u))&&nt):void 0}),f&&r(n,function(n,t,r){return lt.call(r,t)?!(f=-1<--c)&&nt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Tt[typeof n]:L}function x(n){return typeof n=="number"||st.call(n)==Et}function A(n){return typeof n=="string"||st.call(n)==Nt
|
||||
}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<C(n,t):e(n,function(n){return(r=n===t)&&nt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&nt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)
|
||||
});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,nt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==nt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)
|
||||
});return o}function q(n,t){return R(n,t+"")}function B(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function D(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)}),r}function M(n,t,r){var u;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&nt
|
||||
});return!!u}function $(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,dt(mt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?pt.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?mt(0,u+r):r||0)-1;else if(r)return e=U(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;
|
||||
return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:mt(0,t);return p(n,e)}function U(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function V(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>C(f,c))&&(r&&f.push(c),i.push(e))}return i}function W(n,t){return kt||vt&&2<arguments.length?vt.call.apply(vt,arguments):i(n,t,p(arguments,2))
|
||||
}function G(n){return n}function H(n){F(_(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return pt.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);var Y=[],X={},Z=0,nt=X,tt=n._,rt=/&(?:amp|lt|gt|quot|#x27);/g,et=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ut=/($^)/,ot=/[&<>"']/g,it=/['\n\r\t\u2028\u2029\\]/g,at=Math.ceil,ft=Y.concat,ct=Math.floor,lt=X.hasOwnProperty,pt=Y.push,st=X.toString,vt=et.test(vt=p.bind)&&vt,ht=et.test(ht=Array.isArray)&&ht,gt=n.isFinite,yt=n.isNaN,_t=et.test(_t=Object.keys)&&_t,mt=Math.max,dt=Math.min,bt=Math.random,jt="[object Arguments]",wt="[object Array]",xt="[object Boolean]",At="[object Date]",Et="[object Number]",Ot="[object Object]",St="[object RegExp]",Nt="[object String]",X=!!n.attachEvent,X=vt&&!/\n|true/.test(vt+X),kt=vt&&!X,Ft=(Ft={0:1,length:1},Y.splice.call(Ft,0,1),Ft[0]),Rt=arguments.constructor==Object,Tt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
|
||||
return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(n==K||t==K)return n===t;if(i=st.call(n),o=st.call(t),i!=o)return L;switch(i){case xt:case At:return+n==+t;case Et:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case St:case Nt:return n==t+""}if(o=i==wt,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=Ot)return L;var i=n.constructor,a=t.constructor;
|
||||
if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return lt.call(o,r)?(c++,!(f=lt.call(n,r)&&b(n[r],t,e,u))&&nt):void 0}),f&&r(n,function(n,t,r){return lt.call(r,t)?!(f=-1<--c)&&nt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Tt[typeof n]:L}function x(n){return typeof n=="number"||st.call(n)==Et
|
||||
}function A(n){return typeof n=="string"||st.call(n)==Nt}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<C(n,t):e(n,function(n){return(r=n===t)&&nt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&nt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
|
||||
t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,nt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==nt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;
|
||||
for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function q(n,t){return R(n,t+"")}function B(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function D(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)
|
||||
}),r}function M(n,t,r){var u;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&nt});return!!u}function $(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,dt(mt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?pt.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;
|
||||
if(typeof r=="number")e=(0>r?mt(0,u+r):r||0)-1;else if(r)return e=U(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:mt(0,t);return p(n,e)}function U(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function V(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];
|
||||
var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>C(f,c))&&(r&&f.push(c),i.push(e))}return i}function W(n,t){return kt||vt&&2<arguments.length?vt.call.apply(vt,arguments):i(n,t,p(arguments,2))}function G(n){return n}function H(n){F(_(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return pt.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);
|
||||
var Y=[],X={},Z=0,nt=X,tt=n._,rt=/&(?:amp|lt|gt|quot|#x27);/g,et=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ut=/($^)/,ot=/[&<>"']/g,it=/['\n\r\t\u2028\u2029\\]/g,at=Math.ceil,ft=Y.concat,ct=Math.floor,lt=X.hasOwnProperty,pt=Y.push,st=X.toString,vt=et.test(vt=p.bind)&&vt,ht=et.test(ht=Array.isArray)&&ht,gt=n.isFinite,yt=n.isNaN,_t=et.test(_t=Object.keys)&&_t,mt=Math.max,dt=Math.min,bt=Math.random,jt="[object Arguments]",wt="[object Array]",xt="[object Boolean]",At="[object Date]",Et="[object Number]",Ot="[object Object]",St="[object RegExp]",Nt="[object String]",X=!!n.attachEvent,X=vt&&!/\n|true/.test(vt+X),kt=vt&&!X,Ft=(Ft={0:1,length:1},Y.splice.call(Ft,0,1),Ft[0]),Rt=arguments.constructor==Object,Tt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
|
||||
u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?lt.call(n,"callee"):L});var Bt=ht||function(n){return Rt&&n instanceof Array||st.call(n)==wt},Dt=_t?function(n){return w(n)?_t(n):[]}:h,Mt={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=m(Mt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==st.call(n)}),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||
}},u.bind=W,u.bindAll=function(n){for(var t=ft.apply(Y,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=W(n[u],n)}return n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},u.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",lt.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=K,r||(o=n.apply(i,u))
|
||||
}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,t),f&&(o=n.apply(i,u)),o}},u.defaults=y,u.defer=function(n){var r=p(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},u.delay=function(n,r){var e=p(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},u.difference=function(n){for(var t=-1,r=n.length,e=ft.apply(Y,arguments),u=[];++t<r;){var o=n[t];0>C(e,o,r)&&u.push(o)}return u},u.filter=N,u.flatten=z,u.forEach=F,u.functions=_,u.groupBy=function(n,t,r){var e={};
|
||||
|
||||
Reference in New Issue
Block a user