diff --git a/README.md b/README.md index 1d27926035..2eeb10eec9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v3.0.1 +# lodash v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) with packages for [Bower](http://bower.io/), [Component](http://component.github.io/), & [Volo](http://volojs.org/). @@ -12,8 +12,8 @@ $ lodash modern -o ./lodash.js lodash is also available in a variety of other builds & module formats. * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds - * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.0.1-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.0.1-amd) builds - * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.0.1-es) build + * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.1.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.1.0-amd) builds + * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.1.0-es) build ## Further Reading diff --git a/bower.json b/bower.json index 511afe435a..d9a3cdacd3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "3.0.1", + "version": "3.1.0", "main": "lodash.js", "ignore": [ ".*", diff --git a/component.json b/component.json index 79f3606746..63fa714de0 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "lodash", "repo": "lodash/lodash", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash.", "license": "MIT", "main": "lodash.js", diff --git a/doc/README.md b/doc/README.md index c13ab2a51a..f69e72e0a2 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v3.0.1 +# lodash v3.1.0 @@ -22,13 +22,13 @@ * `_.initial` * `_.intersection` * `_.last` -* `_.lastIndexOf` +* `_.lastIndexOf` * `_.object` -> `zipObject` * `_.pull` * `_.pullAt` * `_.remove` * `_.rest` -* `_.slice` +* `_.slice` * `_.sortedIndex` * `_.sortedLastIndex` * `_.tail` -> `rest` @@ -120,16 +120,16 @@ ## `Function` * `_.after` -* `_.ary` +* `_.ary` * `_.backflow` -> `flowRight` * `_.before` * `_.bind` * `_.bindAll` * `_.bindKey` * `_.compose` -> `flowRight` -* `_.curry` -* `_.curryRight` -* `_.debounce` +* `_.curry` +* `_.curryRight` +* `_.debounce` * `_.defer` * `_.delay` * `_.flow` @@ -140,7 +140,7 @@ * `_.partial` * `_.partialRight` * `_.rearg` -* `_.throttle` +* `_.throttle` * `_.wrap` @@ -230,8 +230,9 @@ * `_.parseInt` * `_.repeat` * `_.snakeCase` +* `_.startCase` * `_.startsWith` -* `_.template` +* `_.template` * `_.trim` * `_.trimLeft` * `_.trimRight` @@ -250,7 +251,7 @@ * `_.identity` * `_.iteratee` -> `callback` * `_.matches` -* `_.mixin` +* `_.mixin` * `_.noConflict` * `_.noop` * `_.property` @@ -305,7 +306,7 @@ ### `_.chunk(array, [size=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4103 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4103 "View in source") [Ⓣ][1] Creates an array of elements split into groups the length of `size`. If `collection` can't be split evenly, the final chunk will be the remaining @@ -333,7 +334,7 @@ _.chunk(['a', 'b', 'c', 'd'], 3); ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4134 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4134 "View in source") [Ⓣ][1] Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. @@ -356,7 +357,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4169 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4169 "View in source") [Ⓣ][1] Creates an array excluding all values of the provided arrays using `SameValueZero` for equality comparisons. @@ -386,7 +387,7 @@ _.difference([1, 2, 3], [5, 2, 10]); ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4207 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4207 "View in source") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the beginning. @@ -418,7 +419,7 @@ _.drop([1, 2, 3], 0); ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4243 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4243 "View in source") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the end. @@ -450,7 +451,7 @@ _.dropRight([1, 2, 3], 0); ### `_.dropRightWhile(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4295 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4295 "View in source") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is @@ -499,7 +500,7 @@ _.pluck(_.dropRightWhile(users, { 'status': 'away' }), 'user'); ### `_.dropWhile(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4345 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4345 "View in source") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is @@ -548,7 +549,7 @@ _.pluck(_.dropWhile(users, { 'status': 'busy' }), 'user'); ### `_.findIndex(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4395 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4395 "View in source") [Ⓣ][1] This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for, instead of the element itself. @@ -596,7 +597,7 @@ _.findIndex(users, 'active'); ### `_.findLastIndex(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4447 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4447 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @@ -644,7 +645,7 @@ _.findLastIndex(users, 'active'); ### `_.first(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4475 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4475 "View in source") [Ⓣ][1] Gets the first element of `array`. @@ -669,7 +670,7 @@ _.first([]); ### `_.flatten(array, [isDeep])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4499 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4499 "View in source") [Ⓣ][1] Flattens a nested array. If `isDeep` is `true` the array is recursively flattened, otherwise it is only flattened a single level. @@ -697,7 +698,7 @@ _.flatten([1, [2], [3, [[4]]]], true); ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4520 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4520 "View in source") [Ⓣ][1] Recursively flattens a nested array. @@ -719,7 +720,7 @@ _.flattenDeep([1, [2], [3, [[4]]]]); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4557 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4557 "View in source") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found in `array` using `SameValueZero` for equality comparisons. If `fromIndex` is negative, @@ -760,7 +761,7 @@ _.indexOf([4, 4, 5, 5, 6, 6], 5, true); ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4586 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4586 "View in source") [Ⓣ][1] Gets all but the last element of `array`. @@ -782,7 +783,7 @@ _.initial([1, 2, 3]); ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4609 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4609 "View in source") [Ⓣ][1] Creates an array of unique values in all provided arrays using `SameValueZero` for equality comparisons. @@ -811,7 +812,7 @@ _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4664 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4664 "View in source") [Ⓣ][1] Gets the last element of `array`. @@ -832,8 +833,8 @@ _.last([1, 2, 3]); -### `_.lastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4694 "View in source") [Ⓣ][1] +### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4694 "View in source") [Ⓣ][1] This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. @@ -866,7 +867,7 @@ _.lastIndexOf([4, 4, 5, 5, 6, 6], 5, true); ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4741 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4741 "View in source") [Ⓣ][1] Removes all provided values from `array` using `SameValueZero` for equality comparisons. @@ -901,7 +902,7 @@ console.log(array); ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4786 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4786 "View in source") [Ⓣ][1] Removes elements from `array` corresponding to the given indexes and returns an array of the removed elements. Indexes may be specified as an array of @@ -935,7 +936,7 @@ console.log(evens); ### `_.remove(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4824 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4824 "View in source") [Ⓣ][1] Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is bound to @@ -979,7 +980,7 @@ console.log(evens); ### `_.rest(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4855 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4855 "View in source") [Ⓣ][1] Gets all but the first element of `array`. @@ -1000,8 +1001,8 @@ _.rest([1, 2, 3]); -### `_.slice(array, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4873 "View in source") [Ⓣ][1] +### `_.slice(array, [start=0], [end=array.length])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4873 "View in source") [Ⓣ][1] Creates a slice of `array` from `start` up to, but not including, `end`.
@@ -1024,7 +1025,7 @@ lists in IE < 9 and to ensure dense arrays are returned. ### `_.sortedIndex(array, value, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4930 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4930 "View in source") [Ⓣ][1] Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. If an iteratee @@ -1078,7 +1079,7 @@ _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); ### `_.sortedLastIndex(array, value, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4958 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4958 "View in source") [Ⓣ][1] This method is like `_.sortedIndex` except that it returns the highest index at which `value` should be inserted into `array` in order to @@ -1106,7 +1107,7 @@ _.sortedLastIndex([4, 4, 5, 5, 6, 6], 5); ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L4990 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L4990 "View in source") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the beginning. @@ -1138,7 +1139,7 @@ _.take([1, 2, 3], 0); ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5026 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5026 "View in source") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the end. @@ -1170,7 +1171,7 @@ _.takeRight([1, 2, 3], 0); ### `_.takeRightWhile(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5078 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5078 "View in source") [Ⓣ][1] Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is bound to `thisArg` @@ -1219,7 +1220,7 @@ _.pluck(_.takeRightWhile(users, { 'status': 'away' }), 'user'); ### `_.takeWhile(array, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5128 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5128 "View in source") [Ⓣ][1] Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is bound to @@ -1268,7 +1269,7 @@ _.pluck(_.takeWhile(users, { 'status': 'busy' }), 'user'); ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5158 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5158 "View in source") [Ⓣ][1] Creates an array of unique values, in order, of the provided arrays using `SameValueZero` for equality comparisons. @@ -1297,7 +1298,7 @@ _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.uniq(array, [isSorted], [iteratee], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5210 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5210 "View in source") [Ⓣ][1] Creates a duplicate-value-free version of an array using `SameValueZero` for equality comparisons. Providing `true` for `isSorted` performs a faster @@ -1354,7 +1355,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5248 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5248 "View in source") [Ⓣ][1] This method is like `_.zip` except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-`_.zip` @@ -1381,7 +1382,7 @@ _.unzip(zipped); ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5279 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5279 "View in source") [Ⓣ][1] Creates an array excluding all provided values using `SameValueZero` for equality comparisons. @@ -1411,7 +1412,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5301 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5301 "View in source") [Ⓣ][1] Creates an array that is the symmetric difference of the provided arrays. See [Wikipedia](https://en.wikipedia.org/wiki/Symmetric_difference) for @@ -1438,7 +1439,7 @@ _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5331 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5331 "View in source") [Ⓣ][1] Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements @@ -1462,7 +1463,7 @@ _.zip(['fred', 'barney'], [30, 40], [true, false]); ### `_.zipObject(props, [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5358 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5358 "View in source") [Ⓣ][1] Creates an object composed from arrays of property names and values. Provide either a single two dimensional array, e.g. `[[key1, value1], [key2, value2]]` @@ -1493,7 +1494,7 @@ _.zipObject(['fred', 'barney'], [30, 40]); ### `._(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L919 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L919 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps `value` to enable intuitive chaining. Methods that operate on and return arrays, collections, and functions can @@ -1548,14 +1549,14 @@ The wrapper functions that are **not** chainable by default are:
`findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, -`isFunction`, `isMatch` , `isNative`, `isNaN`, `isNull`, `isNumber`, +`isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, -`startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, -`unescape`, `uniqueId`, `value`, and `words` +`startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, +`trunc`, `unescape`, `uniqueId`, `value`, and `words`

