Add _.partialRight and make _.assign and _.defaults work with arrays.

Former-commit-id: 6d9fea855de53e9ccb5ac6f58db68239ef08e9de
This commit is contained in:
John-David Dalton
2013-01-19 22:17:14 -08:00
parent 39fc839ff2
commit 873cc63f94
9 changed files with 419 additions and 371 deletions

View File

@@ -132,6 +132,7 @@
'once': [],
'pairs': ['keys'],
'partial': ['isFunction', 'isObject'],
'partialRight': ['isFunction', 'isObject'],
'pick': ['forIn'],
'pluck': ['map'],
'random': [],
@@ -248,7 +249,8 @@
'forOwn',
'isPlainObject',
'merge',
'partial'
'partial',
'partialRight'
]));
/** List of ways to export the `lodash` function */
@@ -694,7 +696,7 @@
return source.replace(/\n(?:.*)/g, function(match, index) {
match = match.slice(1);
return (
match == '}' && source.indexOf('}', index + 2) == -1 ? '\n ' : '\n '
match == '}' && source.indexOf('}', index + 2) < 0 ? '\n ' : '\n '
) + match;
});
}
@@ -1462,24 +1464,6 @@
source = removeVar(source, 'largeArraySize');
source = removeKeysOptimization(source);
// replace `_.assign`
source = replaceFunction(source, 'assign', [
' function assign(object) {',
' if (!object) {',
' return object;',
' }',
' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {',
' var iteratee = arguments[argsIndex];',
' if (iteratee) {',
' for (var key in iteratee) {',
' object[key] = iteratee[key];',
' }',
' }',
' }',
' return object;',
' }'
].join('\n'));
// replace `_.clone`
if (useUnderscoreClone) {
source = replaceFunction(source, 'clone', [
@@ -1507,26 +1491,6 @@
' }'
].join('\n'));
// replace `_.defaults`
source = replaceFunction(source, 'defaults', [
' function defaults(object) {',
' if (!object) {',
' return object;',
' }',
' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {',
' var iteratee = arguments[argsIndex];',
' if (iteratee) {',
' for (var key in iteratee) {',
' if (object[key] == null) {',
' object[key] = iteratee[key];',
' }',
' }',
' }',
' }',
' return object;',
' }'
].join('\n'));
// replace `_.difference`
source = replaceFunction(source, 'difference', [
' function difference(array) {',
@@ -1626,7 +1590,7 @@
source = replaceFunction(source, 'template', [
' function template(text, data, options) {',
" text || (text = '');",
' options = defaults({}, options, lodash.templateSettings);',
' options = iteratorTemplate ? defaults({}, options, lodash.templateSettings) : lodash.templateSettings;',
'',
' var index = 0,',
' source = "__p += \'",',
@@ -1748,11 +1712,13 @@
});
// remove unused features from `createBound`
if (buildMethods.indexOf('partial') == -1) {
if (buildMethods.indexOf('partial') < 0 && buildMethods.indexOf('partialRight') < 0) {
source = source.replace(matchFunction(source, 'createBound'), function(match) {
return match
.replace(/, *right/, '')
.replace(/(function createBound\([^{]+{)[\s\S]+?(\n *function bound)/, '$1$2')
.replace(/thisBinding *=[^}]+}/, 'thisBinding = thisArg;\n');
.replace(/thisBinding *=[^}]+}/, 'thisBinding = thisArg;\n')
.replace(/\(args *=.+/, 'partialArgs.concat(slice(args))');
});
}
}
@@ -1807,7 +1773,7 @@
source = source.replace(matchFunction(source, 'template'), function(match) {
return match
.replace(/iteratorTemplate *&& */g, '')
.replace(/iteratorTemplate *\?([^:]+):[^,;]+/g, '$1');
.replace(/iteratorTemplate *\? *([^:]+?) *:[^,;]+/g, '$1');
});
/*----------------------------------------------------------------------*/

View File

@@ -7,13 +7,10 @@
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'argsIndex',
'argsLength',
'callback',
'collection',
'createCallback',
'ctor',
'guard',
'hasOwnProperty',
'index',
'isArguments',
@@ -21,14 +18,12 @@
'iteratee',
'length',
'nativeKeys',
'object',
'objectTypes',
'ownIndex',
'ownProps',
'propertyIsEnumerable',
'result',
'skipProto',
'source',
'thisArg'
];
@@ -152,6 +147,7 @@
'opera',
'pairs',
'partial',
'partialRight',
'pick',
'pluck',
'random',

View File

@@ -97,6 +97,7 @@
* [`_.memoize`](#_memoizefunc--resolver)
* [`_.once`](#_oncefunc)
* [`_.partial`](#_partialfunc--arg1-arg2-)
* [`_.partialRight`](#_partialrightfunc--arg1-arg2-)
* [`_.throttle`](#_throttlefunc-wait)
* [`_.wrap`](#_wrapvalue-wrapper)
@@ -196,7 +197,7 @@
<!-- div -->
### <a id="_compactarray"></a>`_.compact(array)`
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2814 "View in source") [&#x24C9;][1]
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2830 "View in source") [&#x24C9;][1]
Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
@@ -220,7 +221,7 @@ _.compact([0, 1, false, 2, '', 3]);
<!-- div -->
### <a id="_differencearray--array1-array2-"></a>`_.difference(array [, array1, array2, ...])`
<a href="#_differencearray--array1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2844 "View in source") [&#x24C9;][1]
<a href="#_differencearray--array1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2860 "View in source") [&#x24C9;][1]
Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`.
@@ -245,7 +246,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
<!-- div -->
### <a id="_firstarray--callbackn-thisarg"></a>`_.first(array [, callback|n, thisArg])`
<a href="#_firstarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2888 "View in source") [&#x24C9;][1]
<a href="#_firstarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2904 "View in source") [&#x24C9;][1]
Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, the first elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -282,7 +283,7 @@ _.first([1, 2, 3], function(num) {
<!-- div -->
### <a id="_flattenarray-shallow"></a>`_.flatten(array, shallow)`
<a href="#_flattenarray-shallow">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2927 "View in source") [&#x24C9;][1]
<a href="#_flattenarray-shallow">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2943 "View in source") [&#x24C9;][1]
Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level.
@@ -310,7 +311,7 @@ _.flatten([1, [2], [3, [[4]]]], true);
<!-- div -->
### <a id="_indexofarray-value--fromindex0"></a>`_.indexOf(array, value [, fromIndex=0])`
<a href="#_indexofarray-value--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2969 "View in source") [&#x24C9;][1]
<a href="#_indexofarray-value--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2985 "View in source") [&#x24C9;][1]
Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search.
@@ -342,7 +343,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
<!-- div -->
### <a id="_initialarray--callbackn1-thisarg"></a>`_.initial(array [, callback|n=1, thisArg])`
<a href="#_initialarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3015 "View in source") [&#x24C9;][1]
<a href="#_initialarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3031 "View in source") [&#x24C9;][1]
Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, the last elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -376,7 +377,7 @@ _.initial([1, 2, 3], function(num) {
<!-- div -->
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
<a href="#_intersectionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3049 "View in source") [&#x24C9;][1]
<a href="#_intersectionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3065 "View in source") [&#x24C9;][1]
Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`.
@@ -400,7 +401,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
<!-- div -->
### <a id="_lastarray--callbackn-thisarg"></a>`_.last(array [, callback|n, thisArg])`
<a href="#_lastarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3111 "View in source") [&#x24C9;][1]
<a href="#_lastarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3127 "View in source") [&#x24C9;][1]
Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, the last elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -434,7 +435,7 @@ _.last([1, 2, 3], function(num) {
<!-- div -->
### <a id="_lastindexofarray-value--fromindexarraylength-1"></a>`_.lastIndexOf(array, value [, fromIndex=array.length-1])`
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3152 "View in source") [&#x24C9;][1]
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3168 "View in source") [&#x24C9;][1]
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection.
@@ -463,7 +464,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
<!-- div -->
### <a id="_objectkeys--values"></a>`_.object(keys [, values=[]])`
<a href="#_objectkeys--values">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3182 "View in source") [&#x24C9;][1]
<a href="#_objectkeys--values">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3198 "View in source") [&#x24C9;][1]
Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`.
@@ -488,9 +489,9 @@ _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
<!-- div -->
### <a id="_rangestart0-end--step1"></a>`_.range([start=0], end [, step=1])`
<a href="#_rangestart0-end--step1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3227 "View in source") [&#x24C9;][1]
<a href="#_rangestart0-end--step1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3242 "View in source") [&#x24C9;][1]
Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. This method is a port of Python's `range()` function. See http://docs.python.org/library/functions.html#range.
Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`.
#### Arguments
1. `[start=0]` *(Number)*: The start of the range.
@@ -526,7 +527,7 @@ _.range(0);
<!-- div -->
### <a id="_restarray--callbackn1-thisarg"></a>`_.rest(array [, callback|n=1, thisArg])`
<a href="#_restarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3277 "View in source") [&#x24C9;][1]
<a href="#_restarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3292 "View in source") [&#x24C9;][1]
The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, the first elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -563,7 +564,7 @@ _.rest([1, 2, 3], function(num) {
<!-- div -->
### <a id="_sortedindexarray-value--callbackidentityproperty-thisarg"></a>`_.sortedIndex(array, value [, callback=identity|property, thisArg])`
<a href="#_sortedindexarray-value--callbackidentityproperty-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3333 "View in source") [&#x24C9;][1]
<a href="#_sortedindexarray-value--callbackidentityproperty-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3348 "View in source") [&#x24C9;][1]
Uses a binary search to determine the smallest index at which the `value` 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.
@@ -607,7 +608,7 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
<!-- div -->
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
<a href="#_unionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3365 "View in source") [&#x24C9;][1]
<a href="#_unionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3380 "View in source") [&#x24C9;][1]
Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`.
@@ -631,7 +632,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
<!-- div -->
### <a id="_uniqarray--issortedfalse-callbackidentity-thisarg"></a>`_.uniq(array [, isSorted=false, callback=identity, thisArg])`
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3399 "View in source") [&#x24C9;][1]
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3414 "View in source") [&#x24C9;][1]
Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each 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)*.
@@ -670,7 +671,7 @@ _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
<!-- div -->
### <a id="_withoutarray--value1-value2-"></a>`_.without(array [, value1, value2, ...])`
<a href="#_withoutarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3458 "View in source") [&#x24C9;][1]
<a href="#_withoutarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3473 "View in source") [&#x24C9;][1]
Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
@@ -695,7 +696,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
<!-- div -->
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
<a href="#_ziparray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3489 "View in source") [&#x24C9;][1]
<a href="#_ziparray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3504 "View in source") [&#x24C9;][1]
Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
@@ -731,7 +732,7 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
Creates a `lodash` object, that wraps the given `value`, to enable method chaining.
The chainable wrapper functions are:<br>
`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
The non-chainable wrapper functions are:<br>
`clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId`
@@ -752,7 +753,7 @@ The wrapper functions `first` and `last` return wrapped values when `n` is passe
<!-- div -->
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4361 "View in source") [&#x24C9;][1]
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4409 "View in source") [&#x24C9;][1]
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
@@ -782,7 +783,7 @@ _([1, 2, 3, 4])
<!-- div -->
### <a id="_prototypetostring"></a>`_.prototype.toString()`
<a href="#_prototypetostring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4378 "View in source") [&#x24C9;][1]
<a href="#_prototypetostring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4426 "View in source") [&#x24C9;][1]
Produces the `toString` result of the wrapped value.
@@ -803,7 +804,7 @@ _([1, 2, 3]).toString();
<!-- div -->
### <a id="_prototypevalueof"></a>`_.prototype.valueOf()`
<a href="#_prototypevalueof">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4395 "View in source") [&#x24C9;][1]
<a href="#_prototypevalueof">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4443 "View in source") [&#x24C9;][1]
Extracts the wrapped value.
@@ -834,7 +835,7 @@ _([1, 2, 3]).valueOf();
<!-- div -->
### <a id="_atcollection--index1-index2-"></a>`_.at(collection [, index1, index2, ...])`
<a href="#_atcollection--index1-index2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2013 "View in source") [&#x24C9;][1]
<a href="#_atcollection--index1-index2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2028 "View in source") [&#x24C9;][1]
Creates an array of elements from the specified index(es), or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes.
@@ -862,7 +863,7 @@ _.at(['moe', 'larry', 'curly'], 0, 2);
<!-- div -->
### <a id="_containscollection-target--fromindex0"></a>`_.contains(collection, target [, fromIndex=0])`
<a href="#_containscollection-target--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2055 "View in source") [&#x24C9;][1]
<a href="#_containscollection-target--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2070 "View in source") [&#x24C9;][1]
Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection.
@@ -900,7 +901,7 @@ _.contains('curly', 'ur');
<!-- div -->
### <a id="_countbycollection-callbackproperty--thisarg"></a>`_.countBy(collection, callback|property [, thisArg])`
<a href="#_countbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2102 "View in source") [&#x24C9;][1]
<a href="#_countbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2117 "View in source") [&#x24C9;][1]
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')*.
@@ -932,7 +933,7 @@ _.countBy(['one', 'two', 'three'], 'length');
<!-- div -->
### <a id="_everycollection--callbackidentity-thisarg"></a>`_.every(collection [, callback=identity, thisArg])`
<a href="#_everycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2132 "View in source") [&#x24C9;][1]
<a href="#_everycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2147 "View in source") [&#x24C9;][1]
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -961,7 +962,7 @@ _.every([true, 1, null, 'yes'], Boolean);
<!-- div -->
### <a id="_filtercollection--callbackidentity-thisarg"></a>`_.filter(collection [, callback=identity, thisArg])`
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2171 "View in source") [&#x24C9;][1]
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2186 "View in source") [&#x24C9;][1]
Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -990,7 +991,7 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; })
<!-- div -->
### <a id="_findcollection--callbackidentity-thisarg"></a>`_.find(collection [, callback=identity, thisArg])`
<a href="#_findcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2215 "View in source") [&#x24C9;][1]
<a href="#_findcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2230 "View in source") [&#x24C9;][1]
Examines each element in a `collection`, returning the first one 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)*.
@@ -1019,7 +1020,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
<!-- div -->
### <a id="_foreachcollection--callbackidentity-thisarg"></a>`_.forEach(collection [, callback=identity, thisArg])`
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2250 "View in source") [&#x24C9;][1]
<a href="#_foreachcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2265 "View in source") [&#x24C9;][1]
Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`.
@@ -1051,7 +1052,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert);
<!-- div -->
### <a id="_groupbycollection-callbackproperty--thisarg"></a>`_.groupBy(collection, callback|property [, thisArg])`
<a href="#_groupbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2292 "View in source") [&#x24C9;][1]
<a href="#_groupbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2307 "View in source") [&#x24C9;][1]
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` 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')*.
@@ -1083,7 +1084,7 @@ _.groupBy(['one', 'two', 'three'], 'length');
<!-- div -->
### <a id="_invokecollection-methodname--arg1-arg2-"></a>`_.invoke(collection, methodName [, arg1, arg2, ...])`
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2325 "View in source") [&#x24C9;][1]
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2340 "View in source") [&#x24C9;][1]
Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`.
@@ -1112,7 +1113,7 @@ _.invoke([123, 456], String.prototype.split, '');
<!-- div -->
### <a id="_mapcollection--callbackidentity-thisarg"></a>`_.map(collection [, callback=identity, thisArg])`
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2359 "View in source") [&#x24C9;][1]
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2374 "View in source") [&#x24C9;][1]
Creates an array of values by running each element in the `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -1144,7 +1145,7 @@ _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
<!-- div -->
### <a id="_maxcollection--callback-thisarg"></a>`_.max(collection [, callback, thisArg])`
<a href="#_maxcollection--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2401 "View in source") [&#x24C9;][1]
<a href="#_maxcollection--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2416 "View in source") [&#x24C9;][1]
Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*.
@@ -1176,7 +1177,7 @@ _.max(stooges, function(stooge) { return stooge.age; });
<!-- div -->
### <a id="_mincollection--callback-thisarg"></a>`_.min(collection [, callback, thisArg])`
<a href="#_mincollection--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2449 "View in source") [&#x24C9;][1]
<a href="#_mincollection--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2464 "View in source") [&#x24C9;][1]
Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*.
@@ -1202,7 +1203,7 @@ _.min([10, 5, 100, 2, 1000]);
<!-- div -->
### <a id="_pluckcollection-property"></a>`_.pluck(collection, property)`
<a href="#_pluckcollection-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2500 "View in source") [&#x24C9;][1]
<a href="#_pluckcollection-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2515 "View in source") [&#x24C9;][1]
Retrieves the value of a specified property from all elements in the `collection`.
@@ -1233,7 +1234,7 @@ _.pluck(stooges, 'name');
<!-- div -->
### <a id="_reducecollection--callbackidentity-accumulator-thisarg"></a>`_.reduce(collection [, callback=identity, accumulator, thisArg])`
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2524 "View in source") [&#x24C9;][1]
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2539 "View in source") [&#x24C9;][1]
Reduces a `collection` to a single value. The initial state of the reduction is `accumulator` and each successive step of it should be returned by the `callback`. The `callback` is bound to `thisArg` and invoked with four arguments; for arrays they are *(accumulator, value, index|key, collection)*.
@@ -1263,9 +1264,9 @@ var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; });
<!-- div -->
### <a id="_reducerightcollection--callbackidentity-accumulator-thisarg"></a>`_.reduceRight(collection [, callback=identity, accumulator, thisArg])`
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2566 "View in source") [&#x24C9;][1]
<a href="#_reducerightcollection--callbackidentity-accumulator-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2582 "View in source") [&#x24C9;][1]
The right-associative version of `_.reduce`.
This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left.
#### Aliases
*foldr*
@@ -1294,7 +1295,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
<!-- div -->
### <a id="_rejectcollection--callbackidentity-thisarg"></a>`_.reject(collection [, callback=identity, thisArg])`
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2604 "View in source") [&#x24C9;][1]
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2620 "View in source") [&#x24C9;][1]
The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for.
@@ -1320,7 +1321,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
<!-- div -->
### <a id="_shufflecollection"></a>`_.shuffle(collection)`
<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2625 "View in source") [&#x24C9;][1]
<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2641 "View in source") [&#x24C9;][1]
Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
@@ -1344,7 +1345,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
<!-- div -->
### <a id="_sizecollection"></a>`_.size(collection)`
<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2658 "View in source") [&#x24C9;][1]
<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2674 "View in source") [&#x24C9;][1]
Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects.
@@ -1374,7 +1375,7 @@ _.size('curly');
<!-- div -->
### <a id="_somecollection--callbackidentity-thisarg"></a>`_.some(collection [, callback=identity, thisArg])`
<a href="#_somecollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2683 "View in source") [&#x24C9;][1]
<a href="#_somecollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2699 "View in source") [&#x24C9;][1]
Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -1403,7 +1404,7 @@ _.some([null, 0, 'yes', false], Boolean);
<!-- div -->
### <a id="_sortbycollection-callbackproperty--thisarg"></a>`_.sortBy(collection, callback|property [, thisArg])`
<a href="#_sortbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2729 "View in source") [&#x24C9;][1]
<a href="#_sortbycollection-callbackproperty--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2745 "View in source") [&#x24C9;][1]
Creates an array, stable sorted in ascending order by the results of running each element of `collection` through a `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')*.
@@ -1435,7 +1436,7 @@ _.sortBy(['larry', 'brendan', 'moe'], 'length');
<!-- div -->
### <a id="_toarraycollection"></a>`_.toArray(collection)`
<a href="#_toarraycollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2764 "View in source") [&#x24C9;][1]
<a href="#_toarraycollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2780 "View in source") [&#x24C9;][1]
Converts the `collection` to an array.
@@ -1459,7 +1460,7 @@ Converts the `collection` to an array.
<!-- div -->
### <a id="_wherecollection-properties"></a>`_.where(collection, properties)`
<a href="#_wherecollection-properties">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2794 "View in source") [&#x24C9;][1]
<a href="#_wherecollection-properties">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2810 "View in source") [&#x24C9;][1]
Examines each element in a `collection`, returning an array of all elements that contain the given `properties`.
@@ -1497,7 +1498,7 @@ _.where(stooges, { 'age': 40 });
<!-- div -->
### <a id="_aftern-func"></a>`_.after(n, func)`
<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3522 "View in source") [&#x24C9;][1]
<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3537 "View in source") [&#x24C9;][1]
Creates a function that is restricted to executing `func` only after it is called `n` times. The `func` is executed with the `this` binding of the created function.
@@ -1525,7 +1526,7 @@ _.forEach(notes, function(note) {
<!-- div -->
### <a id="_bindfunc--thisarg-arg1-arg2-"></a>`_.bind(func [, thisArg, arg1, arg2, ...])`
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3555 "View in source") [&#x24C9;][1]
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3570 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function.
@@ -1556,7 +1557,7 @@ func();
<!-- div -->
### <a id="_bindallobject--methodname1-methodname2-"></a>`_.bindAll(object [, methodName1, methodName2, ...])`
<a href="#_bindallobject--methodname1-methodname2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3586 "View in source") [&#x24C9;][1]
<a href="#_bindallobject--methodname1-methodname2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3601 "View in source") [&#x24C9;][1]
Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound.
@@ -1587,7 +1588,7 @@ jQuery('#lodash_button').on('click', buttonView.onClick);
<!-- div -->
### <a id="_bindkeyobject-key--arg1-arg2-"></a>`_.bindKey(object, key [, arg1, arg2, ...])`
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3632 "View in source") [&#x24C9;][1]
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3647 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
@@ -1628,7 +1629,7 @@ func();
<!-- div -->
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
<a href="#_composefunc1-func2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3655 "View in source") [&#x24C9;][1]
<a href="#_composefunc1-func2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3670 "View in source") [&#x24C9;][1]
Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function.
@@ -1655,7 +1656,7 @@ welcome('moe');
<!-- div -->
### <a id="_debouncefunc-wait-immediate"></a>`_.debounce(func, wait, immediate)`
<a href="#_debouncefunc-wait-immediate">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3688 "View in source") [&#x24C9;][1]
<a href="#_debouncefunc-wait-immediate">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3703 "View in source") [&#x24C9;][1]
Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
@@ -1681,7 +1682,7 @@ jQuery(window).on('resize', lazyLayout);
<!-- div -->
### <a id="_deferfunc--arg1-arg2-"></a>`_.defer(func [, arg1, arg2, ...])`
<a href="#_deferfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3752 "View in source") [&#x24C9;][1]
<a href="#_deferfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3767 "View in source") [&#x24C9;][1]
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked.
@@ -1706,7 +1707,7 @@ _.defer(function() { alert('deferred'); });
<!-- div -->
### <a id="_delayfunc-wait--arg1-arg2-"></a>`_.delay(func, wait [, arg1, arg2, ...])`
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3732 "View in source") [&#x24C9;][1]
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3747 "View in source") [&#x24C9;][1]
Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked.
@@ -1733,7 +1734,7 @@ _.delay(log, 1000, 'logged later');
<!-- div -->
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
<a href="#_memoizefunc--resolver">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3776 "View in source") [&#x24C9;][1]
<a href="#_memoizefunc--resolver">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3791 "View in source") [&#x24C9;][1]
Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function.
@@ -1759,7 +1760,7 @@ var fibonacci = _.memoize(function(n) {
<!-- div -->
### <a id="_oncefunc"></a>`_.once(func)`
<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3803 "View in source") [&#x24C9;][1]
<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3818 "View in source") [&#x24C9;][1]
Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function.
@@ -1785,9 +1786,9 @@ initialize();
<!-- div -->
### <a id="_partialfunc--arg1-arg2-"></a>`_.partial(func [, arg1, arg2, ...])`
<a href="#_partialfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3838 "View in source") [&#x24C9;][1]
<a href="#_partialfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3853 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `bind`, except it does **not** alter the `this` binding.
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding.
#### Arguments
1. `func` *(Function)*: The function to partially apply arguments to.
@@ -1809,10 +1810,49 @@ hi('moe');
<!-- /div -->
<!-- div -->
### <a id="_partialrightfunc--arg1-arg2-"></a>`_.partialRight(func [, arg1, arg2, ...])`
<a href="#_partialrightfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3886 "View in source") [&#x24C9;][1]
This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function.
#### Arguments
1. `func` *(Function)*: The function to partially apply arguments to.
2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied.
#### Returns
*(Function)*: Returns the new partially applied function.
#### Example
```js
_.mixin({
'defaultsDeep': _.partailRight(_.merge, _.defaults)
});
var options = {
'variable': 'data',
'imports': { 'jq': $ }
};
_.defaultsDeep(options, _.templateSettings);
options.variable
// => 'data'
options.imports
// => { '_': _, 'jq': $ }
```
* * *
<!-- /div -->
<!-- div -->
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
<a href="#_throttlefunc-wait">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3860 "View in source") [&#x24C9;][1]
<a href="#_throttlefunc-wait">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3908 "View in source") [&#x24C9;][1]
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
@@ -1837,7 +1877,7 @@ jQuery(window).on('scroll', throttled);
<!-- div -->
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3913 "View in source") [&#x24C9;][1]
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3961 "View in source") [&#x24C9;][1]
Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function.
@@ -1873,7 +1913,7 @@ hello();
<!-- div -->
### <a id="_assignobject--source1-source2-"></a>`_.assign(object [, source1, source2, ...])`
<a href="#_assignobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L839 "View in source") [&#x24C9;][1]
<a href="#_assignobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1007 "View in source") [&#x24C9;][1]
Assigns own enumerable properties of source object(s) to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
@@ -1901,7 +1941,7 @@ _.assign({ 'name': 'moe' }, { 'age': 40 });
<!-- div -->
### <a id="_clonevalue-deep"></a>`_.clone(value, deep)`
<a href="#_clonevalue-deep">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1049 "View in source") [&#x24C9;][1]
<a href="#_clonevalue-deep">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1051 "View in source") [&#x24C9;][1]
Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference.
@@ -1937,7 +1977,7 @@ deep[0] === stooges[0];
<!-- div -->
### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
<a href="#_clonedeepvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1144 "View in source") [&#x24C9;][1]
<a href="#_clonedeepvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1146 "View in source") [&#x24C9;][1]
Creates a deep clone of `value`. Functions and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and objects created by constructors other than `Object` are cloned to plain `Object` objects.
@@ -1970,7 +2010,7 @@ deep[0] === stooges[0];
<!-- div -->
### <a id="_defaultsobject--source1-source2-"></a>`_.defaults(object [, source1, source2, ...])`
<a href="#_defaultsobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1166 "View in source") [&#x24C9;][1]
<a href="#_defaultsobject--source1-source2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1170 "View in source") [&#x24C9;][1]
Assigns own enumerable properties of source object(s) to the `destination` object for all `destination` properties that resolve to `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored.
@@ -1996,7 +2036,7 @@ _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
<!-- div -->
### <a id="_forinobject--callbackidentity-thisarg"></a>`_.forIn(object [, callback=identity, thisArg])`
<a href="#_forinobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L895 "View in source") [&#x24C9;][1]
<a href="#_forinobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L865 "View in source") [&#x24C9;][1]
Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
@@ -2032,7 +2072,7 @@ _.forIn(new Dog('Dagny'), function(value, key) {
<!-- div -->
### <a id="_forownobject--callbackidentity-thisarg"></a>`_.forOwn(object [, callback=identity, thisArg])`
<a href="#_forownobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L919 "View in source") [&#x24C9;][1]
<a href="#_forownobject--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L889 "View in source") [&#x24C9;][1]
Iterates over an object's own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
@@ -2060,7 +2100,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
<!-- div -->
### <a id="_functionsobject"></a>`_.functions(object)`
<a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1185 "View in source") [&#x24C9;][1]
<a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1200 "View in source") [&#x24C9;][1]
Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values.
@@ -2087,7 +2127,7 @@ _.functions(_);
<!-- div -->
### <a id="_hasobject-property"></a>`_.has(object, property)`
<a href="#_hasobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1210 "View in source") [&#x24C9;][1]
<a href="#_hasobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1225 "View in source") [&#x24C9;][1]
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
@@ -2112,7 +2152,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
<!-- div -->
### <a id="_invertobject"></a>`_.invert(object)`
<a href="#_invertobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1227 "View in source") [&#x24C9;][1]
<a href="#_invertobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1242 "View in source") [&#x24C9;][1]
Creates an object composed of the inverted keys and values of the given `object`.
@@ -2136,7 +2176,7 @@ _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' });
<!-- div -->
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
<a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L857 "View in source") [&#x24C9;][1]
<a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L827 "View in source") [&#x24C9;][1]
Checks if `value` is an `arguments` object.
@@ -2163,7 +2203,7 @@ _.isArguments([1, 2, 3]);
<!-- div -->
### <a id="_isarrayvalue"></a>`_.isArray(value)`
<a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1256 "View in source") [&#x24C9;][1]
<a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1271 "View in source") [&#x24C9;][1]
Checks if `value` is an array.
@@ -2190,7 +2230,7 @@ _.isArray([1, 2, 3]);
<!-- div -->
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
<a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1275 "View in source") [&#x24C9;][1]
<a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1290 "View in source") [&#x24C9;][1]
Checks if `value` is a boolean value.
@@ -2214,7 +2254,7 @@ _.isBoolean(null);
<!-- div -->
### <a id="_isdatevalue"></a>`_.isDate(value)`
<a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1292 "View in source") [&#x24C9;][1]
<a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1307 "View in source") [&#x24C9;][1]
Checks if `value` is a date.
@@ -2238,7 +2278,7 @@ _.isDate(new Date);
<!-- div -->
### <a id="_iselementvalue"></a>`_.isElement(value)`
<a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1309 "View in source") [&#x24C9;][1]
<a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1324 "View in source") [&#x24C9;][1]
Checks if `value` is a DOM element.
@@ -2262,7 +2302,7 @@ _.isElement(document.body);
<!-- div -->
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
<a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1334 "View in source") [&#x24C9;][1]
<a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1349 "View in source") [&#x24C9;][1]
Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty".
@@ -2292,7 +2332,7 @@ _.isEmpty('');
<!-- div -->
### <a id="_isequala-b"></a>`_.isEqual(a, b)`
<a href="#_isequala-b">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1376 "View in source") [&#x24C9;][1]
<a href="#_isequala-b">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1391 "View in source") [&#x24C9;][1]
Performs a deep comparison between two values to determine if they are equivalent to each other.
@@ -2323,7 +2363,7 @@ _.isEqual(moe, clone);
<!-- div -->
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1527 "View in source") [&#x24C9;][1]
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1542 "View in source") [&#x24C9;][1]
Checks if `value` is, or can be coerced to, a finite number.
@@ -2361,7 +2401,7 @@ _.isFinite(Infinity);
<!-- div -->
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1544 "View in source") [&#x24C9;][1]
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1559 "View in source") [&#x24C9;][1]
Checks if `value` is a function.
@@ -2385,7 +2425,7 @@ _.isFunction(_);
<!-- div -->
### <a id="_isnanvalue"></a>`_.isNaN(value)`
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1607 "View in source") [&#x24C9;][1]
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1622 "View in source") [&#x24C9;][1]
Checks if `value` is `NaN`.
@@ -2420,7 +2460,7 @@ _.isNaN(undefined);
<!-- div -->
### <a id="_isnullvalue"></a>`_.isNull(value)`
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1629 "View in source") [&#x24C9;][1]
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1644 "View in source") [&#x24C9;][1]
Checks if `value` is `null`.
@@ -2447,7 +2487,7 @@ _.isNull(undefined);
<!-- div -->
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1646 "View in source") [&#x24C9;][1]
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1661 "View in source") [&#x24C9;][1]
Checks if `value` is a number.
@@ -2471,7 +2511,7 @@ _.isNumber(8.4 * 5);
<!-- div -->
### <a id="_isobjectvalue"></a>`_.isObject(value)`
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1574 "View in source") [&#x24C9;][1]
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1589 "View in source") [&#x24C9;][1]
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
@@ -2501,7 +2541,7 @@ _.isObject(1);
<!-- div -->
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
<a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1674 "View in source") [&#x24C9;][1]
<a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1689 "View in source") [&#x24C9;][1]
Checks if a given `value` is an object created by the `Object` constructor.
@@ -2536,7 +2576,7 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 });
<!-- div -->
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1699 "View in source") [&#x24C9;][1]
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1714 "View in source") [&#x24C9;][1]
Checks if `value` is a regular expression.
@@ -2560,7 +2600,7 @@ _.isRegExp(/moe/);
<!-- div -->
### <a id="_isstringvalue"></a>`_.isString(value)`
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1716 "View in source") [&#x24C9;][1]
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1731 "View in source") [&#x24C9;][1]
Checks if `value` is a string.
@@ -2584,7 +2624,7 @@ _.isString('moe');
<!-- div -->
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1733 "View in source") [&#x24C9;][1]
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1748 "View in source") [&#x24C9;][1]
Checks if `value` is `undefined`.
@@ -2608,7 +2648,7 @@ _.isUndefined(void 0);
<!-- div -->
### <a id="_keysobject"></a>`_.keys(object)`
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L934 "View in source") [&#x24C9;][1]
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L904 "View in source") [&#x24C9;][1]
Creates an array composed of the own enumerable property names of `object`.
@@ -2632,7 +2672,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 });
<!-- div -->
### <a id="_mergeobject--source1-source2--callback-thisarg"></a>`_.merge(object [, source1, source2, ..., callback, thisArg])`
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1777 "View in source") [&#x24C9;][1]
<a href="#_mergeobject--source1-source2--callback-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1792 "View in source") [&#x24C9;][1]
Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the `destination` object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the merged values of the destination and source object properties. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*.
@@ -2673,7 +2713,7 @@ _.merge(names, ages);
<!-- div -->
### <a id="_omitobject-callback-prop1-prop2--thisarg"></a>`_.omit(object, callback|[prop1, prop2, ..., thisArg])`
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1869 "View in source") [&#x24C9;][1]
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1884 "View in source") [&#x24C9;][1]
Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
@@ -2704,7 +2744,7 @@ _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(va
<!-- div -->
### <a id="_pairsobject"></a>`_.pairs(object)`
<a href="#_pairsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1903 "View in source") [&#x24C9;][1]
<a href="#_pairsobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1918 "View in source") [&#x24C9;][1]
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
@@ -2728,7 +2768,7 @@ _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 });
<!-- div -->
### <a id="_pickobject-callback-prop1-prop2--thisarg"></a>`_.pick(object, callback|[prop1, prop2, ..., thisArg])`
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1941 "View in source") [&#x24C9;][1]
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1956 "View in source") [&#x24C9;][1]
Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
@@ -2759,7 +2799,7 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {
<!-- div -->
### <a id="_valuesobject"></a>`_.values(object)`
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1978 "View in source") [&#x24C9;][1]
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1993 "View in source") [&#x24C9;][1]
Creates an array composed of the own enumerable property values of `object`.
@@ -2790,7 +2830,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
<!-- div -->
### <a id="_escapestring"></a>`_.escape(string)`
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3937 "View in source") [&#x24C9;][1]
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3985 "View in source") [&#x24C9;][1]
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
@@ -2814,7 +2854,7 @@ _.escape('Moe, Larry & Curly');
<!-- div -->
### <a id="_identityvalue"></a>`_.identity(value)`
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3955 "View in source") [&#x24C9;][1]
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4003 "View in source") [&#x24C9;][1]
This function returns the first argument passed to it.
@@ -2839,7 +2879,7 @@ moe === _.identity(moe);
<!-- div -->
### <a id="_mixinobject"></a>`_.mixin(object)`
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3981 "View in source") [&#x24C9;][1]
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4029 "View in source") [&#x24C9;][1]
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
@@ -2869,7 +2909,7 @@ _('curly').capitalize();
<!-- div -->
### <a id="_noconflict"></a>`_.noConflict()`
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4005 "View in source") [&#x24C9;][1]
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4053 "View in source") [&#x24C9;][1]
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
@@ -2889,7 +2929,7 @@ var lodash = _.noConflict();
<!-- div -->
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4028 "View in source") [&#x24C9;][1]
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4076 "View in source") [&#x24C9;][1]
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned.
@@ -2917,7 +2957,7 @@ _.random(5);
<!-- div -->
### <a id="_resultobject-property"></a>`_.result(object, property)`
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4066 "View in source") [&#x24C9;][1]
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4114 "View in source") [&#x24C9;][1]
Resolves the value of `property` on `object`. If `property` is a function, it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned.
@@ -2952,7 +2992,7 @@ _.result(object, 'stuff');
<!-- div -->
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4151 "View in source") [&#x24C9;][1]
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4199 "View in source") [&#x24C9;][1]
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
@@ -3030,7 +3070,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\
<!-- div -->
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4287 "View in source") [&#x24C9;][1]
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4335 "View in source") [&#x24C9;][1]
Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*.
@@ -3062,7 +3102,7 @@ _.times(3, function(n) { this.cast(n); }, mage);
<!-- div -->
### <a id="_unescapestring"></a>`_.unescape(string)`
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4313 "View in source") [&#x24C9;][1]
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4361 "View in source") [&#x24C9;][1]
The opposite of `_.escape`, this method converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#x27;` in `string` to their corresponding characters.
@@ -3086,7 +3126,7 @@ _.unescape('Moe, Larry &amp; Curly');
<!-- div -->
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4333 "View in source") [&#x24C9;][1]
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4381 "View in source") [&#x24C9;][1]
Generates a unique ID. If `prefix` is passed, the ID will be appended to it.
@@ -3139,7 +3179,7 @@ A reference to the `lodash` function.
<!-- div -->
### <a id="_version"></a>`_.VERSION`
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4562 "View in source") [&#x24C9;][1]
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4611 "View in source") [&#x24C9;][1]
*(String)*: The semantic version number.

143
lodash.js
View File

@@ -249,10 +249,10 @@
* `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`,
* `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`,
* `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`,
* `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `pick`, `pluck`,
* `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
* `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`,
* `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
* `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
* `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`,
* `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`,
@@ -458,18 +458,6 @@
'return result'
);
/** Reusable iterator options for `assign` and `defaults` */
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
'while (++argsIndex < argsLength) {\n' +
' if ((iteratee = arguments[argsIndex])) {',
'loop': 'result[index] = iteratee[index]',
'bottom': ' }\n}'
};
/** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */
var eachIteratorOptions = {
'arrays': true,
@@ -564,17 +552,18 @@
}
/**
* Creates a function that, when called, invokes `func` with the `this`
* binding of `thisArg` and prepends any `partailArgs` to the arguments passed
* to the bound function.
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partailArgs` to the arguments passed to the
* bound function.
*
* @private
* @param {Function|String} func The function to bind or the method name.
* @param {Mixed} [thisArg] The `this` binding of `func`.
* @param {Array} partialArgs An array of arguments to be partially applied.
* @param {Object} [right] Used to indicate partially applying arguments from the right.
* @returns {Function} Returns the new bound function.
*/
function createBound(func, thisArg, partialArgs) {
function createBound(func, thisArg, partialArgs, right) {
var isFunc = isFunction(func),
isPartial = !partialArgs,
key = thisArg;
@@ -598,7 +587,7 @@
}
if (partialArgs.length) {
args = args.length
? partialArgs.concat(slice(args))
? (args = slice(args), right ? args.concat(partialArgs) : partialArgs.concat(args))
: partialArgs;
}
if (this instanceof bound) {
@@ -819,25 +808,6 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
*
* @static
* @memberOf _
* @alias extend
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*/
var assign = createIterator(assignIteratorOptions);
/**
* Checks if `value` is an `arguments` object.
*
@@ -1015,6 +985,38 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
*
* @static
* @memberOf _
* @alias extend
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow this method to work with
* `_.reduce` without using its callback's `key and `object` arguments as sources.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*/
function assign(object, source, guard) {
var args = arguments,
index = 0,
length = typeof guard == 'number' ? 2 : args.length;
while (++index < length) {
(isArray(args[index]) ? forEach : forOwn)(args[index], function(value, key) {
object[key] = value;
});
}
return object;
}
/**
* Creates a clone of `value`. If `deep` is `true`, nested objects will also
* be cloned, otherwise they will be assigned by reference.
@@ -1156,6 +1158,8 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow this method to work with
* `_.reduce` without using its callback's `key` and `object` arguments as sources.
* @returns {Object} Returns the destination object.
* @example
*
@@ -1163,9 +1167,20 @@
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
*/
var defaults = createIterator(assignIteratorOptions, {
'loop': 'if (result[index] == null) ' + assignIteratorOptions.loop
});
function defaults(object, source, guard) {
var args = arguments,
index = 0,
length = typeof guard == 'number' ? 2 : args.length;
while (++index < length) {
(isArray(args[index]) ? forEach : forOwn)(args[index], function(value, key) {
if (object[key] == null) {
object[key] = value;
}
});
}
return object;
}
/**
* Creates a sorted array of all enumerable properties, own and inherited,
@@ -2546,7 +2561,8 @@
}
/**
* The right-associative version of `_.reduce`.
* This method is similar to `_.reduce`, except that it iterates over a
* `collection` from right to left.
*
* @static
* @memberOf _
@@ -3197,8 +3213,7 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`. This method is a port of Python's
* `range()` function. See http://docs.python.org/library/functions.html#range.
* `start` up to but not including `end`.
*
* @static
* @memberOf _
@@ -3820,7 +3835,7 @@
/**
* Creates a function that, when called, invokes `func` with any additional
* `partial` arguments prepended to those passed to the new function. This
* method is similar to `bind`, except it does **not** alter the `this` binding.
* method is similar to `_.bind`, except it does **not** alter the `this` binding.
*
* @static
* @memberOf _
@@ -3839,6 +3854,39 @@
return createBound(func, slice(arguments, 1));
}
/**
* This method is similar to `_.partial`, except that `partial` arguments are
* appended to those passed to the new function.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to partially apply arguments to.
* @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* _.mixin({
* 'defaultsDeep': _.partailRight(_.merge, _.defaults)
* });
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
*
* _.defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'
*
* options.imports
* // => { '_': _, 'jq': $ }
*/
function partialRight(func) {
return createBound(func, slice(arguments, 1), null, indicatorObject);
}
/**
* Creates a function that, when executed, will only call the `func`
* function at most once per every `wait` milliseconds. If the throttled
@@ -4435,6 +4483,7 @@
lodash.once = once;
lodash.pairs = pairs;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.pick = pick;
lodash.pluck = pluck;
lodash.range = range;

70
lodash.min.js vendored
View File

@@ -3,39 +3,39 @@
* Lo-Dash 1.0.0-rc.3 lodash.com/license
* Underscore.js 1.4.3 underscorejs.org/LICENSE
*/
;(function(n,t){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||it);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(St.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return St.call(o,e)&&-1<C(o[e],r)}return-1<C(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){function e(){var a=arguments,f=o?this:t;return u||(n=t[i]),r.length&&(a=a.length?r.concat(v(a)):r),this instanceof e?(s.prototype=n.prototype,f=new s,s.prototype=W,a=n.apply(f,a),x(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=sr(n);return function(t){for(var r=u.length,e=X;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?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(){for(var n,t={e:nt,f:Dt,h:Qt,i:Yt,j:wt,b:X,c:"",g:"",k:"",l:Q},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var i,l="+t.d+",t="+t.d+";if(!"+t.d+")return t;"+t.k+";",t.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",t.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){"+t.g+"}}else{"):t.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){i+='';"+t.g+"}}else{"),t.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');"),t.f&&t.l?(r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",t.e||(r+="if(!(u&&i=='prototype')){"),r+=t.g+"",t.e||(r+="}")):(r+="for(i in l){",(!t.e||t.l)&&(r+="if(",t.e||(r+="!(u&&i=='prototype')"),!t.e&&t.l&&(r+="&&"),t.l&&(r+="h.call(l,i)"),r+="){"),r+=t.g+";",(!t.e||t.l)&&(r+="}")),r+="}",t.e)for(r+="var f=l.constructor;",e=0;7>e;e++)r+="i='"+t.j[e]+"';if(","constructor"==t.j[e]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+t.g+"}";
return(t.b||t.h)&&(r+="}"),r+=t.c+";return t",Function("e,h,j,k,p,n,s","return function("+n+"){"+r+"}")(a,St,h,A,er,Dt,kt)}function c(n){return"\\"+ur[n]}function l(n){return vr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}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 gr[n]}function h(n){return $t.call(n)==Mt}function y(n){var t=X;if(!n||typeof n!="object"||h(n))return t;
var r=n.constructor;return!j(r)&&(!Zt||!p(n))||r instanceof r?tt?(lr(n,function(n,r,e){return t=!St.call(e,r),X}),t===X):(lr(n,function(n,r){t=r}),t===X||St.call(n,t)):t}function m(n){var t=[];return pr(n,function(n,r){t.push(r)}),t}function _(n,t,r,e,u){if(n==W)return n;if(r&&(t=X),r=x(n)){var o=$t.call(n);if(!tr[o]||Zt&&p(n))return n;var i=yr(n)}if(!r||!t)return r?i?v(n):cr({},n):n;switch(r=rr[o],o){case zt:case Ct:return new r(+n);case Kt:case Vt:return new r(n);case Ut:return r(n.source,vt.exec(n))
}for(e||(e=[]),u||(u=[]),o=e.length;o--;)if(e[o]==n)return u[o];var a=i?r(n.length):{};return e.push(n),u.push(a),(i?R:pr)(n,function(n,r){a[r]=_(n,t,W,e,u)}),i&&(St.call(n,"index")&&(a.index=n.index),St.call(n,"input")&&(a.input=n.input)),a}function d(n){var t=[];return lr(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=sr(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function w(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(n==W||t==W)return n===t;var u=$t.call(n),o=$t.call(t);
if(u==Mt&&(u=Lt),o==Mt&&(o=Lt),u!=o)return X;switch(u){case zt:case Ct:return+n==+t;case Kt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Ut:case Vt:return n==t+""}if(o=u==Pt,!o){if(n.__wrapped__||t.__wrapped__)return w(n.__wrapped__||n,t.__wrapped__||t);if(u!=Lt||Zt&&(p(n)||p(t)))return X;var u=!Wt&&h(n)?Object:n.constructor,i=!Wt&&h(t)?Object:t.constructor;if(u!=i&&(!j(u)||!(u instanceof u&&j(i)&&i instanceof i)))return X}for(r||(r=[]),e||(e=[]),u=r.length;u--;)if(r[u]==n)return e[u]==t;var a=Q,f=0;
if(r.push(n),e.push(t),o){if(f=n.length,a=f==t.length)for(;f--&&(a=w(n[f],t[f],r,e)););return a}return lr(n,function(n,u,o){return St.call(o,u)?(f++,a=St.call(t,u)&&w(n,t[u],r,e)):void 0}),a&&lr(t,function(n,t,r){return St.call(r,t)?a=-1<--f:void 0}),a}function j(n){return typeof n=="function"}function x(n){return n?er[typeof n]:X}function O(n){return typeof n=="number"||$t.call(n)==Kt}function A(n){return typeof n=="string"||$t.call(n)==Vt}function S(n,t,r){var e=arguments,u=0,o=2;if(!n)return n;if(r===ot)var i=e[3],f=e[4],c=e[5];
else f=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?a(i,e[--o]):typeof(i=e[o-1])=="function"&&i);for(;++u<o;){var l=yr(e[u]);(l?R:pr)(e[u],function(t,r){var e,u,o=n[r];if(t&&((u=mr(t))||yr(t))){for(var a=f.length;a--;)if(e=f[a]==t){o=c[a];break}e||(o=u?mr(o)?o:{}:yr(o)?o:[],i&&(o=i(o,t)),f.push(t),c.push(o),o=o&&S(o,t,ot,i,f,c))}else i?o=i(o,t):(l||typeof t!="undefined")&&(o=t);n[r]=o})}return n}function E(n){for(var t=-1,r=sr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=X;return r=(0>r?It(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):C(n,t,r)):fr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function $(n,t,r){var e=Q;if(t=a(t,r),yr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else fr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function q(n,t,r){var e=[];if(t=a(t,r),yr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else fr(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,X):void 0}),e}function R(n,t,r){if(t&&typeof r=="undefined"&&yr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==X;);}else fr(n,t,r);return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),yr(n))for(;++e<u;)o[e]=t(n[e],e,n);else fr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function D(n,t,r){var e=-1/0,o=e;if(!t&&yr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)
}}else t=!t&&A(n)?u:a(t,r),fr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function I(n,t){return F(n,t+"")}function T(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,ot),yr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else fr(n,function(n,e,o){r=u?(u=X,n):t(r,n,e,o)});return r}function B(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=sr(n),o=f.length;else Yt&&A(n)&&(u=n.split(""));return t=a(t,e,ot),R(n,function(n,e,a){e=f?f[--o]:--o,r=i?(i=X,u[e]):t(r,u[e],e,a)
}),r}function M(n,t,r){var e;if(t=a(t,r),yr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else fr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function P(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==W||r)return n[0];return v(n,0,Tt(It(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];yr(o)?Et.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?It(0,u+r):r||0)-1;
else if(r)return e=L(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function K(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==W||r?1:It(0,t);return v(n,e)}function L(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e):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=X);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=St.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>C(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function V(n,t){return Ht||qt&&2<arguments.length?qt.call.apply(qt,arguments):i(n,t,v(arguments,2))}function G(n){return n}function H(n){R(d(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return Et.apply(n,arguments),new r(e.apply(r,n))}})}function J(){return this.__wrapped__}var Q=!0,W=null,X=!1,Y=typeof exports=="object"&&exports,Z=typeof global=="object"&&global;
Z.global===Z&&(n=Z);var nt,tt,rt=[],et={},ut=0,ot=et,it=30,at=n._,ft=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ct=/&(?:amp|lt|gt|quot|#x27);/g,lt=/\b__p\+='';/g,pt=/\b(__p\+=)''\+/g,st=/(__e\(.*?\)|\b__t\))\+'';/g,vt=/\w*$/,gt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ht=RegExp("^"+(et.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),yt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,mt=/<%=([\s\S]+?)%>/g,_t=/($^)/,dt=/[&<>"']/g,bt=/['\n\r\t\u2028\u2029\\]/g,wt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),jt=Math.ceil,xt=rt.concat,Ot=Math.floor,At=ht.test(At=Object.getPrototypeOf)&&At,St=et.hasOwnProperty,Et=rt.push,kt=et.propertyIsEnumerable,$t=et.toString,qt=ht.test(qt=v.bind)&&qt,Nt=ht.test(Nt=Array.isArray)&&Nt,Rt=n.isFinite,Ft=n.isNaN,Dt=ht.test(Dt=Object.keys)&&Dt,It=Math.max,Tt=Math.min,Bt=Math.random,Mt="[object Arguments]",Pt="[object Array]",zt="[object Boolean]",Ct="[object Date]",Kt="[object Number]",Lt="[object Object]",Ut="[object RegExp]",Vt="[object String]",Gt=!!n.attachEvent,Ht=qt&&/\n|true/.test(qt+Gt),Jt=(Jt={0:1,length:1},rt.splice.call(Jt,0,1),Jt[0]),Qt=Q;
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Qt=!r;nt=!/valueOf/.test(t),tt="x"!=t[0]})(1);var Wt=arguments.constructor==Object,Xt=!h(arguments),Yt="xx"!="x"[0]+Object("x")[0];try{var Zt=$t.call(document)==Lt&&!({toString:0}+"")}catch(nr){}var tr={"[object Function]":X};tr[Mt]=tr[Pt]=tr[zt]=tr[Ct]=tr[Kt]=tr[Lt]=tr[Ut]=tr[Vt]=Q;var rr={};rr[Pt]=Array,rr[zt]=Boolean,rr[Ct]=Date,rr[Lt]=Object,rr[Kt]=Number,rr[Ut]=RegExp,rr[Vt]=String;
var er={"boolean":X,"function":Q,object:Q,number:X,string:X,undefined:X},ur={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:mt,variable:"",imports:{_:r}};var or={a:"o,v,g",k:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){if((l=arguments[a])){",g:"t[i]=l[i]",c:"}}"},ir={b:Q,a:"d,c,w",k:"c=c&&typeof w=='undefined'?c:e(c,w)",g:"if(c(l[i],i,d)===false)return t"},ar={b:X},fr=f(ir),cr=f(or);
Xt&&(h=function(n){return n?St.call(n,"callee"):X});var lr=f(ir,ar,{l:X}),pr=f(ir,ar),sr=Dt?function(n){return typeof n=="function"&&kt.call(n,"prototype")?m(n):x(n)?Dt(n):[]}:m,vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},gr=b(vr),hr=f(or,{g:"if(t[i]==null)"+or.g}),yr=Nt||function(n){return Wt&&n instanceof Array||$t.call(n)==Pt};j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==$t.call(n)});var mr=At?function(n){if(!n||typeof n!="object")return X;var t=n.valueOf,r=typeof t=="function"&&(r=At(t))&&At(r);
return r?n==r||At(n)==r&&!h(n):y(n)}:y;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=cr,r.at=function(n){var t=-1,r=xt.apply(rt,v(arguments,1)),e=r.length,u=Array(e);for(Yt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=V,r.bindAll=function(n){for(var t=xt.apply(rt,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},r.bindKey=function(n,t){return i(n,t,v(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=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",St.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){a=W,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}},r.defaults=hr,r.defer=function(n){var r=v(arguments,1);
return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=xt.apply(rt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=q,r.flatten=z,r.forEach=R,r.forIn=lr,r.forOwn=pr,r.functions=d,r.groupBy=function(n,t,r){var e={};return t=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",(St.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=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==W||r?1:t||e;return v(n,0,Tt(It(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,a=100<=i,f=[],c=f;n:for(;++o<i;){var l=n[o];if(a)var p=l+"",p=St.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>C(c,l)){a&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;f.push(l)}}return f},r.invert=b,r.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},r.keys=sr,r.map=F,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return St.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&yr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<o&&(o=f)}}else t=!t&&A(n)?u:a(t,r),fr(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=a(t,r);else var o=xt.apply(rt,arguments);return lr(n,function(n,r,i){(e?!t(n,r,i):0>C(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=W,r)}},r.pairs=function(n){for(var t=-1,r=sr(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,v(arguments,1))},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=xt.apply(rt,arguments),i=o.length;++u<i;){var f=o[u];
f in n&&(e[f]=n[f])}else t=a(t,r),lr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=I,r.range=function(n,t,r){n=+n||0,r=+r||1,t==W&&(t=n,n=0);var e=-1;t=It(0,jt((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=a(t,r),q(n,function(n,r,e){return!t(n,r,e)})},r.rest=K,r.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=Ot(Bt()*(++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=a(t,r),R(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(){a=new Date,i=W,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=W,a=f,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"?Yt&&A(n)?n.split(""):v(n):E(n)
},r.union=function(){return U(xt.apply(rt,arguments))},r.uniq=U,r.values=E,r.where=function(n,t){return q(n,t)},r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1,20),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 Et.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?D(I(arguments,"length")):0,e=Array(r);++t<r;)e[t]=I(arguments,t);return e},r.collect=F,r.drop=K,r.each=R,r.extend=cr,r.methods=d,r.select=q,r.tail=K,r.unique=U,H(r),r.clone=_,r.cloneDeep=function(n){return _(n,Q)
},r.contains=k,r.escape=function(n){return n==W?"":(n+"").replace(dt,l)},r.every=$,r.find=N,r.has=function(n,t){return n?St.call(n,t):X},r.identity=G,r.indexOf=C,r.isArguments=h,r.isArray=yr,r.isBoolean=function(n){return n===Q||n===X||$t.call(n)==zt},r.isDate=function(n){return n instanceof Date||$t.call(n)==Ct},r.isElement=function(n){return n?1===n.nodeType:X},r.isEmpty=function(n){var t=Q;if(!n)return t;var r=$t.call(n),e=n.length;return r==Pt||r==Vt||r==Mt||Xt&&h(n)||r==Lt&&typeof e=="number"&&j(n.splice)?!e:(pr(n,function(){return t=X
}),t)},r.isEqual=w,r.isFinite=function(n){return Rt(n)&&!Ft(parseFloat(n))},r.isFunction=j,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===W},r.isNumber=O,r.isObject=x,r.isPlainObject=mr,r.isRegExp=function(n){return n instanceof RegExp||$t.call(n)==Ut},r.isString=A,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?It(0,e+r):Tt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=at,this
},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+Ot(Bt()*((+t||0)-n+1))},r.reduce=T,r.reduceRight=B,r.result=function(n,t){var r=n?n[t]:W;return j(r)?n[t]():r},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:sr(n).length},r.some=M,r.sortedIndex=L,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=hr({},u,o);var i=hr({},u.imports,o.imports),o=sr(i),i=E(i),a=0,f=u.interpolate||_t,l=!(1==o.length&&"_"==o[0]&&i[0]===r),p="__p+='";if(n.replace(RegExp((u.escape||_t).source+"|"+f.source+"|"+(f===mt?yt:_t).source+"|"+(u.evaluate||_t).source+"|$","g"),function(t,r,e,u,o,i){return e||(e=u),p+=n.slice(a,i).replace(bt,c),r&&(p+="'+__e("+r+")+'"),o&&(p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),l||(l=o||ft.test(r||e)),a=i+t.length,t
}),p+="';\n",f=u=u.variable,!f)if(u="obj",l)p="with("+u+"){"+p+"}";else var s=RegExp("(\\(\\s*)"+u+"\\."+u+"\\b","g"),p=p.replace(gt,"$&"+u+".").replace(s,"$1__d");p=(l?p.replace(lt,""):p).replace(pt,"$1").replace(st,"$1;"),p="function("+u+"){"+(f?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(l?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";try{var v=Function(o,"return "+p).apply(t,i)}catch(g){throw g.source=p,g}return e?v(e):(v.source=p,v)
},r.unescape=function(n){return n==W?"":(n+"").replace(ct,g)},r.uniqueId=function(n){var t=++ut;return(n==W?"":n+"")+t},r.all=$,r.any=M,r.detect=N,r.foldl=T,r.foldr=B,r.include=k,r.inject=T,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return Et.apply(t,arguments),n.apply(r,t)})}),r.first=P,r.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==W||r)return n[u-1];return v(n,It(0,u-e))
}},r.take=P,r.head=P,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||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=J,r.prototype.valueOf=J,fr(["join","pop","shift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),fr(["push","reverse","sort","unshift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this
}}),fr(["concat","slice","splice"],function(n){var t=rt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Jt&&fr(["pop","shift","splice"],function(n){var t=rt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):Y?typeof module=="object"&&module&&module.exports==Y?(module.exports=r)._=r:Y._=r:n._=r
;(function(n,t){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||ot);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(At.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return At.call(o,e)&&-1<L(o[e],r)}return-1<L(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 f=arguments,c=i?this:t;return o||(n=t[a]),r.length&&(f=f.length?(f=v(f),e?f.concat(r):r.concat(f)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=null,f=n.apply(c,f),A(f)?f:c):n.apply(c,f)}var o=O(n),i=!r,a=t;return i&&(r=t),o||(t=n),u}function a(n,t,r){if(!n)return J;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=cr(n);return function(t){for(var r=u.length,e=!1;r--&&(e=t[u[r]]===n[u[r]]););return e
}}return typeof t!="undefined"?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(){for(var n,t={e:Z,f:Ft,h:Jt,i:Xt,j:bt,b:!1,c:"",g:"",k:"",l:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="var f,i="+t.d+",p="+t.d+";if(!"+t.d+")return p;"+t.k+";",t.b?(e+="var j=i.length;f=-1;if(typeof j=='number'){",t.i&&(e+="if(h(i)){i=i.split('')}"),e+="while(++f<j){"+t.g+"}}else{"):t.h&&(e+="var j=i.length;f=-1;if(j&&g(i)){while(++f<j){f+='';"+t.g+"}}else{"),t.e||(e+="var q=typeof i=='function'&&o.call(i,'prototype');"),t.f&&t.l?(e+="var m=-1,n=l[typeof i]?k(i):[],j=n.length;while(++m<j){f=n[m];",t.e||(e+="if(!(q&&f=='prototype')){"),e+=t.g+"",t.e||(e+="}")):(e+="for(f in i){",(!t.e||t.l)&&(e+="if(",t.e||(e+="!(q&&f=='prototype')"),!t.e&&t.l&&(e+="&&"),t.l&&(e+="e.call(i,f)"),e+="){"),e+=t.g+";",(!t.e||t.l)&&(e+="}")),e+="}",t.e){e+="var d=i.constructor;";
for(var u=0;7>u;u++)e+="f='"+t.j[u]+"';if(","constructor"==t.j[u]&&(e+="!(d&&d.prototype===i)&&"),e+="e.call(i,f)){"+t.g+"}"}return(t.b||t.h)&&(e+="}"),e+=t.c+";return p",r("c,e,g,h,l,k,o","return function("+n+"){"+e+"}")(a,At,h,E,rr,Ft,Et)}function c(n){return"\\"+er[n]}function l(n){return lr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}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 pr[n]}function h(n){return kt.call(n)==Bt}function y(n){var t=!1;if(!n||typeof n!="object"||h(n))return t;var r=n.constructor;return!O(r)&&(!Yt||!p(n))||r instanceof r?nt?(ar(n,function(n,r,e){return t=!At.call(e,r),!1}),!1===t):(ar(n,function(n,r){t=r}),!1===t||At.call(n,t)):t}function m(n){var t=[];return fr(n,function(n,r){t.push(r)}),t}function _(n,t,r){for(var e=arguments,u=0,o=typeof r=="number"?2:e.length;++u<o;)(sr(e[u])?D:fr)(e[u],function(t,r){n[r]=t});return n
}function d(n,t,r,e,u){if(null==n)return n;if(r&&(t=!1),r=A(n)){var o=kt.call(n);if(!nr[o]||Yt&&p(n))return n;var i=sr(n)}if(!r||!t)return r?i?v(n):_({},n):n;switch(r=tr[o],o){case Pt:case zt:return new r(+n);case Ct:case Ut:return new r(n);case Lt:return r(n.source,st.exec(n))}for(e||(e=[]),u||(u=[]),o=e.length;o--;)if(e[o]==n)return u[o];var a=i?r(n.length):{};return e.push(n),u.push(a),(i?D:fr)(n,function(n,r){a[r]=d(n,t,null,e,u)}),i&&(At.call(n,"index")&&(a.index=n.index),At.call(n,"input")&&(a.input=n.input)),a
}function b(n,t,r){for(var e=arguments,u=0,o=typeof r=="number"?2:e.length;++u<o;)(sr(e[u])?D:fr)(e[u],function(t,r){null==n[r]&&(n[r]=t)});return n}function j(n){var t=[];return ar(n,function(n,r){O(n)&&t.push(r)}),t.sort()}function w(n){for(var t=-1,r=cr(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function x(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;var u=kt.call(n),o=kt.call(t);if(u==Bt&&(u=Kt),o==Bt&&(o=Kt),u!=o)return!1;switch(u){case Pt:case zt:return+n==+t;
case Ct:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Lt:case Ut:return n==t+""}if(o=u==Mt,!o){if(n.__wrapped__||t.__wrapped__)return x(n.__wrapped__||n,t.__wrapped__||t);if(u!=Kt||Yt&&(p(n)||p(t)))return!1;var u=!Qt&&h(n)?Object:n.constructor,i=!Qt&&h(t)?Object:t.constructor;if(u!=i&&(!O(u)||!(u instanceof u&&O(i)&&i instanceof i)))return!1}for(r||(r=[]),e||(e=[]),u=r.length;u--;)if(r[u]==n)return e[u]==t;var a=!0,f=0;if(r.push(n),e.push(t),o){if(f=n.length,a=f==t.length)for(;f--&&(a=x(n[f],t[f],r,e)););return a
}return ar(n,function(n,u,o){return At.call(o,u)?(f++,a=At.call(t,u)&&x(n,t[u],r,e)):void 0}),a&&ar(t,function(n,t,r){return At.call(r,t)?a=-1<--f:void 0}),a}function O(n){return typeof n=="function"}function A(n){return n?rr[typeof n]:!1}function S(n){return typeof n=="number"||kt.call(n)==Ct}function E(n){return typeof n=="string"||kt.call(n)==Ut}function k(n,t,r){var e=arguments,u=0,o=2;if(!n)return n;if(r===ut)var i=e[3],f=e[4],c=e[5];else f=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?a(i,e[--o]):typeof(i=e[o-1])=="function"&&i);
for(;++u<o;){var l=sr(e[u]);(l?D:fr)(e[u],function(t,r){var e,u,o=n[r];if(t&&((u=vr(t))||sr(t))){for(var a=f.length;a--;)if(e=f[a]==t){o=c[a];break}e||(o=u?vr(o)?o:{}:sr(o)?o:[],i&&(o=i(o,t)),f.push(t),c.push(o),o=o&&k(o,t,ut,i,f,c))}else i?o=i(o,t):(l||typeof t!="undefined")&&(o=t);n[r]=o})}return n}function $(n){for(var t=-1,r=cr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function R(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?Dt(0,u+r):r)||0,typeof u=="number"?o=-1<(E(n)?n.indexOf(t,r):L(n,t,r)):ir(n,function(n){return++e<r?void 0:!(o=n===t)
}),o}function q(n,t,r){var e=!0;if(t=a(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else ir(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=a(t,r),sr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else ir(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function F(n,t,r){var e;return t=a(t,r),D(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function D(n,t,r){if(t&&typeof r=="undefined"&&sr(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else ir(n,t,r);
return n}function I(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),sr(n))for(;++e<u;)o[e]=t(n[e],e,n);else ir(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function T(n,t,r){var e=-1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=!t&&E(n)?u:a(t,r),ir(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function B(n,t){return I(n,t+"")}function M(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,ut),sr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
}else ir(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function P(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=cr(n),o=f.length;else Xt&&E(n)&&(u=n.split(""));return t=a(t,e,ut),D(n,function(n,e,a){e=f?f[--o]:--o,r=i?(i=!1,u[e]):t(r,u[e],e,a)}),r}function z(n,t,r){var e;if(t=a(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else ir(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function C(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,null==e||r)return n[0];return v(n,0,It(Dt(0,e),u))}}function K(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];sr(o)?St.apply(u,t?o:K(o)):u.push(o)}return u}function L(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Dt(0,u+r):r||0)-1;else if(r)return e=V(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function U(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=null==t||r?1:Dt(0,t);
return v(n,e)}function V(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e):J,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function G(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=!1);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=At.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>L(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function H(n,t){return Gt||$t&&2<arguments.length?$t.call.apply($t,arguments):i(n,t,v(arguments,2))
}function J(n){return n}function Q(n){D(j(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),new r(e.apply(r,n))}})}function W(){return this.__wrapped__}var X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z,nt,tt=[],rt={},et=0,ut=rt,ot=30,it=n._,at=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ft=/&(?:amp|lt|gt|quot|#x27);/g,ct=/\b__p\+='';/g,lt=/\b(__p\+=)''\+/g,pt=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,vt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,gt=RegExp("^"+(rt.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ht=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,yt=/<%=([\s\S]+?)%>/g,mt=/($^)/,_t=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),jt=Math.ceil,wt=tt.concat,xt=Math.floor,Ot=gt.test(Ot=Object.getPrototypeOf)&&Ot,At=rt.hasOwnProperty,St=tt.push,Et=rt.propertyIsEnumerable,kt=rt.toString,$t=gt.test($t=v.bind)&&$t,Rt=gt.test(Rt=Array.isArray)&&Rt,qt=n.isFinite,Nt=n.isNaN,Ft=gt.test(Ft=Object.keys)&&Ft,Dt=Math.max,It=Math.min,Tt=Math.random,Bt="[object Arguments]",Mt="[object Array]",Pt="[object Boolean]",zt="[object Date]",Ct="[object Number]",Kt="[object Object]",Lt="[object RegExp]",Ut="[object String]",Vt=!!n.attachEvent,Gt=$t&&/\n|true/.test($t+Vt),Ht=(Ht={0:1,length:1},tt.splice.call(Ht,0,1),Ht[0]),Jt=!0;
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Jt=!r;Z=!/valueOf/.test(t),nt="x"!=t[0]})(1);var Qt=arguments.constructor==Object,Wt=!h(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Yt=kt.call(document)==Kt&&!1}catch(Zt){}var nr={"[object Function]":!1};nr[Bt]=nr[Mt]=nr[Pt]=nr[zt]=nr[Ct]=nr[Kt]=nr[Lt]=nr[Ut]=!0;var tr={};tr[Mt]=Array,tr[Pt]=Boolean,tr[zt]=Date,tr[Kt]=Object,tr[Ct]=Number,tr[Lt]=RegExp,tr[Ut]=String;var rr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},er={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yt,variable:"",imports:{_:r}};var ur={b:!0,a:"b,a,r",k:"a=a&&typeof r=='undefined'?a:c(a,r)",g:"if(a(i[f],f,b)===false)return p"},or={b:!1},ir=f(ur);Wt&&(h=function(n){return n?At.call(n,"callee"):!1});var ar=f(ur,or,{l:!1}),fr=f(ur,or),cr=Ft?function(n){return typeof n=="function"&&Et.call(n,"prototype")?m(n):A(n)?Ft(n):[]}:m,lr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},pr=w(lr),sr=Rt||function(n){return Qt&&n instanceof Array||kt.call(n)==Mt
};O(/x/)&&(O=function(n){return n instanceof Function||"[object Function]"==kt.call(n)});var vr=Ot?function(n){if(!n||typeof n!="object")return!1;var t=n.valueOf,r=typeof t=="function"&&(r=Ot(t))&&Ot(r);return r?n==r||Ot(n)==r&&!h(n):y(n)}:y;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=_,r.at=function(n){var t=-1,r=wt.apply(tt,v(arguments,1)),e=r.length,u=Array(e);for(Xt&&E(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=H,r.bindAll=function(n){for(var t=wt.apply(tt,arguments),r=1<t.length?0:(t=j(n),-1),e=t.length;++r<e;){var u=t[r];
n[u]=H(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(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=a(t,r),D(n,function(n,r,u){r=t(n,r,u)+"",At.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){a=null,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}},r.defaults=b,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=wt.apply(tt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=K,r.forEach=D,r.forIn=ar,r.forOwn=fr,r.functions=j,r.groupBy=function(n,t,r){var e={};
return t=a(t,r),D(n,function(n,r,u){r=t(n,r,u)+"",(At.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=a(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return v(n,0,It(Dt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,a=100<=i,f=[],c=f;n:for(;++o<i;){var l=n[o];if(a)var p=l+"",p=At.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>L(c,l)){a&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;
f.push(l)}}return f},r.invert=w,r.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 D(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=cr,r.map=I,r.max=T,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return At.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=k,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<o&&(o=f)
}}else t=!t&&E(n)?u:a(t,r),ir(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=a(t,r);else var o=wt.apply(tt,arguments);return ar(n,function(n,r,i){(e?!t(n,r,i):0>L(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=cr(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,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),null,ut)},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=wt.apply(tt,arguments),i=o.length;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),ar(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=B,r.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Dt(0,jt((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=a(t,r),N(n,function(n,r,e){return!t(n,r,e)
})},r.rest=U,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return D(n,function(n){var r=xt(Tt()*(++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=a(t,r),D(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(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=null,a=f,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"?Xt&&E(n)?n.split(""):v(n):$(n)},r.union=function(){return G(wt.apply(tt,arguments))},r.uniq=G,r.values=$,r.where=function(n,t){return N(n,t)},r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1,20),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 St.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?T(B(arguments,"length")):0,e=Array(r);++t<r;)e[t]=B(arguments,t);return e},r.collect=I,r.drop=U,r.each=D,r.extend=_,r.methods=j,r.select=N,r.tail=U,r.unique=G,Q(r),r.clone=d,r.cloneDeep=function(n){return d(n,!0)},r.contains=R,r.escape=function(n){return null==n?"":(n+"").replace(_t,l)},r.every=q,r.find=F,r.has=function(n,t){return n?At.call(n,t):!1},r.identity=J,r.indexOf=L,r.isArguments=h,r.isArray=sr,r.isBoolean=function(n){return!0===n||!1===n||kt.call(n)==Pt
},r.isDate=function(n){return n instanceof Date||kt.call(n)==zt},r.isElement=function(n){return n?1===n.nodeType:!1},r.isEmpty=function(n){var t=!0;if(!n)return t;var r=kt.call(n),e=n.length;return r==Mt||r==Ut||r==Bt||Wt&&h(n)||r==Kt&&typeof e=="number"&&O(n.splice)?!e:(fr(n,function(){return t=!1}),t)},r.isEqual=x,r.isFinite=function(n){return qt(n)&&!Nt(parseFloat(n))},r.isFunction=O,r.isNaN=function(n){return S(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=S,r.isObject=A,r.isPlainObject=vr,r.isRegExp=function(n){return n instanceof RegExp||kt.call(n)==Lt
},r.isString=E,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?Dt(0,e+r):It(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=Q,r.noConflict=function(){return n._=it,this},r.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+xt(Tt()*((+t||0)-n+1))},r.reduce=M,r.reduceRight=P,r.result=function(n,t){var r=n?n[t]:null;return O(r)?n[t]():r},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:cr(n).length
},r.some=z,r.sortedIndex=V,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=b({},u,o);var i=b({},u.imports,o.imports),o=cr(i),i=$(i),a=0,f=u.interpolate||mt,l=!(1==o.length&&"_"==o[0]&&i[0]===r),p="__p+='";if(n.replace(RegExp((u.escape||mt).source+"|"+f.source+"|"+(f===yt?ht:mt).source+"|"+(u.evaluate||mt).source+"|$","g"),function(t,r,e,u,o,i){return e||(e=u),p+=n.slice(a,i).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),l||(l=o||at.test(r||e)),a=i+t.length,t
}),p+="';\n",f=u=u.variable,!f)if(u="obj",l)p="with("+u+"){"+p+"}";else var s=RegExp("(\\(\\s*)"+u+"\\."+u+"\\b","g"),p=p.replace(vt,"$&"+u+".").replace(s,"$1__d");p=(l?p.replace(ct,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+u+"){"+(f?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(l?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";try{var v=Function(o,"return "+p).apply(t,i)}catch(g){throw g.source=p,g}return e?v(e):(v.source=p,v)
},r.unescape=function(n){return null==n?"":(n+"").replace(ft,g)},r.uniqueId=function(n){var t=++et;return(null==n?"":n+"")+t},r.all=q,r.any=z,r.detect=F,r.foldl=M,r.foldr=P,r.include=R,r.inject=M,fr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),n.apply(r,t)})}),r.first=C,r.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,null==e||r)return n[u-1];return v(n,Dt(0,u-e))
}},r.take=C,r.head=C,fr(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=W,r.prototype.valueOf=W,ir(["join","pop","shift"],function(n){var t=tt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),ir(["push","reverse","sort","unshift"],function(n){var t=tt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this
}}),ir(["concat","slice","splice"],function(n){var t=tt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Ht&&ir(["pop","shift","splice"],function(n){var t=tt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=r)._=r:X._=r:n._=r
})(this);

View File

@@ -1,10 +1,10 @@
/**
* @license
* Lo-Dash 1.0.0-rc.3 (Custom Build) <http://lodash.com>
* Lo-Dash 1.0.0-rc.3 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore -d -o ./lodash.underscore.js`
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
* Based on Underscore.js 1.4.3 <http://underscorejs.org>
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.3 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license>
*/
;(function(window, undefined) {
@@ -192,10 +192,10 @@
* `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`,
* `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`,
* `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`,
* `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `pick`, `pluck`,
* `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
* `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`,
* `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
* `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
* `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`,
* `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`,
@@ -272,18 +272,6 @@
/*--------------------------------------------------------------------------*/
/** Reusable iterator options for `assign` and `defaults` */
var assignIteratorOptions = {
'args': 'object, source, guard',
'top':
'var argsIndex = 0,\n' +
" argsLength = typeof guard == 'number' ? 2 : arguments.length;\n" +
'while (++argsIndex < argsLength) {\n' +
' if ((iteratee = arguments[argsIndex])) {',
'loop': 'result[index] = iteratee[index]',
'bottom': ' }\n}'
};
/** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */
var eachIteratorOptions = {
'arrays': true,
@@ -341,14 +329,15 @@
}
/**
* Creates a function that, when called, invokes `func` with the `this`
* binding of `thisArg` and prepends any `partailArgs` to the arguments passed
* to the bound function.
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partailArgs` to the arguments passed to the
* bound function.
*
* @private
* @param {Function|String} func The function to bind or the method name.
* @param {Mixed} [thisArg] The `this` binding of `func`.
* @param {Array} partialArgs An array of arguments to be partially applied.
* @param {Object} [right] Used to indicate partially applying arguments from the right.
* @returns {Function} Returns the new bound function.
*/
function createBound(func, thisArg, partialArgs) {
@@ -596,38 +585,6 @@
}
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
*
* @static
* @memberOf _
* @alias extend
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*/
function assign(object) {
if (!object) {
return object;
}
for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {
var iteratee = arguments[argsIndex];
if (iteratee) {
for (var key in iteratee) {
object[key] = iteratee[key];
}
}
}
return object;
}
/**
* Checks if `value` is an `arguments` object.
*
@@ -811,6 +768,38 @@
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the `destination`
* object. Subsequent sources will overwrite propery assignments of previous
* sources.
*
* @static
* @memberOf _
* @alias extend
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow this method to work with
* `_.reduce` without using its callback's `key and `object` arguments as sources.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'moe' }, { 'age': 40 });
* // => { 'name': 'moe', 'age': 40 }
*/
function assign(object, source, guard) {
var args = arguments,
index = 0,
length = typeof guard == 'number' ? 2 : args.length;
while (++index < length) {
(isArray(args[index]) ? forEach : forOwn)(args[index], function(value, key) {
object[key] = value;
});
}
return object;
}
/**
* Creates a clone of `value`. If `deep` is `true`, nested objects will also
* be cloned, otherwise they will be assigned by reference.
@@ -859,6 +848,8 @@
* @category Objects
* @param {Object} object The destination object.
* @param {Object} [source1, source2, ...] The source objects.
* @param- {Object} [guard] Internally used to allow this method to work with
* `_.reduce` without using its callback's `key` and `object` arguments as sources.
* @returns {Object} Returns the destination object.
* @example
*
@@ -866,19 +857,17 @@
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
*/
function defaults(object) {
if (!object) {
return object;
}
for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {
var iteratee = arguments[argsIndex];
if (iteratee) {
for (var key in iteratee) {
if (object[key] == null) {
object[key] = iteratee[key];
}
function defaults(object, source, guard) {
var args = arguments,
index = 0,
length = typeof guard == 'number' ? 2 : args.length;
while (++index < length) {
(isArray(args[index]) ? forEach : forOwn)(args[index], function(value, key) {
if (object[key] == null) {
object[key] = value;
}
}
});
}
return object;
}
@@ -2043,7 +2032,8 @@
}
/**
* The right-associative version of `_.reduce`.
* This method is similar to `_.reduce`, except that it iterates over a
* `collection` from right to left.
*
* @static
* @memberOf _
@@ -2677,8 +2667,7 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`. This method is a port of Python's
* `range()` function. See http://docs.python.org/library/functions.html#range.
* `start` up to but not including `end`.
*
* @static
* @memberOf _

View File

@@ -4,29 +4,29 @@
* Build: `lodash underscore -m -o ./lodash.underscore.min.js`
* Underscore.js 1.4.3 underscorejs.org/LICENSE
*/
;(function(n,t){function r(n,t){var r;if(n)for(r in t||(t=P),n)if(t(n[r],r,n)===W)break}function e(n,t,r){if(n){t=t&&typeof r=="undefined"?t:i(t,r);var e=n.length;if(r=-1,typeof e=="number")for(;++r<e&&t(n[r],r,n)!==W;);else for(r in n)if(it.call(n,r)&&t(n[r],r,n)===W)break}}function u(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof u?(this.__wrapped__=n,void 0):new u(n)}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){if(!n)return P;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=kt(n);return function(t){for(var r=u.length,e=H;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?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 a(n){return"\\"+Nt[n]}function f(n){return Ft[n]}function c(){}function l(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 Rt[n]}function p(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 v(n){var t,r=[],e=function(n,t){r.push(t)};if(n)for(t in e||(e=P),n)if(it.call(n,t)&&e(n[t],t,n)===W)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]==G&&(n[u]=e[u])}return n}function h(n){var t=[];return r(n,function(n,r){m(n)&&t.push(r)}),t.sort()}function y(n){for(var t=-1,r=kt(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function _(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;if(n==G||t==G)return n===t;var o=ft.call(n),i=ft.call(t);if(o!=i)return H;switch(o){case mt:case dt:return+n==+t;case bt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case wt:case At:return n==t+""}if(i=o==_t,!i){if(n.__wrapped__||t.__wrapped__)return _(n.__wrapped__||n,t.__wrapped__||t);if(o!=jt)return H;var o=n.constructor,a=t.constructor;if(o!=a&&(!m(o)||!(o instanceof o&&m(a)&&a instanceof a)))return H}for(e||(e=[]),u||(u=[]),o=e.length;o--;)if(e[o]==n)return u[o]==t;
var f=V,c=0;if(e.push(n),u.push(t),i){if(c=n.length,f=c==t.length)for(;c--&&(f=_(n[c],t[c],e,u)););return f}return r(n,function(n,r,o){return it.call(o,r)?(c++,!(f=it.call(t,r)&&_(n,t[r],e,u))&&W):void 0}),f&&r(t,function(n,t,r){return it.call(r,t)?!(f=-1<--c)&&W:void 0}),f}function m(n){return typeof n=="function"}function d(n){return n?St[typeof n]:H}function b(n){return typeof n=="number"||ft.call(n)==bt}function j(n){return typeof n=="string"||ft.call(n)==At}function w(n){for(var t=-1,r=kt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
return u}function A(n,t){var r=H;return typeof(n?n.length:0)=="number"?r=-1<M(n,t):e(n,function(n){return(r=n===t)&&W}),r}function x(n,t,r){var u=V;if(t=i(t,r),Tt(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))&&W});return u}function E(n,t,r){var u=[];if(t=i(t,r),Tt(n)){r=-1;for(var o=n.length;++r<o;){var a=n[r];t(a,r,n)&&u.push(a)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)});return u}function O(n,t,r){var e;return t=i(t,r),S(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0
}),e}function S(n,t,r){if(t&&typeof r=="undefined"&&Tt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==W;);}else e(n,t,r)}function N(n,t,r){var u=-1,o=n?n.length:0,a=Array(typeof o=="number"?o:0);if(t=i(t,r),Tt(n))for(;++u<o;)a[u]=t(n[u],u,n);else e(n,function(n,r,e){a[++u]=t(n,r,e)});return a}function k(n,t,r){var u=-1/0,o=u;if(!t&&Tt(n)){r=-1;for(var a=n.length;++r<a;){var f=n[r];f>o&&(o=f)}}else t=i(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function F(n,t){return N(n,t+"")
}function R(n,t,r,u){var o=3>arguments.length;if(t=i(t,u,W),Tt(n)){var a=-1,f=n.length;for(o&&(r=n[++a]);++a<f;)r=t(r,n[a],a,n)}else e(n,function(n,e,u){r=o?(o=H,n):t(r,n,e,u)});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var a=kt(n),u=a.length;return t=i(t,e,W),S(n,function(e,i,f){i=a?a[--u]:--u,r=o?(o=H,n[i]):t(r,n[i],i,f)}),r}function q(n,t,r){var u;if(t=i(t,r),Tt(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))&&W
});return!!u}function B(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=i(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==G||r)return n[0];return l(n,0,ht(gt(0,e),u))}}function D(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Tt(o)?at.apply(u,t?o:D(o)):u.push(o)}return u}function M(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?gt(0,u+r):r||0)-1;else if(r)return e=I(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function $(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;
for(t=i(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==G||r?1:gt(0,t);return l(n,e)}function I(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?i(r,e):P,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function z(n,t,r,e){var u=-1,o=n?n.length:0,a=[],f=a;for(typeof t=="function"&&(e=r,r=t,t=H),r&&(f=[],r=i(r,e));++u<o;){e=n[u];var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>M(f,c))&&(r&&f.push(c),a.push(e))}return a}function C(n,t){var r;if(xt||ct&&2<arguments.length)r=ct.call.apply(ct,arguments);else{var e=n,u=t,o=l(arguments,2),i=function(){var n=arguments,t=u;
return o.length&&(n=n.length?o.concat(l(n)):o),this instanceof i?(c.prototype=e.prototype,t=new c,c.prototype=G,n=e.apply(t,n),d(n)?n:t):e.apply(t,n)};r=i}return r}function P(n){return n}function U(n){S(h(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return at.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=V),n}})}var V=!0,G=null,H=!1,J=typeof exports=="object"&&exports,K=typeof global=="object"&&global;K.global===K&&(n=K);var L=[],K={},Q=0,W=K,X=n._,Y=/&(?:amp|lt|gt|quot|#x27);/g,Z=RegExp("^"+(K.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),nt=/($^)/,tt=/[&<>"']/g,rt=/['\n\r\t\u2028\u2029\\]/g,et=Math.ceil,ut=L.concat,ot=Math.floor,it=K.hasOwnProperty,at=L.push,ft=K.toString,ct=Z.test(ct=l.bind)&&ct,lt=Z.test(lt=Array.isArray)&&lt,st=n.isFinite,pt=n.isNaN,vt=Z.test(vt=Object.keys)&&vt,gt=Math.max,ht=Math.min,yt=Math.random,_t="[object Array]",mt="[object Boolean]",dt="[object Date]",bt="[object Number]",jt="[object Object]",wt="[object RegExp]",At="[object String]",K=!!n.attachEvent,xt=ct&&/\n|true/.test(ct+K),Et=(Et={0:1,length:1},L.splice.call(Et,0,1),Et[0]),Ot=arguments.constructor==Object,St={"boolean":H,"function":V,object:V,number:H,string:H,undefined:H},Nt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},u.isArguments=function(n){return"[object Arguments]"==ft.call(n)},u.isArguments(arguments)||(u.isArguments=function(n){return n?it.call(n,"callee"):H});var kt=vt?function(n){return d(n)?vt(n):[]}:v,Ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Rt=y(Ft),Tt=lt||function(n){return Ot&&n instanceof Array||ft.call(n)==_t};m(/x/)&&(m=function(n){return n instanceof Function||"[object Function]"==ft.call(n)
}),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},u.bind=C,u.bindAll=function(n){for(var t=ut.apply(L,arguments),r=1<t.length?0:(t=h(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=C(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=i(t,r),S(n,function(n,r,u){r=t(n,r,u)+"",it.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=G,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=g,u.defer=function(n){var r=l(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},u.delay=function(n,r){var e=l(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},u.difference=function(n){for(var t=-1,r=n.length,e=ut.apply(L,arguments),u=[];++t<r;){var o=n[t];
0>M(e,o,r)&&u.push(o)}return u},u.filter=E,u.flatten=D,u.forEach=S,u.functions=h,u.groupBy=function(n,t,r){var e={};return t=i(t,r),S(n,function(n,r,u){r=t(n,r,u)+"",(it.call(e,r)?e[r]:e[r]=[]).push(n)}),e},u.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=i(t,r);o--&&t(n[o],o,n);)e++}else e=t==G||r?1:t||e;return l(n,0,ht(gt(0,u-e),u))},u.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>M(o,i)){for(var a=r;--a;)if(0>M(t[a],i))continue n;
o.push(i)}}return o},u.invert=y,u.invoke=function(n,t){var r=l(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return S(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},u.keys=kt,u.map=N,u.max=k,u.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return it.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},u.min=function(n,t,r){var u=1/0,o=u;if(!t&&Tt(n)){r=-1;for(var a=n.length;++r<a;){var f=n[r];f<o&&(o=f)}}else t=i(t,r),e(n,function(n,r,e){r=t(n,r,e),r<u&&(u=r,o=n)
});return o},u.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},u.omit=function(n){var t=ut.apply(L,arguments),e={};return r(n,function(n,r){0>M(t,r,1)&&(e[r]=n)}),e},u.once=function(n){var t,r;return function(){return t?r:(t=V,r=n.apply(this,arguments),n=G,r)}},u.pairs=function(n){for(var t=-1,r=kt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},u.pick=function(n){for(var t=0,r=ut.apply(L,arguments),e=r.length,u={};++t<e;){var o=r[t];
o in n&&(u[o]=n[o])}return u},u.pluck=F,u.range=function(n,t,r){n=+n||0,r=+r||1,t==G&&(t=n,n=0);var e=-1;t=gt(0,et((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},u.reject=function(n,t,r){return t=i(t,r),E(n,function(n,r,e){return!t(n,r,e)})},u.rest=$,u.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return S(n,function(n){var r=ot(yt()*(++t+1));e[t]=e[r],e[r]=n}),e},u.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,a=Array(typeof u=="number"?u:0);for(t=i(t,r),S(n,function(n,r,u){a[++e]={a:t(n,r,u),b:e,c:n}
}),u=a.length,a.sort(o);u--;)a[u]=a[u].c;return a},u.tap=function(n,t){return t(n),n},u.throttle=function(n,t){function r(){a=new Date,i=G,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=G,a=f,u=n.apply(o,e)),u}},u.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},u.toArray=function(n){return n&&typeof n.length=="number"?l(n):w(n)},u.union=function(){return z(ut.apply(L,arguments))
},u.uniq=z,u.values=w,u.where=function(n,t){return E(n,t)},u.without=function(n){for(var t=-1,r=n.length,e=[];++t<r;){var u=n[t];0>M(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,t){return function(){var r=[n];return at.apply(r,arguments),t.apply(this,r)}},u.zip=function(n){for(var t=-1,r=n?k(F(arguments,"length")):0,e=Array(r);++t<r;)e[t]=F(arguments,t);return e},u.collect=N,u.drop=$,u.each=S,u.extend=p,u.methods=h,u.select=E,u.tail=$,u.unique=z,u.clone=function(n){return n&&St[typeof n]?Tt(n)?l(n):p({},n):n
},u.contains=A,u.escape=function(n){return n==G?"":(n+"").replace(tt,f)},u.every=x,u.find=O,u.has=function(n,t){return n?it.call(n,t):H},u.identity=P,u.indexOf=M,u.isArray=Tt,u.isBoolean=function(n){return n===V||n===H||ft.call(n)==mt},u.isDate=function(n){return n instanceof Date||ft.call(n)==dt},u.isElement=function(n){return n?1===n.nodeType:H},u.isEmpty=function(n){if(!n)return V;if(Tt(n)||j(n))return!n.length;for(var t in n)if(it.call(n,t))return H;return V},u.isEqual=_,u.isFinite=function(n){return st(n)&&!pt(parseFloat(n))
},u.isFunction=m,u.isNaN=function(n){return b(n)&&n!=+n},u.isNull=function(n){return n===G},u.isNumber=b,u.isObject=d,u.isRegExp=function(n){return n instanceof RegExp||ft.call(n)==wt},u.isString=j,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?gt(0,e+r):ht(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=U,u.noConflict=function(){return n._=X,this},u.random=function(n,t){return n==G&&t==G&&(t=1),n=+n||0,t==G&&(t=n,n=0),n+ot(yt()*((+t||0)-n+1))
},u.reduce=R,u.reduceRight=T,u.result=function(n,t){var r=n?n[t]:G;return m(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:kt(n).length},u.some=q,u.sortedIndex=I,u.template=function(n,t,r){n||(n=""),r=g({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||nt).source+"|"+(r.interpolate||nt).source+"|"+(r.evaluate||nt).source+"|$","g"),function(t,r,u,i,f){o+=n.slice(e,f).replace(rt,a),o+=r?"'+_['escape']("+r+")+'":i?"';"+i+";__p+='":u?"'+((__t=("+u+"))==null?'':__t)+'":"",e=f+t.length
}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var f=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?f(t):(f.source=o,f)},u.unescape=function(n){return n==G?"":(n+"").replace(Y,s)},u.uniqueId=function(n){var t=++Q+"";return n?n+t:t},u.all=x,u.any=q,u.detect=O,u.foldl=R,u.foldr=T,u.include=A,u.inject=R,u.first=B,u.last=function(n,t,r){if(n){var e=0,u=n.length;
if(typeof t=="function"){var o=u;for(t=i(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==G||r)return n[u-1];return l(n,gt(0,u-e))}},u.take=B,u.head=B,u.chain=function(n){return n=new u(n),n.__chain__=V,n},u.VERSION="1.0.0-rc.3",U(u),u.prototype.chain=function(){return this.__chain__=V,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=L[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Et&&0===n.length&&delete n[0],this
}}),e(["concat","join","slice"],function(n){var t=L[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=V),n}}),J?typeof module=="object"&&module&&module.exports==J?(module.exports=u)._=u:J._=u:n._=u})(this);
;(function(n,t){function r(n,t){var r;if(!n)return n;t||(t=U);for(r in n)if(at.call(n,r)&&t(n[r],r,n)===X)break;return n}function e(n,t){var r;if(n)for(r in t||(t=U),n)if(t(n[r],r,n)===X)break}function u(n,t,r){if(n){t=t&&typeof r=="undefined"?t:a(t,r);var e=n.length;if(r=-1,typeof e=="number")for(;++r<e&&t(n[r],r,n)!==X;);else for(r in n)if(at.call(n,r)&&t(n[r],r,n)===X)break}}function o(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof o?(this.__wrapped__=n,void 0):new o(n)}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 a(n,t,r){if(!n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Ft(n);return function(t){for(var r=u.length,e=J;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?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"\\"+kt[n]}function c(n){return Rt[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 Tt[n]}function v(n){var t=[];return r(n,function(n,r){t.push(r)}),t}function g(n,t,e){for(var u=arguments,o=0,i=typeof e=="number"?2:u.length;++o<i;)(qt(u[o])?N:r)(u[o],function(t,r){n[r]=t});return n}function h(n,t,e){for(var u=arguments,o=0,i=typeof e=="number"?2:u.length;++o<i;)(qt(u[o])?N:r)(u[o],function(t,r){n[r]==H&&(n[r]=t)});return n}function y(n){var t=[];return e(n,function(n,r){d(n)&&t.push(r)}),t.sort()
}function _(n){for(var t=-1,r=Ft(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function m(n,t,r,u){if(n===t)return 0!==n||1/n==1/t;if(n==H||t==H)return n===t;var o=ct.call(n),i=ct.call(t);if(o!=i)return J;switch(o){case dt:case bt:return+n==+t;case jt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case At:case xt:return n==t+""}if(i=o==mt,!i){if(n.__wrapped__||t.__wrapped__)return m(n.__wrapped__||n,t.__wrapped__||t);if(o!=wt)return J;var o=n.constructor,a=t.constructor;if(o!=a&&(!d(o)||!(o instanceof o&&d(a)&&a instanceof a)))return J
}for(r||(r=[]),u||(u=[]),o=r.length;o--;)if(r[o]==n)return u[o]==t;var f=G,c=0;if(r.push(n),u.push(t),i){if(c=n.length,f=c==t.length)for(;c--&&(f=m(n[c],t[c],r,u)););return f}return e(n,function(n,e,o){return at.call(o,e)?(c++,!(f=at.call(t,e)&&m(n,t[e],r,u))&&X):void 0}),f&&e(t,function(n,t,r){return at.call(r,t)?!(f=-1<--c)&&X:void 0}),f}function d(n){return typeof n=="function"}function b(n){return n?Nt[typeof n]:J}function j(n){return typeof n=="number"||ct.call(n)==jt}function w(n){return typeof n=="string"||ct.call(n)==xt
}function A(n){for(var t=-1,r=Ft(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function x(n,t){var r=J;return typeof(n?n.length:0)=="number"?r=-1<$(n,t):u(n,function(n){return(r=n===t)&&X}),r}function E(n,t,r){var e=G;if(t=a(t,r),qt(n)){r=-1;for(var o=n.length;++r<o&&(e=!!t(n[r],r,n)););}else u(n,function(n,r,u){return!(e=!!t(n,r,u))&&X});return e}function O(n,t,r){var e=[];if(t=a(t,r),qt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];t(i,r,n)&&e.push(i)}}else u(n,function(n,r,u){t(n,r,u)&&e.push(n)
});return e}function S(n,t,r){var e;return t=a(t,r),N(n,function(n,r,u){return t(n,r,u)?(e=n,X):void 0}),e}function N(n,t,r){if(t&&typeof r=="undefined"&&qt(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==X;);}else u(n,t,r)}function k(n,t,r){var e=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),qt(n))for(;++e<o;)i[e]=t(n[e],e,n);else u(n,function(n,r,u){i[++e]=t(n,r,u)});return i}function F(n,t,r){var e=-1/0,o=e;if(!t&&qt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),u(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)
});return o}function R(n,t){return k(n,t+"")}function T(n,t,r,e){var o=3>arguments.length;if(t=a(t,e,X),qt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else u(n,function(n,e,u){r=o?(o=J,n):t(r,n,e,u)});return r}function q(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Ft(n),u=i.length;return t=a(t,e,X),N(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=J,n[a]):t(r,n[a],a,f)}),r}function B(n,t,r){var e;if(t=a(t,r),qt(n)){r=-1;for(var o=n.length;++r<o&&!(e=t(n[r],r,n)););}else u(n,function(n,r,u){return(e=t(n,r,u))&&X
});return!!e}function D(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==H||r)return n[0];return p(n,0,yt(ht(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];qt(o)?ft.apply(u,t?o:M(o)):u.push(o)}return u}function $(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?ht(0,u+r):r||0)-1;else if(r)return e=z(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function I(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==H||r?1:ht(0,t);return p(n,e)}function z(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e):U,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function C(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=J),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>$(f,c))&&(r&&f.push(c),i.push(e))}return i}function P(n,t){var r;if(Et||lt&&2<arguments.length)r=lt.call.apply(lt,arguments);else{var e=n,u=t,o=p(arguments,2),i=function(){var n=arguments,t=u;
return o.length&&(n=n.length?o.concat(p(n)):o),this instanceof i?(l.prototype=e.prototype,t=new l,l.prototype=H,n=e.apply(t,n),b(n)?n:t):e.apply(t,n)};r=i}return r}function U(n){return n}function V(n){N(y(n),function(t){var r=o[t]=n[t];o.prototype[t]=function(){var n=[this.__wrapped__];return ft.apply(n,arguments),n=r.apply(o,n),this.__chain__&&(n=new o(n),n.__chain__=G),n}})}var G=!0,H=null,J=!1,K=typeof exports=="object"&&exports,L=typeof global=="object"&&global;L.global===L&&(n=L);var Q=[],L={},W=0,X=L,Y=n._,Z=/&(?:amp|lt|gt|quot|#x27);/g,nt=RegExp("^"+(L.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),tt=/($^)/,rt=/[&<>"']/g,et=/['\n\r\t\u2028\u2029\\]/g,ut=Math.ceil,ot=Q.concat,it=Math.floor,at=L.hasOwnProperty,ft=Q.push,ct=L.toString,lt=nt.test(lt=p.bind)&&lt,pt=nt.test(pt=Array.isArray)&&pt,st=n.isFinite,vt=n.isNaN,gt=nt.test(gt=Object.keys)&&gt,ht=Math.max,yt=Math.min,_t=Math.random,mt="[object Array]",dt="[object Boolean]",bt="[object Date]",jt="[object Number]",wt="[object Object]",At="[object RegExp]",xt="[object String]",L=!!n.attachEvent,Et=lt&&/\n|true/.test(lt+L),Ot=(Ot={0:1,length:1},Q.splice.call(Ot,0,1),Ot[0]),St=arguments.constructor==Object,Nt={"boolean":J,"function":G,object:G,number:J,string:J,undefined:J},kt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},o.isArguments=function(n){return"[object Arguments]"==ct.call(n)},o.isArguments(arguments)||(o.isArguments=function(n){return n?at.call(n,"callee"):J});var Ft=gt?function(n){return b(n)?gt(n):[]}:v,Rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Tt=_(Rt),qt=pt||function(n){return St&&n instanceof Array||ct.call(n)==mt};d(/x/)&&(d=function(n){return n instanceof Function||"[object Function]"==ct.call(n)
}),o.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},o.bind=P,o.bindAll=function(n){for(var t=ot.apply(Q,arguments),r=1<t.length?0:(t=y(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=P(n[u],n)}return n},o.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},o.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},o.countBy=function(n,t,r){var e={};
return t=a(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",at.call(e,r)?e[r]++:e[r]=1}),e},o.debounce=function(n,t,r){function e(){a=H,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}},o.defaults=h,o.defer=function(n){var r=p(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},o.delay=function(n,r){var e=p(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},o.difference=function(n){for(var t=-1,r=n.length,e=ot.apply(Q,arguments),u=[];++t<r;){var o=n[t];
0>$(e,o,r)&&u.push(o)}return u},o.filter=O,o.flatten=M,o.forEach=N,o.functions=y,o.groupBy=function(n,t,r){var e={};return t=a(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",(at.call(e,r)?e[r]:e[r]=[]).push(n)}),e},o.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==H||r?1:t||e;return p(n,0,yt(ht(0,u-e),u))},o.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>$(o,i)){for(var a=r;--a;)if(0>$(t[a],i))continue n;
o.push(i)}}return o},o.invert=_,o.invoke=function(n,t){var r=p(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},o.keys=Ft,o.map=k,o.max=F,o.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return at.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},o.min=function(n,t,r){var e=1/0,o=e;if(!t&&qt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<o&&(o=f)}}else t=a(t,r),u(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)
});return o},o.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},o.omit=function(n){var t=ot.apply(Q,arguments),r={};return e(n,function(n,e){0>$(t,e,1)&&(r[e]=n)}),r},o.once=function(n){var t,r;return function(){return t?r:(t=G,r=n.apply(this,arguments),n=H,r)}},o.pairs=function(n){for(var t=-1,r=Ft(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},o.pick=function(n){for(var t=0,r=ot.apply(Q,arguments),e=r.length,u={};++t<e;){var o=r[t];
o in n&&(u[o]=n[o])}return u},o.pluck=R,o.range=function(n,t,r){n=+n||0,r=+r||1,t==H&&(t=n,n=0);var e=-1;t=ht(0,ut((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},o.reject=function(n,t,r){return t=a(t,r),O(n,function(n,r,e){return!t(n,r,e)})},o.rest=I,o.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=it(_t()*(++t+1));e[t]=e[r],e[r]=n}),e},o.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),N(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},o.tap=function(n,t){return t(n),n},o.throttle=function(n,t){function r(){a=new Date,i=H,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=H,a=f,u=n.apply(o,e)),u}},o.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},o.toArray=function(n){return n&&typeof n.length=="number"?p(n):A(n)},o.union=function(){return C(ot.apply(Q,arguments))
},o.uniq=C,o.values=A,o.where=function(n,t){return O(n,t)},o.without=function(n){for(var t=-1,r=n.length,e=[];++t<r;){var u=n[t];0>$(arguments,u,1)&&e.push(u)}return e},o.wrap=function(n,t){return function(){var r=[n];return ft.apply(r,arguments),t.apply(this,r)}},o.zip=function(n){for(var t=-1,r=n?F(R(arguments,"length")):0,e=Array(r);++t<r;)e[t]=R(arguments,t);return e},o.collect=k,o.drop=I,o.each=N,o.extend=g,o.methods=y,o.select=O,o.tail=I,o.unique=C,o.clone=function(n){return n&&Nt[typeof n]?qt(n)?p(n):g({},n):n
},o.contains=x,o.escape=function(n){return n==H?"":(n+"").replace(rt,c)},o.every=E,o.find=S,o.has=function(n,t){return n?at.call(n,t):J},o.identity=U,o.indexOf=$,o.isArray=qt,o.isBoolean=function(n){return n===G||n===J||ct.call(n)==dt},o.isDate=function(n){return n instanceof Date||ct.call(n)==bt},o.isElement=function(n){return n?1===n.nodeType:J},o.isEmpty=function(n){if(!n)return G;if(qt(n)||w(n))return!n.length;for(var t in n)if(at.call(n,t))return J;return G},o.isEqual=m,o.isFinite=function(n){return st(n)&&!vt(parseFloat(n))
},o.isFunction=d,o.isNaN=function(n){return j(n)&&n!=+n},o.isNull=function(n){return n===H},o.isNumber=j,o.isObject=b,o.isRegExp=function(n){return n instanceof RegExp||ct.call(n)==At},o.isString=w,o.isUndefined=function(n){return typeof n=="undefined"},o.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?ht(0,e+r):yt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},o.mixin=V,o.noConflict=function(){return n._=Y,this},o.random=function(n,t){return n==H&&t==H&&(t=1),n=+n||0,t==H&&(t=n,n=0),n+it(_t()*((+t||0)-n+1))
},o.reduce=T,o.reduceRight=q,o.result=function(n,t){var r=n?n[t]:H;return d(r)?n[t]():r},o.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ft(n).length},o.some=B,o.sortedIndex=z,o.template=function(n,t,r){n||(n=""),r=h({},r,o.templateSettings);var e=0,u="__p+='",i=r.variable;n.replace(RegExp((r.escape||tt).source+"|"+(r.interpolate||tt).source+"|"+(r.evaluate||tt).source+"|$","g"),function(t,r,o,i,a){u+=n.slice(e,a).replace(et,f),u+=r?"'+_['escape']("+r+")+'":i?"';"+i+";__p+='":o?"'+((__t=("+o+"))==null?'':__t)+'":"",e=a+t.length
}),u+="';\n",i||(i="obj",u="with("+i+"||{}){"+u+"}"),u="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+u+"return __p}";try{var a=Function("_","return "+u)(o)}catch(c){throw c.source=u,c}return t?a(t):(a.source=u,a)},o.unescape=function(n){return n==H?"":(n+"").replace(Z,s)},o.uniqueId=function(n){var t=++W+"";return n?n+t:t},o.all=E,o.any=B,o.detect=S,o.foldl=T,o.foldr=q,o.include=x,o.inject=T,o.first=D,o.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==H||r)return n[u-1];return p(n,ht(0,u-e))}},o.take=D,o.head=D,o.chain=function(n){return n=new o(n),n.__chain__=G,n},o.VERSION="1.0.0-rc.3",V(o),o.prototype.chain=function(){return this.__chain__=G,this},o.prototype.value=function(){return this.__wrapped__},u("pop push reverse shift sort splice unshift".split(" "),function(n){var t=Q[n];o.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Ot&&0===n.length&&delete n[0],this
}}),u(["concat","join","slice"],function(n){var t=Q[n];o.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=G),n}}),K?typeof module=="object"&&module&&module.exports==K?(module.exports=o)._=o:K._=o:n._=o})(this);

View File

@@ -140,6 +140,7 @@
'memoize',
'once',
'partial',
'partialRight',
'throttle',
'wrap'
];
@@ -257,7 +258,8 @@
'forOwn',
'isPlainObject',
'merge',
'partial'
'partial',
'partialRight'
]));
/*--------------------------------------------------------------------------*/
@@ -413,7 +415,7 @@
func({ 'noop': noop });
} else if (methodName == 'bindKey') {
func(lodash, 'identity', array, string);
} else if (/^(?:bind|partial)$/.test(methodName)) {
} else if (/^(?:bind|partial(?:Right)?)$/.test(methodName)) {
func(noop, object, array, string);
} else if (/^(?:compose|memoize|wrap)$/.test(methodName)) {
func(noop, noop);
@@ -794,7 +796,8 @@
'forOwn',
'isPlainObject',
'merge',
'partial'
'partial',
'partialRight'
], function(methodName) {
equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename);
});

View File

@@ -531,6 +531,20 @@
Foo.prototype = { 'a': 1 };
deepEqual(func({}, new Foo), {});
});
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
var array = Array(3);
array[0] = 1;
array[2] = 3;
var actual = func([], array),
expected = array.slice();
expected[1] = undefined;
ok(1 in actual);
deepEqual(actual, expected);
});
});
/*--------------------------------------------------------------------------*/
@@ -1435,20 +1449,6 @@
strictEqual(actual.a, 1);
});
test('should treat sparse arrays as dense', function() {
var array = Array(3);
array[0] = 1;
array[2] = 3;
var actual = _.merge([], array),
expected = array.slice();
expected[1] = undefined;
ok(1 in actual);
deepEqual(actual, expected);
});
test('should pass the correct `callback` arguments', function() {
var args;
@@ -1537,45 +1537,50 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.partial');
QUnit.module('partial methods');
(function() {
test('partially applies an argument, without additional arguments', function() {
var arg = 'catnip',
func = function(x) { return x; };
_.each(['partial', 'partialRight'], function(methodName) {
var func = _[methodName];
equal(_.partial(func, arg)(), arg);
test('lodash.' + methodName + ' partially applies an argument, without additional arguments', function() {
var arg = 'a',
fn = function(x) { return x; };
equal(func(fn, arg)(), arg);
});
test('partially applies an argument, with additional arguments', function() {
var arg1 = 'catnip',
arg2 = 'cheese',
func = function(x, y) { return [x, y]; };
test('lodash.' + methodName + ' partially applies an argument, with additional arguments', function() {
var arg1 = 'a',
arg2 = 'b',
expected = [arg1, arg2],
fn = function(x, y) { return [x, y]; };
deepEqual(_.partial(func, arg1)(arg2), [arg1, arg2]);
if (methodName == 'partialRight') {
expected.reverse();
}
deepEqual(func(fn, arg1)(arg2), expected);
});
test('works without partially applying arguments, without additional arguments', function() {
var func = function() { return arguments.length; };
strictEqual(_.partial(func)(), 0);
test('lodash.' + methodName + ' works without partially applying arguments, without additional arguments', function() {
var fn = function() { return arguments.length; };
strictEqual(func(fn)(), 0);
});
test('works without partially applying arguments, with additional arguments', function() {
var arg = 'catnip',
func = function(x) { return x; };
test('lodash.' + methodName + ' works without partially applying arguments, with additional arguments', function() {
var arg = 'a',
fn = function(x) { return x; };
equal(_.partial(func)(arg), arg);
equal(func(fn)(arg), arg);
});
test('should not alter the `this` binding of either function', function() {
var object = { 'cat': 'nip' },
func = function() { return this.cat; };
test('lodash.' + methodName + ' should not alter the `this` binding of either function', function() {
var object = { 'a': 1 },
fn = function() { return this.a; };
equal(_.partial(_.bind(func, object))(), object.cat);
equal(_.bind(_.partial(func), object)(), object.cat);
strictEqual(func(_.bind(fn, object))(), object.a);
strictEqual(_.bind(func(fn), object)(), object.a);
});
}());
});
/*--------------------------------------------------------------------------*/