The wrapper function `sample` will return a wrapped value when `n` is provided, @@ -1591,7 +1592,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5403 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5403 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps `value` with explicit method chaining enabled. @@ -1624,7 +1625,7 @@ var youngest = _.chain(users) ### `_.tap(value, interceptor, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5430 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5430 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is bound to `thisArg` and invoked with one argument; (value). The purpose of @@ -1654,7 +1655,7 @@ _([1, 2, 3]) ### `_.thru(value, interceptor, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5453 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5453 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. @@ -1681,7 +1682,7 @@ _([1, 2, 3]) ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5482 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5482 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -1713,7 +1714,7 @@ _(users).chain() ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5506 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5506 "View in source") [Ⓣ][1] Reverses the wrapped array so the first element becomes the last, the second element becomes the second to last, and so on. @@ -1741,7 +1742,7 @@ console.log(array); ### `_.prototype.toString()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5531 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5531 "View in source") [Ⓣ][1] Produces the result of coercing the unwrapped value to a string. @@ -1760,7 +1761,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5548 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5548 "View in source") [Ⓣ][1] Executes the chained sequence to extract the unwrapped value. @@ -1785,7 +1786,7 @@ _([1, 2, 3]).value(); ### `_.at(collection, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5574 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5574 "View in source") [Ⓣ][1] Creates an array of elements corresponding to the given keys, or indexes, of `collection`. Keys may be specified as individual arguments or as arrays @@ -1813,7 +1814,7 @@ _.at(['fred', 'barney', 'pebbles'], 0, 2); ### `_.countBy(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5667 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5667 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -1856,7 +1857,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5712 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5712 "View in source") [Ⓣ][1] Checks if `predicate` returns truthy for **all** elements of `collection`. The predicate is bound to `thisArg` and invoked with three arguments; @@ -1905,7 +1906,7 @@ _.every(users, { 'age': 36 }); ### `_.filter(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5760 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5760 "View in source") [Ⓣ][1] Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is bound to `thisArg` and @@ -1953,7 +1954,7 @@ _.pluck(_.filter(users, { 'age': 36 }), 'user'); ### `_.find(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5807 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5807 "View in source") [Ⓣ][1] Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is bound to `thisArg` and @@ -2002,7 +2003,7 @@ _.result(_.find(users, 'active'), 'user'); ### `_.findLast(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5834 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5834 "View in source") [Ⓣ][1] This method is like `_.find` except that it iterates over elements of `collection` from right to left. @@ -2027,7 +2028,7 @@ _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); ### `_.findWhere(collection, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5863 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5863 "View in source") [Ⓣ][1] Performs a deep comparison between each element in `collection` and the source object, returning the first element that has equivalent property @@ -2060,7 +2061,7 @@ _.result(_.findWhere(users, { 'age': 40 }), 'user'); ### `_.forEach(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5893 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5893 "View in source") [Ⓣ][1] Iterates over elements of `collection` invoking `iteratee` for each element. The `iteratee` is bound to `thisArg` and invoked with three arguments; @@ -2095,7 +2096,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(n, key) { console.log(n, ### `_.forEachRight(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5916 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5916 "View in source") [Ⓣ][1] This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. @@ -2120,7 +2121,7 @@ _([1, 2, 3]).forEachRight(function(n) { console.log(n); }).join(','); ### `_.groupBy(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5957 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5957 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2164,7 +2165,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.includes(collection, target, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L5614 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L5614 "View in source") [Ⓣ][1] Checks if `value` is in `collection` using `SameValueZero` for equality comparisons. If `fromIndex` is negative, it is used as the offset from @@ -2205,7 +2206,7 @@ _.includes('pebbles', 'eb'); ### `_.indexBy(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6004 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6004 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2253,7 +2254,7 @@ _.indexBy(keyData, function(object) { return this.fromCharCode(object.code); }, ### `_.invoke(collection, methodName, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6030 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6030 "View in source") [Ⓣ][1] Invokes the method named by `methodName` on each element in `collection`, returning an array of the results of each invoked method. Any additional @@ -2283,7 +2284,7 @@ _.invoke([123, 456], String.prototype.split, ''); ### `_.map(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6073 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6073 "View in source") [Ⓣ][1] Creates an array of values by running each element in `collection` through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three @@ -2330,7 +2331,7 @@ _.map(users, 'user'); ### `_.max(collection, [iteratee], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6122 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6122 "View in source") [Ⓣ][1] Gets the maximum value of `collection`. If `collection` is empty or falsey `-Infinity` is returned. If an iteratee function is provided it is invoked @@ -2382,7 +2383,7 @@ _.max(users, 'age'); ### `_.min(collection, [iteratee], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6167 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6167 "View in source") [Ⓣ][1] Gets the minimum value of `collection`. If `collection` is empty or falsey `Infinity` is returned. If an iteratee function is provided it is invoked @@ -2434,7 +2435,7 @@ _.min(users, 'age'); ### `_.partition(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6213 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6213 "View in source") [Ⓣ][1] Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, while the second of which @@ -2487,7 +2488,7 @@ _.map(_.partition(users, 'active'), function(array) { return _.pluck(array, 'use ### `_.pluck(collection, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6240 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6240 "View in source") [Ⓣ][1] Gets the value of `key` from all elements in `collection`. @@ -2519,7 +2520,7 @@ _.pluck(userIndex, 'age'); ### `_.reduce(collection, [iteratee=_.identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6272 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6272 "View in source") [Ⓣ][1] Reduces `collection` to a value which is the accumulated result of running each element in `collection` through `iteratee`, where each successive @@ -2555,7 +2556,7 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6296 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6296 "View in source") [Ⓣ][1] This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. @@ -2582,7 +2583,7 @@ _.reduceRight(array, function(flattened, other) { return flattened.concat(other) ### `_.reject(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6339 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6339 "View in source") [Ⓣ][1] The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. @@ -2629,7 +2630,7 @@ _.pluck(_.reject(users, { 'age': 36 }), 'user'); ### `_.sample(collection, [n])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6365 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6365 "View in source") [Ⓣ][1] Gets a random element or `n` random elements from a collection. @@ -2655,7 +2656,7 @@ _.sample([1, 2, 3, 4], 2); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6391 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6391 "View in source") [Ⓣ][1] Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. See [Wikipedia](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle) @@ -2679,7 +2680,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6428 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6428 "View in source") [Ⓣ][1] Gets the size of `collection` by returning `collection.length` for array-like values or the number of own enumerable properties for objects. @@ -2708,7 +2709,7 @@ _.size('pebbles'); ### `_.some(collection, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6475 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6475 "View in source") [Ⓣ][1] Checks if `predicate` returns truthy for **any** element of `collection`. The function returns as soon as it finds a passing value and does not iterate @@ -2758,7 +2759,7 @@ _.some(users, { 'age': 1 }); ### `_.sortBy(collection, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6524 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6524 "View in source") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in a collection through `iteratee`. This method performs @@ -2808,7 +2809,7 @@ _.pluck(_.sortBy(users, 'user'), 'user'); ### `_.sortByAll(collection, props)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6562 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6562 "View in source") [Ⓣ][1] This method is like `_.sortBy` except that it sorts by property names instead of an iteratee function. @@ -2839,7 +2840,7 @@ _.map(_.sortByAll(users, ['user', 'age']), _.values); ### `_.where(collection, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6611 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6611 "View in source") [Ⓣ][1] Performs a deep comparison between each element in `collection` and the source object, returning an array of all elements that have equivalent @@ -2881,7 +2882,7 @@ _.pluck(_.where(users, { 'status': 'busy' }), 'user'); ### `_.now` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6629 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6629 "View in source") [Ⓣ][1] Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). @@ -2904,7 +2905,7 @@ _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6658 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6658 "View in source") [Ⓣ][1] The opposite of `_.before`; this method creates a function that invokes `func` once it is called `n` or more times. @@ -2935,8 +2936,8 @@ _.forEach(saves, function(type) { -### `_.ary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6692 "View in source") [Ⓣ][1] +### `_.ary(func, [n=func.length])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6692 "View in source") [Ⓣ][1] Creates a function that accepts up to `n` arguments ignoring any additional arguments. @@ -2960,7 +2961,7 @@ _.map(['6', '8', '10'], _.ary(parseInt, 1)); ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6716 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6716 "View in source") [Ⓣ][1] Creates a function that invokes `func`, with the `this` binding and arguments of the created function, while it is called less than `n` times. Subsequent @@ -2985,7 +2986,7 @@ jQuery('#add').on('click', _.before(5, addContactToList)); ### `_.bind(func, thisArg, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6772 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6772 "View in source") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of `thisArg` and prepends any additional `_.bind` arguments to those provided to the @@ -3031,7 +3032,7 @@ bound('hi'); ### `_.bindAll(object, [methodNames])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6809 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6809 "View in source") [Ⓣ][1] Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays @@ -3066,7 +3067,7 @@ jQuery('#docs').on('click', view.onClick); ### `_.bindKey(object, key, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6861 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6861 "View in source") [Ⓣ][1] Creates a function that invokes the method at `object[key]` and prepends any additional `_.bindKey` arguments to those provided to the bound function. @@ -3120,8 +3121,8 @@ bound('hi'); -### `_.curry(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6912 "View in source") [Ⓣ][1] +### `_.curry(func, [arity=func.length])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6912 "View in source") [Ⓣ][1] Creates a function that accepts one or more arguments of `func` that when called either invokes `func` returning its result, if all `func` arguments @@ -3170,8 +3171,8 @@ curried(1)(_, 3)(2); -### `_.curryRight(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L6958 "View in source") [Ⓣ][1] +### `_.curryRight(func, [arity=func.length])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L6958 "View in source") [Ⓣ][1] This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`. @@ -3217,8 +3218,8 @@ curried(3)(1, _)(2); -### `_.debounce(func, wait, [options], [options.leading=false], [options.maxWait], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7029 "View in source") [Ⓣ][1] +### `_.debounce(func, wait, [options])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7029 "View in source") [Ⓣ][1] Creates a function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time it was invoked. The created function comes @@ -3288,7 +3289,7 @@ delete models.todo; ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7158 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7158 "View in source") [Ⓣ][1] Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it is invoked. @@ -3312,7 +3313,7 @@ _.defer(function(text) { console.log(text); }, 'deferred'); ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7178 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7178 "View in source") [Ⓣ][1] Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it is invoked. @@ -3337,7 +3338,7 @@ _.delay(function(text) { console.log(text); }, 1000, 'later'); ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7206 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7206 "View in source") [Ⓣ][1] Creates a function that returns the result of invoking the provided functions with the `this` binding of the created function, where each @@ -3370,7 +3371,7 @@ addSquare(1, 2); ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7251 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7251 "View in source") [Ⓣ][1] This method is like `_.flow` except that it creates a function that invokes the provided functions from right to left. @@ -3402,7 +3403,7 @@ addSquare(1, 2); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7325 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7325 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided it determines the cache key for storing the result based on the @@ -3465,7 +3466,7 @@ identity(other); ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7363 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7363 "View in source") [Ⓣ][1] Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the @@ -3493,7 +3494,7 @@ _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7390 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7390 "View in source") [Ⓣ][1] Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first call. The `func` is invoked @@ -3519,7 +3520,7 @@ initialize(); ### `_.partial(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7426 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7426 "View in source") [Ⓣ][1] Creates a function that invokes `func` with `partial` arguments prepended to those provided to the new function. This method is like `_.bind` except @@ -3562,7 +3563,7 @@ greetFred('hi'); ### `_.partialRight(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7464 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7464 "View in source") [Ⓣ][1] This method is like `_.partial` except that partially applied arguments are appended to those provided to the new function. @@ -3604,7 +3605,7 @@ sayHelloTo('fred'); ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7497 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7497 "View in source") [Ⓣ][1] Creates a function that invokes `func` with arguments arranged according to the specified indexes where the argument value at the first index is @@ -3637,8 +3638,8 @@ map(function(n) { return n * 3; }, [1, 2, 3]); -### `_.throttle(func, wait, [options], [options.leading=true], [options.trailing=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7540 "View in source") [Ⓣ][1] +### `_.throttle(func, wait, [options])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7540 "View in source") [Ⓣ][1] Creates a function that only invokes `func` at most once per every `wait` milliseconds. The created function comes with a `cancel` method to cancel @@ -3685,7 +3686,7 @@ jQuery(window).on('popstate', throttled.cancel); ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7580 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7580 "View in source") [Ⓣ][1] Creates a function that provides `value` to the wrapper function as its first argument. Any additional arguments provided to the function are @@ -3721,7 +3722,7 @@ p('fred, barney, & pebbles'); ### `_.clone(value, [isDeep], [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7636 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7636 "View in source") [Ⓣ][1] Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, otherwise they are assigned by reference. If `customizer` is provided it is @@ -3780,7 +3781,7 @@ body.childNodes.length; ### `_.cloneDeep(value, [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7690 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7690 "View in source") [Ⓣ][1] Creates a deep clone of `value`. If `customizer` is provided it is invoked to produce the cloned values. If `customizer` returns `undefined` cloning @@ -3833,7 +3834,7 @@ body.childNodes.length; ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7711 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7711 "View in source") [Ⓣ][1] Checks if `value` is classified as an `arguments` object. @@ -3858,7 +3859,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7740 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7740 "View in source") [Ⓣ][1] Checks if `value` is classified as an `Array` object. @@ -3883,7 +3884,7 @@ _.isArray([1, 2, 3]); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7760 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7760 "View in source") [Ⓣ][1] Checks if `value` is classified as a boolean primitive or object. @@ -3908,7 +3909,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7780 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7780 "View in source") [Ⓣ][1] Checks if `value` is classified as a `Date` object. @@ -3933,7 +3934,7 @@ _.isDate('Mon April 23 2012'); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7800 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7800 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -3958,7 +3959,7 @@ _.isElement(''); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7838 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7838 "View in source") [Ⓣ][1] Checks if a value is empty. A value is considered empty unless it is an `arguments` object, array, string, or jQuery-like collection with a length @@ -3994,7 +3995,7 @@ _.isEmpty({ 'a': 1 }); ### `_.isEqual(value, other, [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7890 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7890 "View in source") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent. If `customizer` is provided it is invoked to compare values. @@ -4044,7 +4045,7 @@ _.isEqual(array, other, function(value, other) { ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7916 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7916 "View in source") [Ⓣ][1] Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. @@ -4070,7 +4071,7 @@ _.isError(Error); ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7949 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7949 "View in source") [Ⓣ][1] Checks if `value` is a finite primitive number.
@@ -4109,7 +4110,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L7969 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L7969 "View in source") [Ⓣ][1] Checks if `value` is classified as a `Function` object. @@ -4134,7 +4135,7 @@ _.isFunction(/abc/); ### `_.isMatch(source, source, [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8052 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8052 "View in source") [Ⓣ][1] Performs a deep comparison between `object` and `source` to determine if `object` contains equivalent property values. If `customizer` is provided @@ -4183,7 +4184,7 @@ _.isMatch(object, source, function(value, other) { ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8101 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8101 "View in source") [Ⓣ][1] Checks if `value` is `NaN`.
@@ -4219,7 +4220,7 @@ _.isNaN(undefined); ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8123 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8123 "View in source") [Ⓣ][1] Checks if `value` is a native function. @@ -4244,7 +4245,7 @@ _.isNative(_); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8150 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8150 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -4269,7 +4270,7 @@ _.isNull(void 0); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8176 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8176 "View in source") [Ⓣ][1] Checks if `value` is classified as a `Number` primitive or object.
@@ -4301,7 +4302,7 @@ _.isNumber('8.4'); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8006 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8006 "View in source") [Ⓣ][1] Checks if `value` is the language type of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) @@ -4333,7 +4334,7 @@ _.isObject(1); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8210 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8210 "View in source") [Ⓣ][1] Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -4373,7 +4374,7 @@ _.isPlainObject(Object.create(null)); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8238 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8238 "View in source") [Ⓣ][1] Checks if `value` is classified as a `RegExp` object. @@ -4398,7 +4399,7 @@ _.isRegExp('/abc/'); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8258 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8258 "View in source") [Ⓣ][1] Checks if `value` is classified as a `String` primitive or object. @@ -4423,7 +4424,7 @@ _.isString(1); ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8278 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8278 "View in source") [Ⓣ][1] Checks if `value` is classified as a typed array. @@ -4448,7 +4449,7 @@ _.isTypedArray([]); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8298 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8298 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -4473,7 +4474,7 @@ _.isUndefined(null); ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8315 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8315 "View in source") [Ⓣ][1] Converts `value` to an array. @@ -4495,7 +4496,7 @@ Converts `value` to an array. ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8351 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8351 "View in source") [Ⓣ][1] Converts `value` to a plain object flattening inherited enumerable properties of `value` to own properties of the plain object. @@ -4533,7 +4534,7 @@ _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); ### `_.random([min=0], [max=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9238 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9238 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` (inclusive). If only one argument is provided a number between `0` and the given number is returned. @@ -4575,7 +4576,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources], [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8386 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8386 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources overwrite property assignments of previous sources. @@ -4612,7 +4613,7 @@ defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8420 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8420 "View in source") [Ⓣ][1] Creates an object that inherits from the given `prototype` object. If a `properties` object is provided its own enumerable properties are assigned @@ -4652,7 +4653,7 @@ circle instanceof Shape; ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8444 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8444 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a @@ -4677,7 +4678,7 @@ _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.findKey(object, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8492 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8492 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it returns the key of the first element `predicate` returns truthy for, instead of the element itself. @@ -4725,7 +4726,7 @@ _.findKey(users, 'active'); ### `_.findLastKey(object, [predicate=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8536 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8536 "View in source") [Ⓣ][1] This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. @@ -4773,7 +4774,7 @@ _.findLastKey(users, 'active'); ### `_.forIn(object, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8568 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8568 "View in source") [Ⓣ][1] Iterates over own and inherited enumerable properties of an object invoking `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked @@ -4809,7 +4810,7 @@ _.forIn(new Foo, function(value, key) { ### `_.forInRight(object, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8600 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8600 "View in source") [Ⓣ][1] This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. @@ -4843,7 +4844,7 @@ _.forInRight(new Foo, function(value, key) { ### `_.forOwn(object, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8625 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8625 "View in source") [Ⓣ][1] Iterates over own enumerable properties of an object invoking `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked with @@ -4872,7 +4873,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { ### `_.forOwnRight(object, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8650 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8650 "View in source") [Ⓣ][1] This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. @@ -4899,7 +4900,7 @@ _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8670 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8670 "View in source") [Ⓣ][1] Creates an array of function property names from all enumerable properties, own and inherited, of `object`. @@ -4922,7 +4923,7 @@ _.functions(_); ### `_.has(object, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8689 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8689 "View in source") [Ⓣ][1] Checks if `key` exists as a direct property of `object` instead of an inherited property. @@ -4946,7 +4947,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); ### `_.invert(object, [multiValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8718 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8718 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite property @@ -4979,7 +4980,7 @@ _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }, true); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8772 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8772 "View in source") [Ⓣ][1] Creates an array of the own enumerable property names of `object`.
@@ -5016,7 +5017,7 @@ _.keys('hi'); ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8806 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8806 "View in source") [Ⓣ][1] Creates an array of the own and inherited enumerable property names of `object`.
@@ -5048,7 +5049,7 @@ _.keysIn(new Foo); ### `_.mapValues(object, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8900 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8900 "View in source") [Ⓣ][1] Creates an object with the same keys as `object` and values generated by running each own enumerable property of `object` through `iteratee`. The @@ -5093,7 +5094,7 @@ _.mapValues(users, 'age'); ### `_.merge(object, [sources], [customizer], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8956 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8956 "View in source") [Ⓣ][1] Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined` into the destination object. Subsequent sources @@ -5148,7 +5149,7 @@ _.merge(object, other, function(a, b) { ### `_.omit(object, [predicate], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L8986 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L8986 "View in source") [Ⓣ][1] The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable properties of `object` that are not omitted. @@ -5183,7 +5184,7 @@ _.omit(object, _.isNumber); ### `_.pairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9014 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9014 "View in source") [Ⓣ][1] Creates a two dimensional array of the key-value pairs for `object`, e.g. `[[key1, value1], [key2, value2]]`. @@ -5206,7 +5207,7 @@ _.pairs({ 'barney': 36, 'fred': 40 }); ### `_.pick(object, [predicate], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9053 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9053 "View in source") [Ⓣ][1] Creates an object composed of the picked `object` properties. Property names may be specified as individual arguments or as arrays of property @@ -5239,7 +5240,7 @@ _.pick(object, _.isString); ### `_.result(object, key, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9092 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9092 "View in source") [Ⓣ][1] Resolves the value of property `key` on `object`. If the value of `key` is a function it is invoked with the `this` binding of `object` and its result @@ -5277,7 +5278,7 @@ _.result(object, 'status', _.constant('busy')); ### `_.transform(object, [iteratee=_.identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9131 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9131 "View in source") [Ⓣ][1] An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable @@ -5317,7 +5318,7 @@ var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9178 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9178 "View in source") [Ⓣ][1] Creates an array of the own enumerable property values of `object`.
@@ -5352,7 +5353,7 @@ _.values('hi'); ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9205 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9205 "View in source") [Ⓣ][1] Creates an array of the own and inherited enumerable property values of `object`. @@ -5391,7 +5392,7 @@ _.valuesIn(new Foo); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9295 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9295 "View in source") [Ⓣ][1] Converts `string` to camel case. See [Wikipedia](https://en.wikipedia.org/wiki/CamelCase) for more details. @@ -5420,7 +5421,7 @@ _.camelCase('__foo_bar__'); ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9313 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9313 "View in source") [Ⓣ][1] Capitalizes the first character of `string`. @@ -5442,7 +5443,7 @@ _.capitalize('fred'); ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9333 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9333 "View in source") [Ⓣ][1] Deburrs `string` by converting latin-1 supplementary letters to basic latin letters. See [Wikipedia](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) @@ -5466,7 +5467,7 @@ _.deburr('déjà vu'); ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9359 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9359 "View in source") [Ⓣ][1] Checks if `string` ends with the given target string. @@ -5496,7 +5497,7 @@ _.endsWith('abc', 'b', 2); ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9400 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9400 "View in source") [Ⓣ][1] Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to their corresponding HTML entities. @@ -5541,7 +5542,7 @@ _.escape('fred, barney, & pebbles'); ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9422 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9422 "View in source") [Ⓣ][1] Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. @@ -5564,7 +5565,7 @@ _.escapeRegExp('[lodash](https://lodash.com/)'); ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9450 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9450 "View in source") [Ⓣ][1] Converts `string` to kebab case (a.k.a. spinal case). See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) for @@ -5594,7 +5595,7 @@ _.kebabCase('__foo_bar__'); ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9477 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9477 "View in source") [Ⓣ][1] Pads `string` on the left and right sides if it is shorter then the given padding length. The `chars` string may be truncated if the number of padding @@ -5626,7 +5627,7 @@ _.pad('abc', 3); ### `_.padLeft([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9516 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9516 "View in source") [Ⓣ][1] Pads `string` on the left side if it is shorter then the given padding length. The `chars` string may be truncated if the number of padding @@ -5658,7 +5659,7 @@ _.padLeft('abc', 3); ### `_.padRight([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9544 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9544 "View in source") [Ⓣ][1] Pads `string` on the right side if it is shorter then the given padding length. The `chars` string may be truncated if the number of padding @@ -5690,7 +5691,7 @@ _.padRight('abc', 3); ### `_.parseInt(string, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9572 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9572 "View in source") [Ⓣ][1] Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, @@ -5722,7 +5723,7 @@ _.map(['6', '08', '10'], _.parseInt); ### `_.repeat([string=''], [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9614 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9614 "View in source") [Ⓣ][1] Repeats the given string `n` times. @@ -5751,7 +5752,7 @@ _.repeat('abc', 0); ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9654 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9654 "View in source") [Ⓣ][1] Converts `string` to snake case. See [Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details. @@ -5767,10 +5768,10 @@ See [Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details. _.snakeCase('Foo Bar'); // => 'foo_bar' -_.snakeCase('--foo-bar'); +_.snakeCase('fooBar'); // => 'foo_bar' -_.snakeCase('fooBar'); +_.snakeCase('--foo-bar'); // => 'foo_bar' ``` * * * @@ -5779,8 +5780,38 @@ _.snakeCase('fooBar'); +### `_.startCase([string=''])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9679 "View in source") [Ⓣ][1] + +Converts `string` to start case. +See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage) +for more details. + +#### Arguments +1. `[string='']` *(string)*: The string to convert. + +#### Returns +*(string)*: Returns the start cased string. + +#### Example +```js +_.startCase('--foo-bar'); +// => 'Foo Bar' + +_.startCase('fooBar'); +// => 'Foo Bar' + +_.startCase('__foo_bar__'); +// => 'Foo Bar' +``` +* * * + + + + + ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9679 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9704 "View in source") [Ⓣ][1] Checks if `string` starts with the given target string. @@ -5809,8 +5840,8 @@ _.startsWith('abc', 'b', 1); -### `_.template([string=''], [options], [options.escape], [options.evaluate], [options.imports], [options.interpolate], [options.sourceURL], [options.variable])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9781 "View in source") [Ⓣ][1] +### `_.template([string=''], [options])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9806 "View in source") [Ⓣ][1] Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -5917,7 +5948,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9908 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9933 "View in source") [Ⓣ][1] Removes leading and trailing whitespace or specified characters from `string`. @@ -5946,7 +5977,7 @@ _.map([' foo ', ' bar '], _.trim); ### `_.trimLeft([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9939 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9964 "View in source") [Ⓣ][1] Removes leading whitespace or specified characters from `string`. @@ -5972,7 +6003,7 @@ _.trimLeft('-_-abc-_-', '_-'); ### `_.trimRight([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L9969 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L9994 "View in source") [Ⓣ][1] Removes trailing whitespace or specified characters from `string`. @@ -5998,7 +6029,7 @@ _.trimRight('-_-abc-_-', '_-'); ### `_.trunc([string=''], [options], [options.length=30], [options.omission='...'], [options.separator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10013 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10038 "View in source") [Ⓣ][1] Truncates `string` if it is longer than the given maximum string length. The last characters of the truncated string are replaced with the omission @@ -6038,7 +6069,7 @@ _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10083 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10108 "View in source") [Ⓣ][1] The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their @@ -6066,7 +6097,7 @@ _.unescape('fred, barney, & pebbles'); ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10108 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10133 "View in source") [Ⓣ][1] Splits `string` into an array of its words. @@ -6098,7 +6129,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10138 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10163 "View in source") [Ⓣ][1] Attempts to invoke `func`, returning either the result or the caught error object. @@ -6127,7 +6158,7 @@ if (_.isError(elements)) { ### `_.callback([func=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10181 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10206 "View in source") [Ⓣ][1] Creates a function bound to an optional `thisArg`. If `func` is a property name the created callback returns the property value for a given element. @@ -6169,7 +6200,7 @@ _.filter(users, 'age__gt36'); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10203 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10230 "View in source") [Ⓣ][1] Creates a function that returns `value`. @@ -6193,7 +6224,7 @@ getter() === object; ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10223 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10250 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -6216,7 +6247,7 @@ _.identity(object) === object; ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10252 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10279 "View in source") [Ⓣ][1] Creates a function which performs a deep comparison between a given object and `source`, returning `true` if the given object has equivalent property @@ -6249,8 +6280,8 @@ _.find(users, matchesAge); -### `_.mixin([object=this], source, [options], [options.chain=true])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10289 "View in source") [Ⓣ][1] +### `_.mixin([object=this], source, [options])` +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10316 "View in source") [Ⓣ][1] Adds all own enumerable function properties of a source object to the destination object. If `object` is a function then methods are added to @@ -6291,7 +6322,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10352 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10379 "View in source") [Ⓣ][1] Reverts the `_` variable to its previous value and returns a reference to the `lodash` function. @@ -6310,7 +6341,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10369 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10396 "View in source") [Ⓣ][1] A no-operation function. @@ -6327,7 +6358,7 @@ _.noop(object) === undefined; ### `_.property(key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10396 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10423 "View in source") [Ⓣ][1] Creates a function which returns the property value of `key` on a given object. @@ -6359,7 +6390,7 @@ _.pluck(_.sortBy(users, getName), 'user'); ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10419 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10446 "View in source") [Ⓣ][1] The inverse of `_.property`; this method creates a function which returns the property value of a given key on `object`. @@ -6387,7 +6418,7 @@ _.sortBy(['a', 'b', 'c'], _.propertyOf(object)); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10457 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10484 "View in source") [Ⓣ][1] Creates an array of numbers (positive and/or negative) progressing from `start` up to, but not including, `end`. If `start` is less than `end` a @@ -6428,7 +6459,7 @@ _.range(0); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L689 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L689 "View in source") [Ⓣ][1] Create a new pristine `lodash` function using the given `context` object. @@ -6472,7 +6503,7 @@ var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ### `_.times(n, [iteratee=_.identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10506 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10533 "View in source") [Ⓣ][1] Invokes the iteratee function `n` times, returning an array of the results of each invocation. The `iteratee` is bound to `thisArg` and invoked with @@ -6504,7 +6535,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10544 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10571 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID is appended to it. @@ -6535,7 +6566,7 @@ _.uniqueId(); ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1163 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1163 "View in source") [Ⓣ][1] A reference to the `lodash` function. @@ -6552,7 +6583,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L10804 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L10832 "View in source") [Ⓣ][1] (string): The semantic version number. @@ -6563,7 +6594,7 @@ A reference to the `lodash` function. ### `_.support` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L952 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L952 "View in source") [Ⓣ][1] (Object): An object environment feature flags. @@ -6574,7 +6605,7 @@ A reference to the `lodash` function. ### `_.support.argsTag` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L969 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L969 "View in source") [Ⓣ][1] (boolean): Detect if the `toStringTag` of `arguments` objects is resolvable (all but Firefox < 4, IE < 9). @@ -6586,7 +6617,7 @@ A reference to the `lodash` function. ### `_.support.enumErrorProps` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L978 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L978 "View in source") [Ⓣ][1] (boolean): Detect if `name` or `message` properties of `Error.prototype` are enumerable by default (IE < 9, Safari < 5.1). @@ -6598,7 +6629,7 @@ enumerable by default (IE < 9, Safari < 5.1). ### `_.support.enumPrototypes` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L992 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L992 "View in source") [Ⓣ][1] (boolean): Detect if `prototype` properties are enumerable by default.
@@ -6615,7 +6646,7 @@ property to `true`. ### `_.support.funcDecomp` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1002 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1002 "View in source") [Ⓣ][1] (boolean): Detect if functions can be decompiled by `Function#toString` (all but Firefox OS certified apps, older Opera mobile browsers, and @@ -6628,7 +6659,7 @@ the PlayStation 3; forced `false` for Windows 8 apps). ### `_.support.funcNames` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1010 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1010 "View in source") [Ⓣ][1] (boolean): Detect if `Function#name` is supported (all but IE). @@ -6639,7 +6670,7 @@ the PlayStation 3; forced `false` for Windows 8 apps). ### `_.support.nodeTag` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1018 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1018 "View in source") [Ⓣ][1] (boolean): Detect if the `toStringTag` of DOM nodes is resolvable (all but IE < 9). @@ -6650,7 +6681,7 @@ the PlayStation 3; forced `false` for Windows 8 apps). ### `_.support.nonEnumShadows` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1039 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1039 "View in source") [Ⓣ][1] (boolean): Detect if properties shadowing those on `Object.prototype` are non-enumerable. @@ -6666,7 +6697,7 @@ are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). ### `_.support.nonEnumStrings` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1027 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1027 "View in source") [Ⓣ][1] (boolean): Detect if string indexes are non-enumerable (IE < 9, RingoJS, Rhino, Narwhal). @@ -6678,7 +6709,7 @@ are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). ### `_.support.ownLast` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1047 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1047 "View in source") [Ⓣ][1] (boolean): Detect if own properties are iterated after inherited properties (IE < 9). @@ -6689,7 +6720,7 @@ are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). ### `_.support.spliceObjects` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1062 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1062 "View in source") [Ⓣ][1] (boolean): Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. @@ -6708,7 +6739,7 @@ is buggy regardless of mode in IE < 9. ### `_.support.unindexedChars` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1073 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1073 "View in source") [Ⓣ][1] (boolean): Detect lack of support for accessing string characters by index.
@@ -6723,7 +6754,7 @@ by index on string literals, not string objects. ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1115 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1115 "View in source") [Ⓣ][1] (Object): By default, the template delimiters used by lodash are like those in embedded Ruby (ERB). Change the following template settings to use @@ -6736,7 +6767,7 @@ alternative delimiters. ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1123 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1123 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. @@ -6747,7 +6778,7 @@ alternative delimiters. ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1131 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1131 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. @@ -6758,7 +6789,7 @@ alternative delimiters. ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1155 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1155 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. @@ -6769,7 +6800,7 @@ alternative delimiters. ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1139 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1139 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. @@ -6780,7 +6811,7 @@ alternative delimiters. ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/3.0.1/lodash.src.js#L1147 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/3.1.0/lodash.src.js#L1147 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. diff --git a/lodash.js b/lodash.js index 1baaa037b3..11b3e2cd6c 100644 --- a/lodash.js +++ b/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern -o ./lodash.js` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '3.0.1'; + var VERSION = '3.1.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -769,7 +769,7 @@ /** * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * for more details. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; @@ -827,14 +827,14 @@ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, * `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, - * `isFunction`, `isMatch` , `isNative`, `isNaN`, `isNull`, `isNumber`, + * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, * `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, * `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, - * `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, - * `unescape`, `uniqueId`, `value`, and `words` + * `startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, + * `trunc`, `unescape`, `uniqueId`, `value`, and `words` * * The wrapper function `sample` will return a wrapped value when `n` is provided, * otherwise an unwrapped value is returned. @@ -1647,7 +1647,7 @@ } // Handle "_.property" and "_.matches" style callback shorthands. return type == 'object' - ? baseMatches(func, !argCount) + ? baseMatches(func) : baseProperty(func + ''); } @@ -2268,10 +2268,9 @@ * * @private * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. * @returns {Function} Returns the new function. */ - function baseMatches(source, isCloned) { + function baseMatches(source) { var props = keys(source), length = props.length; @@ -2285,9 +2284,6 @@ }; } } - if (isCloned) { - source = baseClone(source, true); - } var values = Array(length), strictCompareFlags = Array(length); @@ -3598,7 +3594,7 @@ var length = object.length, prereq = isLength(length) && isIndex(index, length); } else { - prereq = type == 'string' && index in value; + prereq = type == 'string' && index in object; } return prereq && object[index] === value; } @@ -3606,6 +3602,10 @@ /** * Checks if `value` is a valid array-like length. * + * **Note:** This function is based on ES `ToLength`. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. @@ -5676,7 +5676,7 @@ * // => 'fred' */ function findWhere(collection, source) { - return find(collection, matches(source)); + return find(collection, baseMatches(source)); } /** @@ -6053,7 +6053,7 @@ * // => [36, 40] (iteration order is not guaranteed) */ function pluck(collection, key) { - return map(collection, property(key)); + return map(collection, baseProperty(key + '')); } /** @@ -6424,7 +6424,7 @@ * // => ['barney', 'fred'] */ function where(collection, source) { - return filter(collection, matches(source)); + return filter(collection, baseMatches(source)); } /*------------------------------------------------------------------------*/ @@ -9069,7 +9069,7 @@ */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); - return index ? (result + word.charAt(0).toUpperCase() + word.slice(1)) : word; + return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); }); /** @@ -9420,16 +9420,41 @@ * _.snakeCase('Foo Bar'); * // => 'foo_bar' * - * _.snakeCase('--foo-bar'); + * _.snakeCase('fooBar'); * // => 'foo_bar' * - * _.snakeCase('fooBar'); + * _.snakeCase('--foo-bar'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); + /** + * Converts `string` to start case. + * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage) + * for more details. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__foo_bar__'); + * // => 'Foo Bar' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); + }); + /** * Checks if `string` starts with the given target string. * @@ -9689,7 +9714,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); } - chars = baseToString(chars); + chars = (chars + ''); return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); } @@ -9720,7 +9745,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string)) } - return string.slice(charsLeftIndex(string, baseToString(chars))); + return string.slice(charsLeftIndex(string, (chars + ''))); } /** @@ -9750,7 +9775,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(0, trimmedRightIndex(string) + 1) } - return string.slice(0, charsRightIndex(string, baseToString(chars)) + 1); + return string.slice(0, charsRightIndex(string, (chars + '')) + 1); } /** @@ -9957,7 +9982,9 @@ if (guard && isIterateeCall(func, thisArg, guard)) { thisArg = null; } - return baseCallback(func, thisArg); + return isObjectLike(func) + ? matches(func) + : baseCallback(func, thisArg); } /** @@ -10025,7 +10052,7 @@ * // => { 'user': 'barney', 'age': 36 } */ function matches(source) { - return baseMatches(source, true); + return baseMatches(baseClone(source, true)); } /** @@ -10522,6 +10549,7 @@ lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedLastIndex = sortedLastIndex; + lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.template = template; lodash.trim = trim; @@ -10647,10 +10675,10 @@ // Add `LazyWrapper` methods for `_.pluck` and `_.where`. arrayEach(['pluck', 'where'], function(methodName, index) { var operationName = index ? 'filter' : 'map', - createCallback = index ? matches : property; + createCallback = index ? baseMatches : baseProperty; LazyWrapper.prototype[methodName] = function(value) { - return this[operationName](createCallback(value)); + return this[operationName](createCallback(index ? value : (value + ''))); }; }); diff --git a/lodash.min.js b/lodash.min.js index 63ec153771..b83eca6055 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -1,85 +1,85 @@ /** * @license - * lodash 3.0.1 (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE + * lodash 3.1.0 (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * Build: `lodash modern -o ./lodash.js` */ ;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||typeof n=="undefined"&&e)return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) -}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Yt(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++ui(r,f)&&u.push(f);return u}function or(n,t){var r=n?n.length:0;if(!ue(r))return gr(n,t);for(var e=-1,u=se(n);++et&&(t=-t>u?0:u+t),r=typeof r=="undefined"||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=mu(u);++eu(f,s)&&((r||a)&&f.push(s),l.push(c))}return l}function Or(n,t){for(var r=-1,e=t.length,u=mu(e);++r>>1,i=n[o]; -(r?i<=t:it||null==r)return r;if(3=o&&a<=i&&(e=O&&t>u||e>u&&t>=O)||o)&&(t&x&&(r[2]=p[2],a|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Fr(u,e,p[4]):zt(e),r[4]=u?v(r[3],B):zt(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Ur(u,e,p[6]):zt(e),r[6]=u?v(r[5],B):zt(p[6])),(e=p[7])&&(r[7]=zt(e)),t&C&&(r[8]=null==r[8]?p[8]:uo(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=a),t=r[1],a=r[9]}return r[9]=null==a?f?0:n.length:eo(a-l,0)||0,(p?bo:Ao)(t==x?Br(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?qr.apply(null,r):Kr.apply(null,r),r) -}function Yr(n,t,r,e,u,o,i){var a=-1,f=n.length,l=t.length,c=true;if(f!=l&&(!u||l<=f))return false;for(;c&&++au)||i===e&&i===o)&&(u=i,o=n) -}),o}function Xr(n,t,r){var e=Wt.callback||pu,e=e===pu?tr:e;return r?e(n,t,r):e}function Hr(n,r,e){var u=Wt.indexOf||de,u=u===de?t:u;return n?u(n,r,e):u}function Qr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function ne(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=ku),new n}function te(n,t,r){var e=n.constructor;switch(t){case J:return Nr(n);case M:case q:return new e(+n);case X:case H:case Q:case nt:case tt:case rt:case et:case ut:case ot:return t=n.buffer,new e(r?Nr(t):t,n.byteOffset,n.length); -case V:case G:return new e(n);case Z:var u=new e(n.source,yt.exec(n));u.lastIndex=n.lastIndex}return u}function re(n,t){return n=+n,t=null==t?vo:t,-1t?0:t)):[]}function he(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0,0>t?0:t)):[]}function ge(n,t,r){var e=-1,u=n?n.length:0;for(t=Xr(t,r,3);++ee?eo(u+e,0):e||0;else if(e)return e=Tr(n,r),n=n[e],(r===r?r===n:n!==n)?e:-1; -return t(n,r,e)}function ye(n){return pe(n,1)}function _e(n,r,e,u){if(!n||!n.length)return[];typeof r!="boolean"&&null!=r&&(u=e,e=ee(n,r,u)?null:r,r=false);var o=Xr();if((o!==tr||null!=e)&&(e=o(e,u,3)),r&&Hr()==t){r=e;var i;e=-1,u=n.length;for(var o=-1,a=[];++e>>0,e=mu(r);++tr?eo(e+r,0):r||0:0,typeof n=="string"||!To(n)&&Qe(n)?rarguments.length,or)}function Te(n,t,r,e){return(To(n)?Zt:kr)(n,Xr(t,e,4),r,3>arguments.length,ir)}function Se(n,t,r){return(r?ee(n,t,r):null==t)?(n=ce(n),t=n.length,0t?0:+t||0,n.length),n) -}function We(n){n=ce(n);for(var t=-1,r=n.length,e=mu(r);++t=r||r>t?(a&&Mu(a),r=p,a=s=p=b,r&&(h=Co(),f=n.apply(c,i),s||a||(i=c=null))):s=Zu(e,r)}function u(){s&&Mu(s),a=s=p=b,(v||g!==t)&&(h=Co(),f=n.apply(c,i),s||a||(i=c=null)) -}function o(){if(i=arguments,l=Co(),c=this,p=v&&(s||!d),false===g)var r=d&&!s;else{a||d||(h=l);var o=g-(l-h),y=0>=o||o>g;y?(a&&(a=Mu(a)),h=l,f=n.apply(c,i)):a||(a=Zu(u,o))}return y&&s?s=Mu(s):s||t===g||(s=Zu(e,t)),r&&(y=true,f=n.apply(c,i)),!y||s||a||(i=c=null),f}var i,a,f,l,c,s,p,h=0,g=false,v=true;if(!Ze(n))throw new Iu($);if(t=0>t?0:t,true===r)var d=true,v=false;else Ge(r)&&(d=r.leading,g="maxWait"in r&&eo(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Mu(s),a&&Mu(a),a=s=p=b},o}function De(){var n=arguments,t=n.length-1; -if(0>t)return function(){};if(!qt(n,Ze))throw new Iu($);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function Me(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Ze(n)||t&&!Ze(t))throw new Iu($);return r.cache=new Me.Cache,r}function qe(n){var t=Er(arguments,1),r=v(t,qe.placeholder);return Vr(n,R,null,t,r)}function Pe(n){var t=Er(arguments,1),r=v(t,Pe.placeholder); -return Vr(n,I,null,t,r)}function Ke(n){return ue(h(n)?n.length:b)&&Uu.call(n)==z||false}function Ve(n){return n&&1===n.nodeType&&h(n)&&-1t||!n||!to(t))return r;do t%2&&(r+=n),t=qu(t/2),n+=n;while(t);return r}function lu(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(d(n),y(n)+1):(t=e(t),n.slice(o(n,t),i(n,t)+1)):n}function cu(n,t,r){return r&&ee(n,t,r)&&(t=null),n=e(n),n.match(t||Rt)||[] -}function su(n){try{return n()}catch(t){return Ye(t)?t:wu(t)}}function pu(n,t,r){return r&&ee(n,t,r)&&(t=null),tr(n,t)}function hu(n){return function(){return n}}function gu(n){return n}function vu(n){return wr(n,true)}function du(n,t,r){if(null==r){var e=Ge(t),u=e&&Fo(t);((u=u&&u.length&&dr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=dr(t,Fo(t)));var o=true,e=-1,i=Ze(n),a=u.length;false===r?o=false:Ge(r)&&"chain"in r&&(o=r.chain);for(;++e>>1,go=Hu?Hu.BYTES_PER_ELEMENT:0,vo=Au.pow(2,53)-1,yo=Xu&&new Xu,_o=Wt.support={};!function(n){_o.funcDecomp=!Je(g.WinRTError)&&kt.test(m),_o.funcNames=typeof xu.name=="string";try{_o.dom=11===Tu.createDocumentFragment().nodeType -}catch(t){_o.dom=false}try{_o.nonEnumArgs=!Vu.call(arguments,1)}catch(r){_o.nonEnumArgs=true}}(0,0),Wt.templateSettings={escape:ht,evaluate:gt,interpolate:vt,variable:"",imports:{_:Wt}};var mo=function(){function n(){}return function(t){if(Ge(t)){n.prototype=t;var r=new n;n.prototype=null}return r||g.Object()}}(),bo=yo?function(n,t){return yo.set(n,t),n}:gu;zu||(Nr=Bu&&Ju?function(n){var t=n.byteLength,r=Hu?qu(t/go):0,e=r*go,u=new Bu(t);if(r){var o=new Hu(u,0,r);o.set(new Hu(n,0,r))}return t!=e&&(o=new Ju(u,e),o.set(new Ju(n,e))),u -}:hu(null));var wo=no&&Yu?function(n){return new Lt(n)}:hu(null),xo=yo?function(n){return yo.get(n)}:yu,Ao=function(){var n=0,t=0;return function(r,e){var u=Co(),o=N-(u-t);if(t=u,0=W)return r}else n=0;return bo(r,e)}}(),jo=Lr(function(n,t,r){Nu.call(n,r)?++n[r]:n[r]=1}),ko=Lr(function(n,t,r){Nu.call(n,r)?n[r].push(t):n[r]=[t]}),Eo=Lr(function(n,t,r){n[r]=t}),Ro=Mr(Vt),Io=Mr(function(n){for(var t=-1,r=n.length,e=co;++t--n?t.apply(this,arguments):void 0}},Wt.ary=function(n,t,r){return r&&ee(n,t,r)&&(t=null),t=n&&null==t?n.length:eo(+t||0,0),Vr(n,C,null,null,null,null,t) -},Wt.assign=No,Wt.at=function(n){return ue(n?n.length:0)&&(n=ce(n)),Qt(n,cr(arguments,false,false,1))},Wt.before=Fe,Wt.bind=Ue,Wt.bindAll=function(n){for(var t=n,r=1(s?Bt(s,a):o(c,a))){for(r=e;--r;){var p=u[r];if(0>(p?Bt(p,a):o(n[r],a)))continue n}s&&s.push(a),c.push(a)}return c},Wt.invert=function(n,t,r){r&&ee(n,t,r)&&(t=null),r=-1; -for(var e=Fo(n),u=e.length,o={};++rt?0:t)):[]},Wt.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0>t?0:t)):[] -},Wt.takeRightWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];for(t=Xr(t,r,3);e--&&t(n[e],e,n););return Er(n,e+1)},Wt.takeWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];var u=-1;for(t=Xr(t,r,3);++un||!to(n))return[];var e=-1,u=mu(uo(n,so));for(t=Wr(t,r,1);++er?0:+r||0,u))-t.length,0<=r&&n.indexOf(t,r)==r},Wt.escape=function(n){return(n=e(n))&&pt.test(n)?n.replace(ct,c):n},Wt.escapeRegExp=iu,Wt.every=je,Wt.find=Ee,Wt.findIndex=ge,Wt.findKey=function(n,t,r){return t=Xr(t,r,3),lr(n,t,gr,true) -},Wt.findLast=function(n,t,r){return t=Xr(t,r,3),lr(n,t,ir)},Wt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Xr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Wt.findLastKey=function(n,t,r){return t=Xr(t,r,3),lr(n,t,vr,true)},Wt.findWhere=function(n,t){return Ee(n,vu(t))},Wt.first=ve,Wt.has=function(n,t){return n?Nu.call(n,t):false},Wt.identity=gu,Wt.includes=Ae,Wt.indexOf=de,Wt.isArguments=Ke,Wt.isArray=To,Wt.isBoolean=function(n){return true===n||false===n||h(n)&&Uu.call(n)==M||false},Wt.isDate=function(n){return h(n)&&Uu.call(n)==q||false -},Wt.isElement=Ve,Wt.isEmpty=function(n){if(null==n)return true;var t=n.length;return ue(t)&&(To(n)||Qe(n)||Ke(n)||h(n)&&Ze(n.splice))?!t:!Fo(n).length},Wt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Wr(r,e,3),!r&&oe(n)&&oe(t)?n===t:(e=r?r(n,t):b,typeof e=="undefined"?_r(n,t,r):!!e)},Wt.isError=Ye,Wt.isFinite=So,Wt.isFunction=Ze,Wt.isMatch=function(n,t,r,e){var u=Fo(t),o=u.length;if(r=typeof r=="function"&&Wr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],oe(e))return null!=n&&e===n[i]&&Nu.call(n,i) -}for(var i=mu(o),a=mu(o);o--;)e=i[o]=t[u[o]],a[o]=oe(e);return mr(n,u,i,a,r)},Wt.isNaN=function(n){return Xe(n)&&n!=+n},Wt.isNative=Je,Wt.isNull=function(n){return null===n},Wt.isNumber=Xe,Wt.isObject=Ge,Wt.isPlainObject=Wo,Wt.isRegExp=He,Wt.isString=Qe,Wt.isTypedArray=nu,Wt.isUndefined=function(n){return typeof n=="undefined"},Wt.kebabCase=$o,Wt.last=function(n){var t=n?n.length:0;return t?n[t-1]:b},Wt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?eo(e+r,0):uo(r||0,e-1))+1; -else if(r)return u=Tr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Wt.max=Ro,Wt.min=Io,Wt.noConflict=function(){return g._=Lu,this},Wt.noop=yu,Wt.now=Co,Wt.pad=function(n,t,r){n=e(n),t=+t;var u=n.length;return ur?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Wt.template=function(n,t,r){var u=Wt.templateSettings;r&&ee(n,t,r)&&(t=r=null),n=e(n),t=Ht(Ht({},r||t),u,Xt),r=Ht(Ht({},t.imports),u.imports,Xt);var o,i,a=Fo(r),f=Or(r,a),l=0;r=t.interpolate||xt;var c="__p+='";r=Eu((t.escape||xt).source+"|"+r.source+"|"+(r===vt?dt:xt).source+"|"+(t.evaluate||xt).source+"|$","g"); -var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,a,f){return e||(e=u),c+=n.slice(l,f).replace(Et,s),r&&(o=true,c+="'+__e("+r+")+'"),a&&(i=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),l=f+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(i?c.replace(it,""):c).replace(at,"$1").replace(ft,"$1;"),c="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}",t=su(function(){return xu(a,p+"return "+c).apply(b,f) -}),t.source=c,Ye(t))throw t;return t},Wt.trim=lu,Wt.trimLeft=function(n,t,r){var u=n;return(n=e(n))?n.slice((r?ee(u,t,r):null==t)?d(n):o(n,e(t))):n},Wt.trimRight=function(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,e(t))+1):n},Wt.trunc=function(n,t,r){r&&ee(n,t,r)&&(t=null);var u=T;if(r=S,null!=t)if(Ge(t)){var o="separator"in t?t.separator:o,u="length"in t?+t.length||0:u;r="omission"in t?e(t.omission):r}else u=+t||0;if(n=e(n),u>=n.length)return n;if(u-=r.length,1>u)return r; -if(t=n.slice(0,u),null==o)return t+r;if(He(o)){if(n.slice(u).search(o)){var i,a=n.slice(0,u);for(o.global||(o=Eu(o.source,(yt.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(a);)i=n.index;t=t.slice(0,null==i?u:i)}}else n.indexOf(o,u)!=u&&(o=t.lastIndexOf(o),-1u.dir,i.push({iteratee:Xr(n,e,3),type:t}),u -}}),Mt(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";Ft.prototype[n]=function(e){e=null==e?1:eo(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?uo(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},Ft.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},Ft.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse()}}),Mt(["first","last"],function(n,t){var r="take"+(t?"Right":"");Ft.prototype[n]=function(){return this[r](1).value()[0] -}}),Mt(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");Ft.prototype[n]=function(){return this[r](1)}}),Mt(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?vu:_u;Ft.prototype[n]=function(n){return this[r](e(n))}}),Ft.prototype.dropWhile=function(n,t){var r,e,u=0>this.dir;return n=Xr(n,t,3),this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},Ft.prototype.reject=function(n,t){return n=Xr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},Ft.prototype.slice=function(n,t){n=null==n?0:+n||0; -var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},gr(Ft.prototype,function(n,t){var r=Wt[t],e=/^(?:first|last)$/.test(t);Wt.prototype[t]=function(){function t(n){return n=[n],Ku.apply(n,o),r.apply(Wt,n)}var u=this.__wrapped__,o=arguments,i=this.__chain__,a=!!this.__actions__.length,f=u instanceof Ft,l=f&&!a;return e&&!i?l?n.call(u):r.call(Wt,this.value()):f||To(u)?(u=n.apply(l?u:new Ft(this),o),e||!a&&!u.actions||(u.actions||(u.actions=[])).push({func:xe,args:[t],thisArg:Wt}),new Nt(u,i)):this.thru(t) -}}),Mt("concat join pop push shift sort splice unshift".split(" "),function(n){var t=Ou[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n);Wt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),Ft.prototype.clone=function(){var n=this.actions,t=this.iteratees,r=this.views,e=new Ft(this.wrapped);return e.actions=n?zt(n):null,e.dir=this.dir,e.dropCount=this.dropCount,e.filtered=this.filtered,e.iteratees=t?zt(t):null,e.takeCount=this.takeCount,e.views=r?zt(r):null,e -},Ft.prototype.reverse=function(){if(this.filtered){var n=new Ft(this);n.dir=-1,n.filtered=true}else n=this.clone(),n.dir*=-1;return n},Ft.prototype.value=function(){var n=this.wrapped.value();if(!To(n))return Cr(n,this.actions);var t,r=this.dir,e=0>r;t=n.length;for(var u=this.views,o=0,i=-1,a=u?u.length:0;++i"'`]/g,st=RegExp(lt.source),pt=RegExp(ct.source),ht=/<%-([\s\S]+?)%>/g,gt=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,_t=/^\s*function[ \n\r\t]+\w/,mt=/^0[xX]/,bt=/^\[object .+?Constructor\]$/,wt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xt=/($^)/,At=/[.*+?^${}()|[\]\/\\]/g,jt=RegExp(At.source),kt=/\bthis\b/,Et=/['\n\r\u2028\u2029\\]/g,Rt=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]{2,}(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),It=" \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Ot="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),Ct={}; -Ct[X]=Ct[H]=Ct[Q]=Ct[nt]=Ct[tt]=Ct[rt]=Ct[et]=Ct[ut]=Ct[ot]=true,Ct[z]=Ct[D]=Ct[J]=Ct[M]=Ct[q]=Ct[P]=Ct[K]=Ct["[object Map]"]=Ct[V]=Ct[Y]=Ct[Z]=Ct["[object Set]"]=Ct[G]=Ct["[object WeakMap]"]=false;var Tt={};Tt[z]=Tt[D]=Tt[J]=Tt[M]=Tt[q]=Tt[X]=Tt[H]=Tt[Q]=Tt[nt]=Tt[tt]=Tt[V]=Tt[Y]=Tt[Z]=Tt[G]=Tt[rt]=Tt[et]=Tt[ut]=Tt[ot]=true,Tt[P]=Tt[K]=Tt["[object Map]"]=Tt["[object Set]"]=Tt["[object WeakMap]"]=false;var St={leading:false,maxWait:0,trailing:false},Wt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Nt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ft={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ut={"function":true,object:true},Lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=Ut[typeof window]&&window!==(this&&this.window)?window:this,Bt=Ut[typeof exports]&&exports&&!exports.nodeType&&exports,Ut=Ut[typeof module]&&module&&!module.nodeType&&module,zt=Bt&&Ut&&typeof global=="object"&&global; -!zt||zt.global!==zt&&zt.window!==zt&&zt.self!==zt||($t=zt);var zt=Ut&&Ut.exports===Bt&&Bt,Dt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=Dt, define(function(){return Dt})):Bt&&Ut?zt?(Ut.exports=Dt)._=Dt:Bt._=Dt:$t._=Dt}).call(this); \ No newline at end of file +}function i(n,t){for(var r=n.length;r--&&-1=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) +}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Yt(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++ui(r,f)&&u.push(f);return u}function or(n,t){var r=n?n.length:0;if(!ue(r))return gr(n,t);for(var e=-1,u=se(n);++et&&(t=-t>u?0:u+t),r=typeof r=="undefined"||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=_u(u);++eu(f,s)&&((r||a)&&f.push(s),c.push(l))}return c}function Or(n,t){for(var r=-1,e=t.length,u=_u(e);++r>>1,i=n[o]; +(r?i<=t:it||null==r)return r;if(3=o&&a<=i&&(e=O&&t>u||e>u&&t>=O)||o)&&(t&x&&(r[2]=p[2],a|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Ur(u,e,p[4]):zt(e),r[4]=u?v(r[3],B):zt(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Fr(u,e,p[6]):zt(e),r[6]=u?v(r[5],B):zt(p[6])),(e=p[7])&&(r[7]=zt(e)),t&C&&(r[8]=null==r[8]?p[8]:eo(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=a),t=r[1],a=r[9]}return r[9]=null==a?f?0:n.length:ro(a-c,0)||0,(p?mo:xo)(t==x?Br(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?qr.apply(null,r):Kr.apply(null,r),r) +}function Yr(n,t,r,e,u,o,i){var a=-1,f=n.length,c=t.length,l=true;if(f!=c&&(!u||c<=f))return false;for(;l&&++au)||i===e&&i===o)&&(u=i,o=n) +}),o}function Xr(n,t,r){var e=Wt.callback||pu,e=e===pu?tr:e;return r?e(n,t,r):e}function Hr(n,r,e){var u=Wt.indexOf||de,u=u===de?t:u;return n?u(n,r,e):u}function Qr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Wu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function ne(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=ju),new n}function te(n,t,r){var e=n.constructor;switch(t){case J:return Nr(n);case M:case q:return new e(+n);case X:case H:case Q:case nt:case tt:case rt:case et:case ut:case ot:return t=n.buffer,new e(r?Nr(t):t,n.byteOffset,n.length); +case V:case G:return new e(n);case Z:var u=new e(n.source,yt.exec(n));u.lastIndex=n.lastIndex}return u}function re(n,t){return n=+n,t=null==t?go:t,-1t?0:t)):[]}function he(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0,0>t?0:t)):[]}function ge(n,t,r){var e=-1,u=n?n.length:0;for(t=Xr(t,r,3);++ee?ro(u+e,0):e||0;else if(e)return e=Tr(n,r),n=n[e],(r===r?r===n:n!==n)?e:-1; +return t(n,r,e)}function ye(n){return pe(n,1)}function _e(n,r,e,u){if(!n||!n.length)return[];typeof r!="boolean"&&null!=r&&(u=e,e=ee(n,r,u)?null:r,r=false);var o=Xr();if((o!==tr||null!=e)&&(e=o(e,u,3)),r&&Hr()==t){r=e;var i;e=-1,u=n.length;for(var o=-1,a=[];++e>>0,e=_u(r);++tr?ro(e+r,0):r||0:0,typeof n=="string"||!Co(n)&&Qe(n)?rarguments.length,or)}function Te(n,t,r,e){return(Co(n)?Zt:kr)(n,Xr(t,e,4),r,3>arguments.length,ir)}function Se(n,t,r){return(r?ee(n,t,r):null==t)?(n=le(n),t=n.length,0t?0:+t||0,n.length),n) +}function We(n){n=le(n);for(var t=-1,r=n.length,e=_u(r);++t=r||r>t?(a&&Du(a),r=p,a=s=p=b,r&&(h=Oo(),f=n.apply(l,i),s||a||(i=l=null))):s=Yu(e,r)}function u(){s&&Du(s),a=s=p=b,(v||g!==t)&&(h=Oo(),f=n.apply(l,i),s||a||(i=l=null)) +}function o(){if(i=arguments,c=Oo(),l=this,p=v&&(s||!d),false===g)var r=d&&!s;else{a||d||(h=c);var o=g-(c-h),y=0>=o||o>g;y?(a&&(a=Du(a)),h=c,f=n.apply(l,i)):a||(a=Yu(u,o))}return y&&s?s=Du(s):s||t===g||(s=Yu(e,t)),r&&(y=true,f=n.apply(l,i)),!y||s||a||(i=l=null),f}var i,a,f,c,l,s,p,h=0,g=false,v=true;if(!Ze(n))throw new Ru($);if(t=0>t?0:t,true===r)var d=true,v=false;else Ge(r)&&(d=r.leading,g="maxWait"in r&&ro(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Du(s),a&&Du(a),a=s=p=b},o}function De(){var n=arguments,t=n.length-1; +if(0>t)return function(){};if(!qt(n,Ze))throw new Ru($);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function Me(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Ze(n)||t&&!Ze(t))throw new Ru($);return r.cache=new Me.Cache,r}function qe(n){var t=Er(arguments,1),r=v(t,qe.placeholder);return Vr(n,R,null,t,r)}function Pe(n){var t=Er(arguments,1),r=v(t,Pe.placeholder); +return Vr(n,I,null,t,r)}function Ke(n){return ue(h(n)?n.length:b)&&Uu.call(n)==z||false}function Ve(n){return n&&1===n.nodeType&&h(n)&&-1t||!n||!no(t))return r;do t%2&&(r+=n),t=Mu(t/2),n+=n;while(t);return r}function cu(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(d(n),y(n)+1):(t+="",n.slice(o(n,t),i(n,t)+1)):n}function lu(n,t,r){return r&&ee(n,t,r)&&(t=null),n=e(n),n.match(t||Rt)||[] +}function su(n){try{return n()}catch(t){return Ye(t)?t:bu(t)}}function pu(n,t,r){return r&&ee(n,t,r)&&(t=null),h(n)?vu(n):tr(n,t)}function hu(n){return function(){return n}}function gu(n){return n}function vu(n){return wr(rr(n,true))}function du(n,t,r){if(null==r){var e=Ge(t),u=e&&No(t);((u=u&&u.length&&dr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=dr(t,No(t)));var o=true,e=-1,i=Ze(n),a=u.length;false===r?o=false:Ge(r)&&"chain"in r&&(o=r.chain);for(;++e>>1,ho=Xu?Xu.BYTES_PER_ELEMENT:0,go=xu.pow(2,53)-1,vo=Ju&&new Ju,yo=Wt.support={};!function(n){yo.funcDecomp=!Je(g.WinRTError)&&kt.test(m),yo.funcNames=typeof wu.name=="string";try{yo.dom=11===Cu.createDocumentFragment().nodeType +}catch(t){yo.dom=false}try{yo.nonEnumArgs=!Ku.call(arguments,1)}catch(r){yo.nonEnumArgs=true}}(0,0),Wt.templateSettings={escape:ht,evaluate:gt,interpolate:vt,variable:"",imports:{_:Wt}};var _o=function(){function n(){}return function(t){if(Ge(t)){n.prototype=t;var r=new n;n.prototype=null}return r||g.Object()}}(),mo=vo?function(n,t){return vo.set(n,t),n}:gu;Bu||(Nr=$u&&Gu?function(n){var t=n.byteLength,r=Xu?Mu(t/ho):0,e=r*ho,u=new $u(t);if(r){var o=new Xu(u,0,r);o.set(new Xu(n,0,r))}return t!=e&&(o=new Gu(u,e),o.set(new Gu(n,e))),u +}:hu(null));var bo=Qu&&Vu?function(n){return new Lt(n)}:hu(null),wo=vo?function(n){return vo.get(n)}:yu,xo=function(){var n=0,t=0;return function(r,e){var u=Oo(),o=N-(u-t);if(t=u,0=W)return r}else n=0;return mo(r,e)}}(),Ao=Lr(function(n,t,r){Wu.call(n,r)?++n[r]:n[r]=1}),jo=Lr(function(n,t,r){Wu.call(n,r)?n[r].push(t):n[r]=[t]}),ko=Lr(function(n,t,r){n[r]=t}),Eo=Mr(Vt),Ro=Mr(function(n){for(var t=-1,r=n.length,e=co;++t--n?t.apply(this,arguments):void 0}},Wt.ary=function(n,t,r){return r&&ee(n,t,r)&&(t=null),t=n&&null==t?n.length:ro(+t||0,0),Vr(n,C,null,null,null,null,t)},Wt.assign=Wo,Wt.at=function(n){return ue(n?n.length:0)&&(n=le(n)),Qt(n,lr(arguments,false,false,1))},Wt.before=Ue,Wt.bind=Fe,Wt.bindAll=function(n){for(var t=n,r=1(s?Bt(s,a):o(l,a))){for(r=e;--r;){var p=u[r];if(0>(p?Bt(p,a):o(n[r],a)))continue n}s&&s.push(a),l.push(a) +}return l},Wt.invert=function(n,t,r){r&&ee(n,t,r)&&(t=null),r=-1;for(var e=No(n),u=e.length,o={};++rt?0:t)):[] +},Wt.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0>t?0:t)):[]},Wt.takeRightWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];for(t=Xr(t,r,3);e--&&t(n[e],e,n););return Er(n,e+1)},Wt.takeWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];var u=-1;for(t=Xr(t,r,3);++un||!no(n))return[];var e=-1,u=_u(eo(n,lo));for(t=Wr(t,r,1);++er?0:+r||0,u))-t.length,0<=r&&n.indexOf(t,r)==r},Wt.escape=function(n){return(n=e(n))&&pt.test(n)?n.replace(lt,l):n},Wt.escapeRegExp=iu,Wt.every=je,Wt.find=Ee,Wt.findIndex=ge,Wt.findKey=function(n,t,r){return t=Xr(t,r,3),cr(n,t,gr,true) +},Wt.findLast=function(n,t,r){return t=Xr(t,r,3),cr(n,t,ir)},Wt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Xr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Wt.findLastKey=function(n,t,r){return t=Xr(t,r,3),cr(n,t,vr,true)},Wt.findWhere=function(n,t){return Ee(n,wr(t))},Wt.first=ve,Wt.has=function(n,t){return n?Wu.call(n,t):false},Wt.identity=gu,Wt.includes=Ae,Wt.indexOf=de,Wt.isArguments=Ke,Wt.isArray=Co,Wt.isBoolean=function(n){return true===n||false===n||h(n)&&Uu.call(n)==M||false},Wt.isDate=function(n){return h(n)&&Uu.call(n)==q||false +},Wt.isElement=Ve,Wt.isEmpty=function(n){if(null==n)return true;var t=n.length;return ue(t)&&(Co(n)||Qe(n)||Ke(n)||h(n)&&Ze(n.splice))?!t:!No(n).length},Wt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Wr(r,e,3),!r&&oe(n)&&oe(t)?n===t:(e=r?r(n,t):b,typeof e=="undefined"?_r(n,t,r):!!e)},Wt.isError=Ye,Wt.isFinite=To,Wt.isFunction=Ze,Wt.isMatch=function(n,t,r,e){var u=No(t),o=u.length;if(r=typeof r=="function"&&Wr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],oe(e))return null!=n&&e===n[i]&&Wu.call(n,i) +}for(var i=_u(o),a=_u(o);o--;)e=i[o]=t[u[o]],a[o]=oe(e);return mr(n,u,i,a,r)},Wt.isNaN=function(n){return Xe(n)&&n!=+n},Wt.isNative=Je,Wt.isNull=function(n){return null===n},Wt.isNumber=Xe,Wt.isObject=Ge,Wt.isPlainObject=So,Wt.isRegExp=He,Wt.isString=Qe,Wt.isTypedArray=nu,Wt.isUndefined=function(n){return typeof n=="undefined"},Wt.kebabCase=Lo,Wt.last=function(n){var t=n?n.length:0;return t?n[t-1]:b},Wt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?ro(e+r,0):eo(r||0,e-1))+1; +else if(r)return u=Tr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Wt.max=Eo,Wt.min=Ro,Wt.noConflict=function(){return g._=Fu,this},Wt.noop=yu,Wt.now=Oo,Wt.pad=function(n,t,r){n=e(n),t=+t;var u=n.length;return ur?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Wt.template=function(n,t,r){var u=Wt.templateSettings;r&&ee(n,t,r)&&(t=r=null),n=e(n),t=Ht(Ht({},r||t),u,Xt),r=Ht(Ht({},t.imports),u.imports,Xt);var o,i,a=No(r),f=Or(r,a),c=0;r=t.interpolate||xt;var l="__p+='";r=ku((t.escape||xt).source+"|"+r.source+"|"+(r===vt?dt:xt).source+"|"+(t.evaluate||xt).source+"|$","g"); +var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,a,f){return e||(e=u),l+=n.slice(c,f).replace(Et,s),r&&(o=true,l+="'+__e("+r+")+'"),a&&(i=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=f+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(it,""):l).replace(at,"$1").replace(ft,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=su(function(){return wu(a,p+"return "+l).apply(b,f) +}),t.source=l,Ye(t))throw t;return t},Wt.trim=cu,Wt.trimLeft=function(n,t,r){var u=n;return(n=e(n))?n.slice((r?ee(u,t,r):null==t)?d(n):o(n,t+"")):n},Wt.trimRight=function(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,t+"")+1):n},Wt.trunc=function(n,t,r){r&&ee(n,t,r)&&(t=null);var u=T;if(r=S,null!=t)if(Ge(t)){var o="separator"in t?t.separator:o,u="length"in t?+t.length||0:u;r="omission"in t?e(t.omission):r}else u=+t||0;if(n=e(n),u>=n.length)return n;if(u-=r.length,1>u)return r; +if(t=n.slice(0,u),null==o)return t+r;if(He(o)){if(n.slice(u).search(o)){var i,a=n.slice(0,u);for(o.global||(o=ku(o.source,(yt.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(a);)i=n.index;t=t.slice(0,null==i?u:i)}}else n.indexOf(o,u)!=u&&(o=t.lastIndexOf(o),-1u.dir,i.push({iteratee:Xr(n,e,3),type:t}),u +}}),Mt(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";Ut.prototype[n]=function(e){e=null==e?1:ro(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?eo(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},Ut.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},Ut.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse()}}),Mt(["first","last"],function(n,t){var r="take"+(t?"Right":"");Ut.prototype[n]=function(){return this[r](1).value()[0] +}}),Mt(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");Ut.prototype[n]=function(){return this[r](1)}}),Mt(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?wr:Ar;Ut.prototype[n]=function(n){return this[r](e(t?n:n+""))}}),Ut.prototype.dropWhile=function(n,t){var r,e,u=0>this.dir;return n=Xr(n,t,3),this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},Ut.prototype.reject=function(n,t){return n=Xr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},Ut.prototype.slice=function(n,t){n=null==n?0:+n||0; +var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},gr(Ut.prototype,function(n,t){var r=Wt[t],e=/^(?:first|last)$/.test(t);Wt.prototype[t]=function(){function t(n){return n=[n],Pu.apply(n,o),r.apply(Wt,n)}var u=this.__wrapped__,o=arguments,i=this.__chain__,a=!!this.__actions__.length,f=u instanceof Ut,c=f&&!a;return e&&!i?c?n.call(u):r.call(Wt,this.value()):f||Co(u)?(u=n.apply(c?u:new Ut(this),o),e||!a&&!u.actions||(u.actions||(u.actions=[])).push({func:xe,args:[t],thisArg:Wt}),new Nt(u,i)):this.thru(t) +}}),Mt("concat join pop push shift sort splice unshift".split(" "),function(n){var t=Iu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n);Wt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),Ut.prototype.clone=function(){var n=this.actions,t=this.iteratees,r=this.views,e=new Ut(this.wrapped);return e.actions=n?zt(n):null,e.dir=this.dir,e.dropCount=this.dropCount,e.filtered=this.filtered,e.iteratees=t?zt(t):null,e.takeCount=this.takeCount,e.views=r?zt(r):null,e +},Ut.prototype.reverse=function(){if(this.filtered){var n=new Ut(this);n.dir=-1,n.filtered=true}else n=this.clone(),n.dir*=-1;return n},Ut.prototype.value=function(){var n=this.wrapped.value();if(!Co(n))return Cr(n,this.actions);var t,r=this.dir,e=0>r;t=n.length;for(var u=this.views,o=0,i=-1,a=u?u.length:0;++i"'`]/g,st=RegExp(ct.source),pt=RegExp(lt.source),ht=/<%-([\s\S]+?)%>/g,gt=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,_t=/^\s*function[ \n\r\t]+\w/,mt=/^0[xX]/,bt=/^\[object .+?Constructor\]$/,wt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xt=/($^)/,At=/[.*+?^${}()|[\]\/\\]/g,jt=RegExp(At.source),kt=/\bthis\b/,Et=/['\n\r\u2028\u2029\\]/g,Rt=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]{2,}(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),It=" \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Ot="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),Ct={}; +Ct[X]=Ct[H]=Ct[Q]=Ct[nt]=Ct[tt]=Ct[rt]=Ct[et]=Ct[ut]=Ct[ot]=true,Ct[z]=Ct[D]=Ct[J]=Ct[M]=Ct[q]=Ct[P]=Ct[K]=Ct["[object Map]"]=Ct[V]=Ct[Y]=Ct[Z]=Ct["[object Set]"]=Ct[G]=Ct["[object WeakMap]"]=false;var Tt={};Tt[z]=Tt[D]=Tt[J]=Tt[M]=Tt[q]=Tt[X]=Tt[H]=Tt[Q]=Tt[nt]=Tt[tt]=Tt[V]=Tt[Y]=Tt[Z]=Tt[G]=Tt[rt]=Tt[et]=Tt[ut]=Tt[ot]=true,Tt[P]=Tt[K]=Tt["[object Map]"]=Tt["[object Set]"]=Tt["[object WeakMap]"]=false;var St={leading:false,maxWait:0,trailing:false},Wt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Nt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ut={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ft={"function":true,object:true},Lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=Ft[typeof window]&&window!==(this&&this.window)?window:this,Bt=Ft[typeof exports]&&exports&&!exports.nodeType&&exports,Ft=Ft[typeof module]&&module&&!module.nodeType&&module,zt=Bt&&Ft&&typeof global=="object"&&global; +!zt||zt.global!==zt&&zt.window!==zt&&zt.self!==zt||($t=zt);var zt=Ft&&Ft.exports===Bt&&Bt,Dt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=Dt, define(function(){return Dt})):Bt&&Ft?zt?(Ft.exports=Dt)._=Dt:Bt._=Dt:$t._=Dt}).call(this); \ No newline at end of file diff --git a/lodash.src.js b/lodash.src.js index 0fc2c68a9d..2f55e9354a 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -1,6 +1,6 @@ /** * @license - * lodash 3.0.1 + * lodash 3.1.0 * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '3.0.1'; + var VERSION = '3.1.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -796,7 +796,7 @@ /** * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * for more details. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; @@ -882,14 +882,14 @@ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, * `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, - * `isFunction`, `isMatch` , `isNative`, `isNaN`, `isNull`, `isNumber`, + * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, * `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, * `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, - * `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, - * `unescape`, `uniqueId`, `value`, and `words` + * `startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, + * `trunc`, `unescape`, `uniqueId`, `value`, and `words` * * The wrapper function `sample` will return a wrapped value when `n` is provided, * otherwise an unwrapped value is returned. @@ -1803,7 +1803,7 @@ } // Handle "_.property" and "_.matches" style callback shorthands. return type == 'object' - ? baseMatches(func, !argCount) + ? baseMatches(func) : baseProperty(func + ''); } @@ -2427,10 +2427,9 @@ * * @private * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. * @returns {Function} Returns the new function. */ - function baseMatches(source, isCloned) { + function baseMatches(source) { var props = keys(source), length = props.length; @@ -2444,9 +2443,6 @@ }; } } - if (isCloned) { - source = baseClone(source, true); - } var values = Array(length), strictCompareFlags = Array(length); @@ -3761,7 +3757,7 @@ var length = object.length, prereq = isLength(length) && isIndex(index, length); } else { - prereq = type == 'string' && index in value; + prereq = type == 'string' && index in object; } return prereq && object[index] === value; } @@ -3769,6 +3765,10 @@ /** * Checks if `value` is a valid array-like length. * + * **Note:** This function is based on ES `ToLength`. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. @@ -5861,7 +5861,7 @@ * // => 'fred' */ function findWhere(collection, source) { - return find(collection, matches(source)); + return find(collection, baseMatches(source)); } /** @@ -6238,7 +6238,7 @@ * // => [36, 40] (iteration order is not guaranteed) */ function pluck(collection, key) { - return map(collection, property(key)); + return map(collection, baseProperty(key + '')); } /** @@ -6609,7 +6609,7 @@ * // => ['barney', 'fred'] */ function where(collection, source) { - return filter(collection, matches(source)); + return filter(collection, baseMatches(source)); } /*------------------------------------------------------------------------*/ @@ -9294,7 +9294,7 @@ */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); - return index ? (result + word.charAt(0).toUpperCase() + word.slice(1)) : word; + return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); }); /** @@ -9645,16 +9645,41 @@ * _.snakeCase('Foo Bar'); * // => 'foo_bar' * - * _.snakeCase('--foo-bar'); + * _.snakeCase('fooBar'); * // => 'foo_bar' * - * _.snakeCase('fooBar'); + * _.snakeCase('--foo-bar'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); + /** + * Converts `string` to start case. + * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage) + * for more details. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__foo_bar__'); + * // => 'Foo Bar' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); + }); + /** * Checks if `string` starts with the given target string. * @@ -9914,7 +9939,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); } - chars = baseToString(chars); + chars = (chars + ''); return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); } @@ -9945,7 +9970,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string)) } - return string.slice(charsLeftIndex(string, baseToString(chars))); + return string.slice(charsLeftIndex(string, (chars + ''))); } /** @@ -9975,7 +10000,7 @@ if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(0, trimmedRightIndex(string) + 1) } - return string.slice(0, charsRightIndex(string, baseToString(chars)) + 1); + return string.slice(0, charsRightIndex(string, (chars + '')) + 1); } /** @@ -10182,7 +10207,9 @@ if (guard && isIterateeCall(func, thisArg, guard)) { thisArg = null; } - return baseCallback(func, thisArg); + return isObjectLike(func) + ? matches(func) + : baseCallback(func, thisArg); } /** @@ -10250,7 +10277,7 @@ * // => { 'user': 'barney', 'age': 36 } */ function matches(source) { - return baseMatches(source, true); + return baseMatches(baseClone(source, true)); } /** @@ -10747,6 +10774,7 @@ lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedLastIndex = sortedLastIndex; + lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.template = template; lodash.trim = trim; @@ -10872,10 +10900,10 @@ // Add `LazyWrapper` methods for `_.pluck` and `_.where`. arrayEach(['pluck', 'where'], function(methodName, index) { var operationName = index ? 'filter' : 'map', - createCallback = index ? matches : property; + createCallback = index ? baseMatches : baseProperty; LazyWrapper.prototype[methodName] = function(value) { - return this[operationName](createCallback(value)); + return this[operationName](createCallback(index ? value : (value + ''))); }; }); diff --git a/package.json b/package.json index af5396d7b0..a5ad81146b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "3.0.1", + "version": "3.1.0", "main": "lodash.src.js", "private": true, "devDependencies": { diff --git a/test/test.js b/test/test.js index ca393e0851..f1bfde13d2 100644 --- a/test/test.js +++ b/test/test.js @@ -1444,7 +1444,7 @@ QUnit.module('case methods'); - _.each(['camel', 'kebab', 'snake'], function(caseName) { + _.each(['camel', 'kebab', 'snake', 'start'], function(caseName) { var methodName = caseName + 'Case', func = _[methodName]; @@ -1453,16 +1453,18 @@ 'FOO BAR', 'fooBar', '--foo-bar', '__foo_bar__' ]; - var expected = (function() { + var converted = (function() { switch (caseName) { case 'camel': return 'fooBar'; case 'kebab': return 'foo-bar'; case 'snake': return 'foo_bar'; + case 'start': return 'Foo Bar'; } }()); test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', 1, function() { var actual = _.map(strings, function(string) { + var expected = (caseName === 'start' && string === 'FOO BAR') ? string : converted; return func(string) === expected; }); @@ -1471,6 +1473,7 @@ test('`_.' + methodName + '` should handle double-converting strings', 1, function() { var actual = _.map(strings, function(string) { + var expected = (caseName === 'start' && string === 'FOO BAR') ? string : converted; return func(func(string)) === expected; }); @@ -1479,7 +1482,9 @@ test('`_.' + methodName + '` should deburr letters', 1, function() { var actual = _.map(burredLetters, function(burred, index) { - return func(burred) === deburredLetters[index].toLowerCase(); + var letter = deburredLetters[index]; + letter = caseName == 'start' ? _.capitalize(letter) : letter.toLowerCase(); + return func(burred) === letter; }); deepEqual(actual, _.map(burredLetters, _.constant(true))); @@ -1491,14 +1496,14 @@ }); test('`_.' + methodName + '` should coerce `string` to a string', 2, function() { - var string = 'Foo Bar'; - strictEqual(func(Object(string)), expected); - strictEqual(func({ 'toString': _.constant(string) }), expected); + var string = 'foo bar'; + strictEqual(func(Object(string)), converted); + strictEqual(func({ 'toString': _.constant(string) }), converted); }); test('`_.' + methodName + '` should return an unwrapped value when chaining', 1, function() { if (!isNpm) { - strictEqual(_('foo bar')[methodName](), expected); + strictEqual(_('foo bar')[methodName](), converted); } else { skipTest(); @@ -1749,9 +1754,9 @@ ok(clone.bar.b === clone.foo.b && clone === clone.foo.b.c.d && clone !== object); }); - _.each(['clone', 'cloneDeep'], function(methodName, index) { + _.each(['clone', 'cloneDeep'], function(methodName) { var func = _[methodName], - isDeep = !!index; + isDeep = methodName == 'cloneDeep'; _.forOwn(objects, function(object, key) { test('`_.' + methodName + '` should clone ' + key, 2, function() { @@ -1993,9 +1998,9 @@ QUnit.module('flow methods'); - _.each(['flow', 'flowRight'], function(methodName, index) { + _.each(['flow', 'flowRight'], function(methodName) { var func = _[methodName], - isFlow = !index; + isFlow = methodName == 'flow'; test('`_.' + methodName + '` should supply each function with the return value of the previous', 1, function() { function add(x, y) { @@ -2365,14 +2370,13 @@ }); test('should support binding built-in methods', 2, function() { - var object = { 'a': 1 }, + var fn = function() {}, + object = { 'a': 1 }, + bound = fn.bind && fn.bind(object), callback = _.callback(hasOwnProperty, object); strictEqual(callback('a'), true); - var fn = function() {}, - bound = fn.bind && fn.bind(object); - if (bound) { callback = _.callback(bound, object); notStrictEqual(callback, bound); @@ -2432,8 +2436,8 @@ test('should work as an iteratee for `_.map`', 1, function() { var fn = function() { return this instanceof Number; }, array = [fn, fn, fn], - expected = _.map(array, _.constant(false)), - callbacks = _.map(array, _.callback); + callbacks = _.map(array, _.callback), + expected = _.map(array, _.constant(false)); var actual = _.map(callbacks, function(callback) { return callback(); @@ -3041,17 +3045,24 @@ QUnit.module('curry methods'); _.each(['curry', 'curryRight'], function(methodName) { - var func = _[methodName]; + var func = _[methodName], + fn = function(a, b) { return slice.call(arguments); }, + isCurry = methodName == 'curry'; - test('`_.' + methodName + '` should work as an iteratee for `_.map`', 1, function() { - var array = [_.identity, _.identity, _.identity], - curries = _.map(array, func); + test('`_.' + methodName + '` should work as an iteratee for `_.map`', 2, function() { + var array = [fn, fn, fn], + object = { 'a': fn, 'b': fn, 'c': fn }; - var actual = _.map(curries, function(curried, index) { - return curried(index); - }); + _.each([array, object], function(collection) { + var curries = _.map(collection, func), + expected = _.map(collection, _.constant(isCurry ? ['a', 'b'] : ['b', 'a'])); - deepEqual(actual, [0, 1, 2]); + var actual = _.map(curries, function(curried) { + return curried('a')('b'); + }); + + deepEqual(actual, expected); + }); }); }); @@ -3580,25 +3591,30 @@ } }); - test('should work in a lazy chain sequence', 4, function() { + test('should work in a lazy chain sequence', 6, function() { if (!isNpm) { - var array = [1, 2, 3, 4, 5, 6, 7, 8], - predicate = function(value) { return value > 1; }, + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + values = [], + predicate = function(value) { values.push(value); return value > 2; }, actual = _(array).drop(2).drop().value(); - deepEqual(actual, [4, 5, 6, 7, 8]); + deepEqual(actual, [4, 5, 6, 7, 8, 9, 10]); actual = _(array).filter(predicate).drop(2).drop().value(); - deepEqual(actual, [5, 6, 7, 8]); + deepEqual(actual, [6, 7, 8, 9, 10]); + deepEqual(values, array); actual = _(array).drop(2).dropRight().drop().dropRight(2).value(); - deepEqual(actual, [4, 5]); + deepEqual(actual, [4, 5, 6, 7]); - actual = _(array).filter(predicate).drop(2).dropRight().drop().dropRight(2).value(); - deepEqual(actual, [5]); + values = []; + + actual = _(array).drop().filter(predicate).drop(2).dropRight().drop().dropRight(2).value(); + deepEqual(actual, [6, 7]); + deepEqual(values, array.slice(1)); } else { - skipTest(4); + skipTest(6); } }); }()); @@ -3656,25 +3672,30 @@ } }); - test('should work in a lazy chain sequence', 4, function() { + test('should work in a lazy chain sequence', 6, function() { if (!isNpm) { - var array = [1, 2, 3, 4, 5, 6, 7, 8], - predicate = function(value) { return value < 8; }, + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + values = [], + predicate = function(value) { values.push(value); return value < 9; }, actual = _(array).dropRight(2).dropRight().value(); - deepEqual(actual, [1, 2, 3, 4, 5]); + deepEqual(actual, [1, 2, 3, 4, 5, 6, 7]); actual = _(array).filter(predicate).dropRight(2).dropRight().value(); - deepEqual(actual, [1, 2, 3, 4]); + deepEqual(actual, [1, 2, 3, 4, 5]); + deepEqual(values, array); actual = _(array).dropRight(2).drop().dropRight().drop(2).value(); - deepEqual(actual, [4, 5]); + deepEqual(actual, [4, 5, 6, 7]); - actual = _(array).filter(predicate).dropRight(2).drop().dropRight().drop(2).value(); - deepEqual(actual, [4]); + values = []; + + actual = _(array).dropRight().filter(predicate).dropRight(2).drop().dropRight().drop(2).value(); + deepEqual(actual, [4, 5]); + deepEqual(values, array.slice(0, -1)); } else { - skipTest(4); + skipTest(6); } }); }()); @@ -4282,25 +4303,30 @@ } }); - test('should work in a lazy chain sequence', 4, function() { + test('should work in a lazy chain sequence', 6, function() { if (!isNpm) { - var array = [1, 2, 3, 4, 5, 6, 7, 8], - predicate = function(value) { return value > 1; }, + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9 , 10], + values = [], + predicate = function(value) { values.push(value); return value > 2; }, actual = _(array).take(2).take().value(); deepEqual(actual, [1]); actual = _(array).filter(predicate).take(2).take().value(); - deepEqual(actual, [2]); + deepEqual(actual, [3]); + deepEqual(values, array.slice(0, 3)); actual = _(array).take(6).takeRight(4).take(2).takeRight().value(); deepEqual(actual, [4]); - actual = _(array).filter(predicate).take(6).takeRight(4).take(2).takeRight().value(); - deepEqual(actual, [5]); + values = []; + + actual = _(array).take(array.length - 1).filter(predicate).take(6).takeRight(4).take(2).takeRight().value(); + deepEqual(actual, [6]); + deepEqual(values, array.slice(0, -2)); } else { - skipTest(4); + skipTest(6); } }); }()); @@ -4358,25 +4384,30 @@ } }); - test('should work in a lazy chain sequence', 4, function() { + test('should work in a lazy chain sequence', 6, function() { if (!isNpm) { - var array = [1, 2, 3, 4, 5, 6, 7, 8], - predicate = function(value) { return value < 8; }, + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + values = [], + predicate = function(value) { values.push(value); return value < 9; }, actual = _(array).takeRight(2).takeRight().value(); - deepEqual(actual, [8]); + deepEqual(actual, [10]); actual = _(array).filter(predicate).takeRight(2).takeRight().value(); - deepEqual(actual, [7]); + deepEqual(actual, [8]); + deepEqual(values, array); actual = _(array).takeRight(6).take(4).takeRight(2).take().value(); - deepEqual(actual, [5]); + deepEqual(actual, [7]); + + values = []; actual = _(array).filter(predicate).takeRight(6).take(4).takeRight(2).take().value(); - deepEqual(actual, [4]); + deepEqual(actual, [5]); + deepEqual(values, array); } else { - skipTest(4); + skipTest(6); } }); }()); @@ -4810,11 +4841,9 @@ }); test('`_.' + methodName + '` should support the `thisArg` argument', 2, function() { - var actual; + var actual, + callback = function(num, index) { actual = this[index]; }; - function callback(num, index) { - actual = this[index]; - } func([1], callback, [2]); strictEqual(actual, 2); @@ -5102,9 +5131,9 @@ }); }); - _.each(['assign', 'merge'], function(methodName, index) { + _.each(['assign', 'merge'], function(methodName) { var func = _[methodName], - isMerge = !!index; + isMerge = methodName == 'merge'; test('`_.' + methodName + '` should provide the correct `customizer` arguments', 3, function() { var args, @@ -5778,7 +5807,7 @@ } }); - test('should work in a lazy chain sequence', 2, function() { + test('should work in a lazy chain sequence', 4, function() { if (!isNpm) { var array = [1, 2, 3], values = []; @@ -5791,9 +5820,21 @@ deepEqual(actual, []); deepEqual(values, [1, 2]); + + values = []; + + actual = _(array).filter(function(value) { + values.push(value); + return value < 3; + }) + .initial() + .value(); + + deepEqual(actual, [1]); + deepEqual(values, array); } else { - skipTest(2); + skipTest(4); } }); }()); @@ -5889,12 +5930,18 @@ ok(_.isEqual(_.invert(object, true), { 'hasOwnProperty': ['a'], 'constructor': ['b'] })); }); - test('should work as an iteratee for `_.map`', 1, function() { - var inverted = { '1': 'c', '2': 'b' }, - object = { 'a': 1, 'b': 2, 'c': 1 }, - actual = _.map([object, object, object], _.invert); + test('should work as an iteratee for `_.map`', 2, function() { + var regular = { 'a': 1, 'b': 2, 'c': 1 }, + inverted = { '1': 'c', '2': 'b' }; + + var array = [regular, regular, regular], + object = { 'a': regular, 'b': regular, 'c': regular }, + expected = _.map(array, _.constant(inverted)); - deepEqual(actual, [inverted, inverted, inverted]); + _.each([array, object], function(collection) { + var actual = _.map(collection, _.invert); + deepEqual(actual, expected); + }); }); test('should return a wrapped value when chaining', 2, function() { @@ -7967,10 +8014,10 @@ QUnit.module('keys methods'); - _.each(['keys', 'keysIn'], function(methodName, index) { + _.each(['keys', 'keysIn'], function(methodName) { var args = arguments, func = _[methodName], - isKeys = !index; + isKeys = methodName == 'keys'; test('`_.' + methodName + '` should return the keys of an object', 1, function() { deepEqual(func({ 'a': 1, 'b': 1 }).sort(), ['a', 'b']); @@ -8343,11 +8390,9 @@ }); test('should support the `thisArg` argument', 2, function() { - function callback(num, index) { - return this[index] + num; - } + var callback = function(num, index) { return this[index] + num; }, + actual = _.map([1], callback, [2]); - var actual = _.map([1], callback, [2]); deepEqual(actual, [3]); actual = _.map({ 'a': 1 }, callback, { 'a': 2 }); @@ -9018,7 +9063,7 @@ test('should not not error on DOM elements', 1, function() { var object1 = { 'el': document && document.createElement('div') }, object2 = { 'el': document && document.createElement('div') }, - pairs = [[{}, object1], [object2, object1]], + pairs = [[{}, object1], [object1, object2]], expected = _.map(pairs, _.constant(true)); var actual = _.map(pairs, function(pair) { @@ -9086,10 +9131,10 @@ QUnit.module('lodash.max and lodash.min'); - _.each(['max', 'min'], function(methodName, index) { + _.each(['max', 'min'], function(methodName) { var array = [1, 2, 3], func = _[methodName], - isMax = !index; + isMax = methodName == 'max'; test('`_.' + methodName + '` should work with Date objects', 1, function() { var curr = new Date, @@ -9845,9 +9890,9 @@ QUnit.module('partial methods'); - _.each(['partial', 'partialRight'], function(methodName, index) { + _.each(['partial', 'partialRight'], function(methodName) { var func = _[methodName], - isPartial = !index, + isPartial = methodName == 'partial', ph = func.placeholder; test('`_.' + methodName + '` partially applies arguments', 1, function() { @@ -9856,9 +9901,9 @@ }); test('`_.' + methodName + '` creates a function that can be invoked with additional arguments', 1, function() { - var expected = ['a', 'b'], - fn = function(a, b) { return [a, b]; }, - par = func(fn, 'a'); + var fn = function(a, b) { return [a, b]; }, + par = func(fn, 'a'), + expected = ['a', 'b']; deepEqual(par('b'), isPartial ? expected : expected.reverse()); }); @@ -10092,11 +10137,11 @@ test('should work when hot', 12, function() { _.times(2, function(index) { - function fn() { + var fn = function() { var result = [this]; push.apply(result, arguments); return result; - } + }; var object = {}, bound1 = index ? _.bind(fn, object, 1) : _.bind(fn, object), @@ -10120,11 +10165,8 @@ }); _.each(['curry', 'curryRight'], function(methodName, index) { - function fn(a, b, c) { - return [a, b, c]; - } - - var curried = _[methodName](fn), + var fn = function(a, b, c) { return [a, b, c]; }, + curried = _[methodName](fn), expected = index ? [3, 2, 1] : [1, 2, 3]; var actual = _.last(_.times(HOT_COUNT, function() { @@ -10142,11 +10184,8 @@ }); _.each(['partial', 'partialRight'], function(methodName, index) { - function fn() { - return slice.call(arguments); - } - var func = _[methodName], + fn = function() { return slice.call(arguments); }, par1 = func(fn, 1), expected = index ? [3, 2, 1] : [1, 2, 3]; @@ -10745,9 +10784,15 @@ deepEqual(actual, [[0], [0], [0], [], []]); }); - test('should work as an iteratee for `_.map`', 1, function() { - var actual = _.map([1, 2, 3], _.range); - deepEqual(actual, [[0], [0, 1], [0, 1, 2]]); + test('should work as an iteratee for `_.map`', 2, function() { + var array = [1, 2, 3], + object = { 'a': 1, 'b': 2, 'c': 3 }, + expected = [[0], [0, 1], [0, 1, 2]]; + + _.each([array, object], function(collection) { + var actual = _.map(collection, _.range); + deepEqual(actual, expected); + }); }); }()); @@ -10982,16 +11027,17 @@ QUnit.module('reduce methods'); - _.each(['reduce', 'reduceRight'], function(methodName, index) { - var array = [1, 2, 3], - func = _[methodName]; + _.each(['reduce', 'reduceRight'], function(methodName) { + var func = _[methodName], + array = [1, 2, 3], + isReduce = methodName == 'reduce'; test('`_.' + methodName + '` should reduce a collection to a single value', 1, function() { var actual = func(['a', 'b', 'c'], function(accumulator, value) { return accumulator + value; }, ''); - strictEqual(actual, index ? 'cba' : 'abc'); + strictEqual(actual, isReduce ? 'abc' : 'cba'); }); test('`_.' + methodName + '` should support the `thisArg` argument', 1, function() { @@ -11078,9 +11124,9 @@ QUnit.module('filter methods'); - _.each(['filter', 'reject'], function(methodName, index) { + _.each(['filter', 'reject'], function(methodName) { var func = _[methodName], - isFilter = !index; + isFilter = methodName == 'filter'; test('`_.' + methodName + '` should not modify the resulting value from within `predicate`', 1, function() { var actual = func([0], function(num, index, array) { @@ -11329,7 +11375,7 @@ } }); - test('should work in a lazy chain sequence', 2, function() { + test('should work in a lazy chain sequence', 4, function() { if (!isNpm) { var array = [1, 2, 3], values = []; @@ -11342,9 +11388,21 @@ deepEqual(actual, []); deepEqual(values, [2, 3]); + + values = []; + + actual = _(array).filter(function(value) { + values.push(value); + return value > 1; + }) + .rest() + .value(); + + deepEqual(actual, [3]); + deepEqual(values, array); } else { - skipTest(2); + skipTest(4); } }); @@ -11468,7 +11526,10 @@ }); test('should work as an iteratee for `_.map`', 2, function() { - _.each([[[1, 2, 3], [4, 5, 6], [7, 8, 9]], ['abc', 'def', 'ghi']], function(values) { + var array1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], + array2 = ['abc', 'def', 'ghi']; + + _.each([array1, array2], function(values) { var a = values[0], b = values[1], c = values[2], @@ -11713,7 +11774,7 @@ }); }); - test('should coerce `start` and `end` to finite numbers', 1, function() { + test('should coerce `start` and `end` to integers', 1, function() { var actual = [_.slice(array, 0.1, 1.1), _.slice(array, '0', 1), _.slice(array, 0, '1'), _.slice(array, '1'), _.slice(array, NaN, 1), _.slice(array, 1, NaN)]; deepEqual(actual, [[1], [1], [1], [2, 3], [1], []]); }); @@ -12007,10 +12068,10 @@ QUnit.module('sortedIndex methods'); - _.each(['sortedIndex', 'sortedLastIndex'], function(methodName, index) { + _.each(['sortedIndex', 'sortedLastIndex'], function(methodName) { var array = [30, 50], func = _[methodName], - isSortedIndex = !index, + isSortedIndex = methodName == 'sortedIndex', objects = [{ 'x': 30 }, { 'x': 50 }]; test('`_.' + methodName + '` should return the correct insert index', 1, function() { @@ -12200,9 +12261,9 @@ QUnit.module('lodash.startsWith and lodash.endsWith'); - _.each(['startsWith', 'endsWith'], function(methodName, index) { + _.each(['startsWith', 'endsWith'], function(methodName) { var func = _[methodName], - isStartsWith = !index; + isStartsWith = methodName == 'startsWith'; var string = 'abc', chr = isStartsWith ? 'a' : 'c'; @@ -12735,9 +12796,9 @@ }); }); - test('should coerce `length` to a number', 4, function() { - _.each(['', '4'], function(length, index) { - var actual = index ? 'h...' : '...'; + test('should coerce `length` to an integer', 8, function() { + _.each(['', NaN, 4.5, '4'], function(length, index) { + var actual = index > 1 ? 'h...' : '...'; strictEqual(_.trunc(string, length), actual); strictEqual(_.trunc(string, { 'length': { 'valueOf': _.constant(length) } }), actual); }); @@ -12999,9 +13060,9 @@ QUnit.module('lodash.debounce and lodash.throttle'); - _.each(['debounce', 'throttle'], function(methodName, index) { + _.each(['debounce', 'throttle'], function(methodName) { var func = _[methodName], - isDebounce = !index; + isDebounce = methodName == 'debounce'; test('_.' + methodName + ' should not error for non-object `options` values', 1, function() { var pass = true; @@ -14308,18 +14369,20 @@ } }); - test('should would in a hybrid chain sequence', 2, function() { + test('should work in a hybrid chain sequence', 4, function() { if (!isNpm) { - var array = [1, 2, 3, null], - actual = _(array).map(_.identity).compact().reverse().value(); + var array = [1, 2, 3, null]; - deepEqual(actual, [3, 2, 1]); + _.each(['map', 'filter'], function(methodName) { + var actual = _(array)[methodName](_.identity).compact().reverse().value(); + deepEqual(actual, [3, 2, 1]); - actual = _([1, 2, 3, null]).map(_.identity).compact().pull(1).push(4).reverse().value() - deepEqual(actual, [4, 3, 2]); + actual = _(array.slice()).pull(2)[methodName](_.identity).compact().pull(1).push(4).reverse().value(); + deepEqual(actual, [4, 3]); + }); } else { - skipTest(2); + skipTest(4); } }); }()); @@ -14824,7 +14887,7 @@ var acceptFalsey = _.difference(allMethods, rejectFalsey); - test('should accept falsey arguments', 205, function() { + test('should accept falsey arguments', 206, function() { var emptyArrays = _.map(falsey, _.constant([])), isExposed = '_' in root, oldDash = root._;