mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Bump to v0.2.1.
Former-commit-id: d433d39ac7269479f1b9ac3803e62c5021f41e11
This commit is contained in:
22
README.md
22
README.md
@@ -1,4 +1,4 @@
|
||||
# Lo-Dash <sup>v0.2.0</sup>
|
||||
# Lo-Dash <sup>v0.2.1</sup>
|
||||
|
||||
A drop-in replacement for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), that delivers [performance improvements](http://jsperf.com/lodash-underscore#filterby=family), [bug fixes](https://github.com/bestiejs/lodash#closed-underscorejs-issues), and [additional features](https://github.com/bestiejs/lodash#features).
|
||||
|
||||
@@ -116,11 +116,13 @@ git submodule update --init
|
||||
|
||||
## Closed Underscore.js issues
|
||||
|
||||
* Fix Firefox, IE, Opera, and Safari object iteration bugs [#376](https://github.com/documentcloud/underscore/issues/376)
|
||||
* Handle arrays with `undefined` values correctly in IE < 9 [#601](https://github.com/documentcloud/underscore/issues/601)
|
||||
* Methods should work on pages with incorrectly shimmed native methods [#7](https://github.com/documentcloud/underscore/issues/7)
|
||||
* Register as AMD module, but still export to global [#431](https://github.com/documentcloud/underscore/pull/431)
|
||||
* `_.forEach` should be chainable [#142](https://github.com/documentcloud/underscore/issues/142)
|
||||
* Ensure `_.groupBy` only adds values to own, not inherited, properties [[test](https://github.com/bestiejs/lodash/commit/e4176d12670542a043eb19564fea91cccffea50f), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L229-236)]
|
||||
* Ensure `_.throttle` works when called in tight loop [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L436-446)]
|
||||
* Fix Firefox, IE, Opera, and Safari object iteration bugs [[#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L152-172), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L206-213), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L255-257), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L265-267), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L285-292), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L386-388)]
|
||||
* Handle arrays with `undefined` values correctly in IE < 9 [[#601](https://github.com/documentcloud/underscore/issues/601)]
|
||||
* Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [test](https://github.com/bestiejs/lodash/blob/2416dde0a06f29ff281ea39dd8aa405561ff867a/test/test.js#L66-72)]
|
||||
* Register as AMD module, but still export to global [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L61-75)]
|
||||
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L74-77)]
|
||||
* `_isNaN(new Number(NaN))` should return `true` [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L95-99)]
|
||||
* `_.reduceRight` should pass correct callback arguments when iterating objects [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L106-116)]
|
||||
* `_.size` should return the `length` of string values [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L121-127)]
|
||||
@@ -182,6 +184,13 @@ git submodule update --init
|
||||
|
||||
## Changelog
|
||||
|
||||
### <sup>v0.2.1</sup>
|
||||
|
||||
* Adjusted the Lo-Dash export order for r.js
|
||||
* Ensured `_.groupBy` only adds values to own, not inherited, properties
|
||||
* Made `_.bind` follow ES5 spec to support a popular Backbone.js pattern
|
||||
* Simplified `_.bind`, `_.flatten`, `_.groupBy`, `_.man`, and `_.min`
|
||||
|
||||
### <sup>v0.2.0</sup>
|
||||
|
||||
* Added custom build options
|
||||
@@ -194,6 +203,7 @@ git submodule update --init
|
||||
* Added `_.partial` method
|
||||
* Commented the `iterationFactory` options object
|
||||
* Ensured `_.max` and `_.min` support extremely large arrays
|
||||
* Ensuredg `_.throttle` works in a tight loop
|
||||
* Fixed IE < 9 `[DontEnum]` bug and Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1’s prototype property iteration bug
|
||||
* Inlined `_.isFunction` calls.
|
||||
* Made `_.debounce`’ed functions match `_.throttle`’ed functions’ return value behavior
|
||||
|
||||
182
doc/README.md
182
doc/README.md
@@ -1,4 +1,4 @@
|
||||
# Lo-Dash <sup>v0.2.0</sup>
|
||||
# Lo-Dash <sup>v0.2.1</sup>
|
||||
|
||||
<!-- div -->
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_value"></a>`_(value)`
|
||||
<a href="#_value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L139 "View in source") [Ⓣ][1]
|
||||
<a href="#_value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L115 "View in source") [Ⓣ][1]
|
||||
|
||||
The `lodash` function.
|
||||
|
||||
@@ -145,7 +145,7 @@ The `lodash` function.
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_version"></a>`_.VERSION`
|
||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3125 "View in source") [Ⓣ][1]
|
||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3089 "View in source") [Ⓣ][1]
|
||||
|
||||
*(String)*: The semantic version number.
|
||||
|
||||
@@ -157,7 +157,7 @@ The `lodash` function.
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_aftern-func"></a>`_.after(n, func)`
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1647 "View in source") [Ⓣ][1]
|
||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1618 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that is restricted to executing only after it is called `n` times.
|
||||
|
||||
@@ -185,7 +185,7 @@ _.forEach(notes, function(note) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_bindfunc--arg1-arg2-"></a>`_.bind(func [, arg1, arg2, ...])`
|
||||
<a href="#_bindfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1698 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1669 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. Lazy defined methods may be bound by passing the object they are bound to as `func` and the method name as `thisArg`.
|
||||
|
||||
@@ -232,7 +232,7 @@ func();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_bindallobject--methodname1-methodname2-"></a>`_.bindAll(object [, methodName1, methodName2, ...])`
|
||||
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1776 "View in source") [Ⓣ][1]
|
||||
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1740 "View in source") [Ⓣ][1]
|
||||
|
||||
Binds methods on the `object` to the object, overwriting the non-bound method. If no method names are provided, all the function properties of the `object` will be bound.
|
||||
|
||||
@@ -264,7 +264,7 @@ jQuery('#lodash_button').on('click', buttonView.onClick);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_chainvalue"></a>`_.chain(value)`
|
||||
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3077 "View in source") [Ⓣ][1]
|
||||
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3041 "View in source") [Ⓣ][1]
|
||||
|
||||
Wraps the value in a `lodash` chainable object.
|
||||
|
||||
@@ -298,7 +298,7 @@ var youngest = _.chain(stooges)
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_clonevalue"></a>`_.clone(value)`
|
||||
<a href="#_clonevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2102 "View in source") [Ⓣ][1]
|
||||
<a href="#_clonevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2066 "View in source") [Ⓣ][1]
|
||||
|
||||
Create a shallow clone of the `value`. Any nested objects or arrays will be assigned by reference and not cloned.
|
||||
|
||||
@@ -322,7 +322,7 @@ _.clone({ 'name': 'moe' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_compactarray"></a>`_.compact(array)`
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L903 "View in source") [Ⓣ][1]
|
||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L879 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
|
||||
|
||||
@@ -346,7 +346,7 @@ _.compact([0, 1, false, 2, '', 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
|
||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1808 "View in source") [Ⓣ][1]
|
||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1772 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that is the composition of the passed functions, where each function consumes the return value of the function that follows. In math terms, composing thefunctions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
||||
|
||||
@@ -373,7 +373,7 @@ welcome('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_containscollection-target"></a>`_.contains(collection, target)`
|
||||
<a href="#_containscollection-target">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L544 "View in source") [Ⓣ][1]
|
||||
<a href="#_containscollection-target">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L520 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a given `target` value is present in a `collection` using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -398,7 +398,7 @@ _.contains([1, 2, 3], 3);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_debouncefunc-wait-immediate"></a>`_.debounce(func, wait, immediate)`
|
||||
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1841 "View in source") [Ⓣ][1]
|
||||
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1805 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
|
||||
|
||||
@@ -424,7 +424,7 @@ jQuery(window).on('resize', lazyLayout);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_defaultsobject--defaults1-defaults2-"></a>`_.defaults(object [, defaults1, defaults2, ...])`
|
||||
<a href="#_defaultsobject--defaults1-defaults2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2125 "View in source") [Ⓣ][1]
|
||||
<a href="#_defaultsobject--defaults1-defaults2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2089 "View in source") [Ⓣ][1]
|
||||
|
||||
Assigns missing properties in `object` with default values from the defaults objects. As soon as a property is set, additional defaults of the same property will be ignored.
|
||||
|
||||
@@ -450,7 +450,7 @@ _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'lots' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_deferfunc--arg1-arg2-"></a>`_.defer(func [, arg1, arg2, ...])`
|
||||
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1906 "View in source") [Ⓣ][1]
|
||||
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1870 "View in source") [Ⓣ][1]
|
||||
|
||||
Defers executing the `func` function until the current call stack has cleared. Additional arguments are passed to `func` when it is invoked.
|
||||
|
||||
@@ -475,7 +475,7 @@ _.defer(function() { alert('deferred'); });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_delayfunc-wait--arg1-arg2-"></a>`_.delay(func, wait [, arg1, arg2, ...])`
|
||||
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1886 "View in source") [Ⓣ][1]
|
||||
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1850 "View in source") [Ⓣ][1]
|
||||
|
||||
Executes the `func` function after `wait` milliseconds. Additional arguments are passed to `func` when it is invoked.
|
||||
|
||||
@@ -502,7 +502,7 @@ _.delay(log, 1000, 'logged later');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_differencearray--array1-array2-"></a>`_.difference(array [, array1, array2, ...])`
|
||||
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L932 "View in source") [Ⓣ][1]
|
||||
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L908 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new array of `array` values not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -527,7 +527,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_escapestring"></a>`_.escape(string)`
|
||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2773 "View in source") [Ⓣ][1]
|
||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2737 "View in source") [Ⓣ][1]
|
||||
|
||||
Escapes a string for insertion into HTML, replacing `&`, `<`, `"`, `'`, and `/` characters.
|
||||
|
||||
@@ -551,7 +551,7 @@ _.escape('Curly, Larry & Moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_everycollection-callback--thisarg"></a>`_.every(collection, callback [, thisArg])`
|
||||
<a href="#_everycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L568 "View in source") [Ⓣ][1]
|
||||
<a href="#_everycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L544 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -577,7 +577,7 @@ _.every([true, 1, null, 'yes'], Boolean);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_extendobject--source1-source2-"></a>`_.extend(object [, source1, source2, ...])`
|
||||
<a href="#_extendobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2144 "View in source") [Ⓣ][1]
|
||||
<a href="#_extendobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2108 "View in source") [Ⓣ][1]
|
||||
|
||||
Copies enumerable properties from the source objects to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
||||
|
||||
@@ -602,7 +602,7 @@ _.extend({ 'name': 'moe' }, { 'age': 40 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_filtercollection-callback--thisarg"></a>`_.filter(collection, callback [, thisArg])`
|
||||
<a href="#_filtercollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L589 "View in source") [Ⓣ][1]
|
||||
<a href="#_filtercollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L565 "View in source") [Ⓣ][1]
|
||||
|
||||
Examines each value in a `collection`, returning an array of all values the `callback` returns truthy for. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -628,7 +628,7 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; })
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_findcollection-callback--thisarg"></a>`_.find(collection, callback [, thisArg])`
|
||||
<a href="#_findcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L611 "View in source") [Ⓣ][1]
|
||||
<a href="#_findcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L587 "View in source") [Ⓣ][1]
|
||||
|
||||
Examines each value in a `collection`, returning the first one the `callback` returns truthy for. The function returns as soon as it finds an acceptable value, and does not iterate over the entire `collection`. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -654,7 +654,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_firstarray--n-guard"></a>`_.first(array [, n, guard])`
|
||||
<a href="#_firstarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L965 "View in source") [Ⓣ][1]
|
||||
<a href="#_firstarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L941 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the first value of the `array`. Pass `n` to return the first `n` values of the `array`.
|
||||
|
||||
@@ -680,7 +680,7 @@ _.first([5, 4, 3, 2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_flattenarray-shallow"></a>`_.flatten(array, shallow)`
|
||||
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L987 "View in source") [Ⓣ][1]
|
||||
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L963 "View in source") [Ⓣ][1]
|
||||
|
||||
Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level.
|
||||
|
||||
@@ -708,7 +708,7 @@ _.flatten([1, [2], [3, [[4]]]], true);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_foreachcollection-callback--thisarg"></a>`_.forEach(collection, callback [, thisArg])`
|
||||
<a href="#_foreachcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L637 "View in source") [Ⓣ][1]
|
||||
<a href="#_foreachcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L613 "View in source") [Ⓣ][1]
|
||||
|
||||
Iterates over a `collection`, executing the `callback` for each value in the `collection`. The `callback` is bound to the `thisArg` value, if one is passed. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -737,7 +737,7 @@ _([1, 2, 3]).forEach(function(num) { alert(num); }).join(',');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_functionsobject"></a>`_.functions(object)`
|
||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2161 "View in source") [Ⓣ][1]
|
||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2125 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a sorted array of the properties, own and inherited, of `object` that have function values.
|
||||
|
||||
@@ -761,7 +761,7 @@ _.functions(_);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_groupbyarray-callback--thisarg"></a>`_.groupBy(array, callback [, thisArg])`
|
||||
<a href="#_groupbyarray-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1029 "View in source") [Ⓣ][1]
|
||||
<a href="#_groupbyarray-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1005 "View in source") [Ⓣ][1]
|
||||
|
||||
Splits a `collection` into sets, grouped by the result of running each value through `callback`. The `callback` is invoked with `3` arguments; *(value, index, array)*. The `callback` argument may also be the name of a property to group by.
|
||||
|
||||
@@ -793,7 +793,7 @@ _.groupBy(['one', 'two', 'three'], 'length');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_hasobject-property"></a>`_.has(object, property)`
|
||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2184 "View in source") [Ⓣ][1]
|
||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2148 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
|
||||
|
||||
@@ -818,7 +818,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_identityvalue"></a>`_.identity(value)`
|
||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2800 "View in source") [Ⓣ][1]
|
||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2764 "View in source") [Ⓣ][1]
|
||||
|
||||
This function returns the first argument passed to it. Note: It is used throughout Lo-Dash as a default callback.
|
||||
|
||||
@@ -843,7 +843,7 @@ moe === _.identity(moe);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_indexofarray-value--issortedfalse"></a>`_.indexOf(array, value [, isSorted=false])`
|
||||
<a href="#_indexofarray-value--issortedfalse">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1114 "View in source") [Ⓣ][1]
|
||||
<a href="#_indexofarray-value--issortedfalse">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1090 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster binary search.
|
||||
|
||||
@@ -869,7 +869,7 @@ _.indexOf([1, 2, 3], 2);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_initialarray--n-guard"></a>`_.initial(array [, n, guard])`
|
||||
<a href="#_initialarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1148 "View in source") [Ⓣ][1]
|
||||
<a href="#_initialarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1124 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets all but the last value of the `array`. Pass `n` to exclude the last `n` values from the result.
|
||||
|
||||
@@ -895,7 +895,7 @@ _.initial([5, 4, 3, 2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
|
||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1166 "View in source") [Ⓣ][1]
|
||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1142 "View in source") [Ⓣ][1]
|
||||
|
||||
Computes the intersection of all the passed-in arrays.
|
||||
|
||||
@@ -919,7 +919,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_invokearray-methodname--arg1-arg2-"></a>`_.invoke(array, methodName [, arg1, arg2, ...])`
|
||||
<a href="#_invokearray-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1199 "View in source") [Ⓣ][1]
|
||||
<a href="#_invokearray-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1175 "View in source") [Ⓣ][1]
|
||||
|
||||
Calls the method named by `methodName` for each value of the `collection`. Additional arguments will be passed to each invoked method.
|
||||
|
||||
@@ -945,7 +945,7 @@ _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
|
||||
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2204 "View in source") [Ⓣ][1]
|
||||
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2168 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is an `arguments` object.
|
||||
|
||||
@@ -972,7 +972,7 @@ _.isArguments([1, 2, 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isarrayvalue"></a>`_.isArray(value)`
|
||||
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2230 "View in source") [Ⓣ][1]
|
||||
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2194 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is an array.
|
||||
|
||||
@@ -999,7 +999,7 @@ _.isArray([1, 2, 3]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
|
||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2247 "View in source") [Ⓣ][1]
|
||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2211 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a boolean *(`true` or `false`)* value.
|
||||
|
||||
@@ -1023,7 +1023,7 @@ _.isBoolean(null);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isdatevalue"></a>`_.isDate(value)`
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2264 "View in source") [Ⓣ][1]
|
||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2228 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a date.
|
||||
|
||||
@@ -1047,7 +1047,7 @@ _.isDate(new Date);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_iselementvalue"></a>`_.isElement(value)`
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2281 "View in source") [Ⓣ][1]
|
||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2245 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a DOM element.
|
||||
|
||||
@@ -1071,7 +1071,7 @@ _.isElement(document.body);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2302 "View in source") [Ⓣ][1]
|
||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2266 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is empty. Arrays or strings with a length of `0` and objects with no enumerable own properties are considered "empty".
|
||||
|
||||
@@ -1098,7 +1098,7 @@ _.isEmpty({});
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isequala-b--stack"></a>`_.isEqual(a, b [, stack])`
|
||||
<a href="#_isequala-b--stack">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2336 "View in source") [Ⓣ][1]
|
||||
<a href="#_isequala-b--stack">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2300 "View in source") [Ⓣ][1]
|
||||
|
||||
Performs a deep comparison between two values to determine if they are equivalent to each other.
|
||||
|
||||
@@ -1130,7 +1130,7 @@ _.isEqual(moe, clone);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
|
||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2488 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2452 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a finite number.
|
||||
|
||||
@@ -1160,7 +1160,7 @@ _.isFinite(Infinity);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2505 "View in source") [Ⓣ][1]
|
||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2469 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a function.
|
||||
|
||||
@@ -1184,7 +1184,7 @@ _.isFunction(''.concat);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnanvalue"></a>`_.isNaN(value)`
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2556 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2520 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is `NaN`. Note: this is not the same as native `isNaN`, which will return true for `undefined` and other values. See http://es5.github.com/#x15.1.2.4.
|
||||
|
||||
@@ -1217,7 +1217,7 @@ _.isNaN(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnullvalue"></a>`_.isNull(value)`
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2578 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2542 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is `null`.
|
||||
|
||||
@@ -1244,7 +1244,7 @@ _.isNull(undefined);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2595 "View in source") [Ⓣ][1]
|
||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2559 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a number.
|
||||
|
||||
@@ -1268,7 +1268,7 @@ _.isNumber(8.4 * 5;
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isobjectvalue"></a>`_.isObject(value)`
|
||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2526 "View in source") [Ⓣ][1]
|
||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2490 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)*`, and `new String('')`)
|
||||
|
||||
@@ -1295,7 +1295,7 @@ _.isObject(1);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
|
||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2612 "View in source") [Ⓣ][1]
|
||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2576 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a regular expression.
|
||||
|
||||
@@ -1319,7 +1319,7 @@ _.isRegExp(/moe/);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isstringvalue"></a>`_.isString(value)`
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2629 "View in source") [Ⓣ][1]
|
||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2593 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is a string.
|
||||
|
||||
@@ -1343,7 +1343,7 @@ _.isString('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2646 "View in source") [Ⓣ][1]
|
||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2610 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if a `value` is `undefined`.
|
||||
|
||||
@@ -1367,7 +1367,7 @@ _.isUndefined(void 0);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_keysobject"></a>`_.keys(object)`
|
||||
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2663 "View in source") [Ⓣ][1]
|
||||
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2627 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces an array of the `object`'s enumerable own property names.
|
||||
|
||||
@@ -1391,7 +1391,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_lastarray--n-guard"></a>`_.last(array [, n, guard])`
|
||||
<a href="#_lastarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1229 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1205 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the last value of the `array`. Pass `n` to return the lasy `n` values of the `array`.
|
||||
|
||||
@@ -1417,7 +1417,7 @@ _.last([5, 4, 3, 2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_lastindexofarray-value"></a>`_.lastIndexOf(array, value)`
|
||||
<a href="#_lastindexofarray-value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1249 "View in source") [Ⓣ][1]
|
||||
<a href="#_lastindexofarray-value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1225 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -1442,7 +1442,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mapcollection-callback--thisarg"></a>`_.map(collection, callback [, thisArg])`
|
||||
<a href="#_mapcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L663 "View in source") [Ⓣ][1]
|
||||
<a href="#_mapcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L639 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new array of values by mapping each value in the `collection` through a transformation `callback`. The `callback` is bound to the `thisArg` value, if one is passed. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -1471,7 +1471,7 @@ _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_maxarray--callback-thisarg"></a>`_.max(array [, callback, thisArg])`
|
||||
<a href="#_maxarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1286 "View in source") [Ⓣ][1]
|
||||
<a href="#_maxarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1262 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is invoked with `3` arguments; *(value, index, array)*.
|
||||
|
||||
@@ -1503,7 +1503,7 @@ _.max(stooges, function(stooge) { return stooge.age; });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
|
||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1929 "View in source") [Ⓣ][1]
|
||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1893 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key.
|
||||
|
||||
@@ -1529,7 +1529,7 @@ var fibonacci = _.memoize(function(n) {
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_minarray--callback-thisarg"></a>`_.min(array [, callback, thisArg])`
|
||||
<a href="#_minarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1336 "View in source") [Ⓣ][1]
|
||||
<a href="#_minarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1308 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is invoked with `3` arguments; *(value, index, array)*.
|
||||
|
||||
@@ -1555,7 +1555,7 @@ _.min([10, 5, 100, 2, 1000]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_mixinobject"></a>`_.mixin(object)`
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2826 "View in source") [Ⓣ][1]
|
||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2790 "View in source") [Ⓣ][1]
|
||||
|
||||
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
|
||||
|
||||
@@ -1585,7 +1585,7 @@ _('larry').capitalize();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_noconflict"></a>`_.noConflict()`
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2857 "View in source") [Ⓣ][1]
|
||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2821 "View in source") [Ⓣ][1]
|
||||
|
||||
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
|
||||
|
||||
@@ -1605,7 +1605,7 @@ var lodash = _.noConflict();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_oncefunc"></a>`_.once(func)`
|
||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1955 "View in source") [Ⓣ][1]
|
||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1919 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that is restricted to one execution. Repeat calls to the function will return the value of the first call.
|
||||
|
||||
@@ -1631,7 +1631,7 @@ initialize();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_partialfunc--arg1-arg2-"></a>`_.partial(func [, arg1, arg2, ...])`
|
||||
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1988 "View in source") [Ⓣ][1]
|
||||
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1952 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the partially applied function. This method is similar `bind`, except it does **not** alter the `this` binding.
|
||||
|
||||
@@ -1658,7 +1658,7 @@ hi('moe');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pickobject--prop1-prop2-"></a>`_.pick(object [, prop1, prop2, ...])`
|
||||
<a href="#_pickobject--prop1-prop2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2685 "View in source") [Ⓣ][1]
|
||||
<a href="#_pickobject--prop1-prop2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2649 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an object composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names.
|
||||
|
||||
@@ -1683,7 +1683,7 @@ _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_pluckcollection-property"></a>`_.pluck(collection, property)`
|
||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L685 "View in source") [Ⓣ][1]
|
||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L661 "View in source") [Ⓣ][1]
|
||||
|
||||
Retrieves the value of a specified property from all values in a `collection`.
|
||||
|
||||
@@ -1714,7 +1714,7 @@ _.pluck(stooges, 'name');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_rangestart0-end--step1"></a>`_.range([start=0], end [, step=1])`
|
||||
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1394 "View in source") [Ⓣ][1]
|
||||
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1365 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `stop`. This method is a port of Python's `range()` function. See http://docs.python.org/library/functions.html#range.
|
||||
|
||||
@@ -1752,7 +1752,7 @@ _.range(0);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_reducecollection-callback--accumulator-thisarg"></a>`_.reduce(collection, callback [, accumulator, thisArg])`
|
||||
<a href="#_reducecollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L715 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducecollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L691 "View in source") [Ⓣ][1]
|
||||
|
||||
Boils down a `collection` to a single value. The initial state of the reduction is `accumulator` and each successive step of it should be returned by the `callback`. The `callback` is bound to the `thisArg` value, if one is passed. The `callback` is invoked with `4` arguments; for arrays they are *(accumulator, value, index, array)* and for objects they are *(accumulator, value, key, object)*.
|
||||
|
||||
@@ -1779,7 +1779,7 @@ var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_reducerightcollection-callback--accumulator-thisarg"></a>`_.reduceRight(collection, callback [, accumulator, thisArg])`
|
||||
<a href="#_reducerightcollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L755 "View in source") [Ⓣ][1]
|
||||
<a href="#_reducerightcollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L731 "View in source") [Ⓣ][1]
|
||||
|
||||
The right-associative version of `_.reduce`. The `callback` is bound to the `thisArg` value, if one is passed. The `callback` is invoked with `4` arguments; for arrays they are *(accumulator, value, index, array)* and for objects they are *(accumulator, value, key, object)*.
|
||||
|
||||
@@ -1807,7 +1807,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_rejectcollection-callback--thisarg"></a>`_.reject(collection, callback [, thisArg])`
|
||||
<a href="#_rejectcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L808 "View in source") [Ⓣ][1]
|
||||
<a href="#_rejectcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L784 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.filter`, this method returns the values of a `collection` that `callback` does **not** return truthy for. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -1833,7 +1833,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_restarray--n-guard"></a>`_.rest(array [, n, guard])`
|
||||
<a href="#_restarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1430 "View in source") [Ⓣ][1]
|
||||
<a href="#_restarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1401 "View in source") [Ⓣ][1]
|
||||
|
||||
The opposite of `_.initial`, this method gets all but the first value of the `array`. Pass `n` to exclude the first `n` values from the result.
|
||||
|
||||
@@ -1859,7 +1859,7 @@ _.rest([5, 4, 3, 2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_resultobject-property"></a>`_.result(object, property)`
|
||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2887 "View in source") [Ⓣ][1]
|
||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2851 "View in source") [Ⓣ][1]
|
||||
|
||||
Resolves the value of `property` on `object`. If the property is a function it will be invoked and its result returned, else the property value is returned.
|
||||
|
||||
@@ -1894,7 +1894,7 @@ _.result(object, 'stuff');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_shufflearray"></a>`_.shuffle(array)`
|
||||
<a href="#_shufflearray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1448 "View in source") [Ⓣ][1]
|
||||
<a href="#_shufflearray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1419 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
||||
|
||||
@@ -1918,7 +1918,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sizevalue"></a>`_.size(value)`
|
||||
<a href="#_sizevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2724 "View in source") [Ⓣ][1]
|
||||
<a href="#_sizevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2688 "View in source") [Ⓣ][1]
|
||||
|
||||
Gets the size of a `value` by returning `value.length` if `value` is a string or array, or the number of own enumerable properties if `value` is an object.
|
||||
|
||||
@@ -1948,7 +1948,7 @@ _.size('curly');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_somecollection-callback--thisarg"></a>`_.some(collection, callback [, thisArg])`
|
||||
<a href="#_somecollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L832 "View in source") [Ⓣ][1]
|
||||
<a href="#_somecollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L808 "View in source") [Ⓣ][1]
|
||||
|
||||
Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||
|
||||
@@ -1974,7 +1974,7 @@ _.some([null, 0, 'yes', false]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sortbyarray-callback--thisarg"></a>`_.sortBy(array, callback [, thisArg])`
|
||||
<a href="#_sortbyarray-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1071 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortbyarray-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1047 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new sorted array, ranked in ascending order by the results of running each value of a `collection` through `callback`. The `callback` is invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*. The `callback` argument may also be the name of a property to sort by *(e.g. 'length')*.
|
||||
|
||||
@@ -2003,7 +2003,7 @@ _.sortBy([1, 2, 3, 4, 5, 6], function(num) { return this.sin(num); }, Math);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_sortedindexarray-value--callback"></a>`_.sortedIndex(array, value [, callback])`
|
||||
<a href="#_sortedindexarray-value--callback">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1482 "View in source") [Ⓣ][1]
|
||||
<a href="#_sortedindexarray-value--callback">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1453 "View in source") [Ⓣ][1]
|
||||
|
||||
Uses a binary search to determine the smallest index at which the `value` should be inserted into the `collection` in order to maintain the sort order of the `collection`. If `callback` is passed, it will be executed for each value in the `collection` to compute their sort ranking. The `callback` is invoked with `1` argument; *(value)*.
|
||||
|
||||
@@ -2029,7 +2029,7 @@ _.sortedIndex([10, 20, 30, 40, 50], 35);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2752 "View in source") [Ⓣ][1]
|
||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2716 "View in source") [Ⓣ][1]
|
||||
|
||||
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The primary purpose of this method is to "tap into" a method chain, in order to performoperations on intermediate results within the chain.
|
||||
|
||||
@@ -2059,7 +2059,7 @@ _.chain([1,2,3,200])
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
|
||||
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2947 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2911 "View in source") [Ⓣ][1]
|
||||
|
||||
A JavaScript micro-templating method, similar to John Resig's implementation. Lo-Dash templating handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
|
||||
|
||||
@@ -2119,7 +2119,7 @@ _.template('<%= data.hasWith %>', { 'hasWith': 'no' }, { 'variable': 'data' });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
|
||||
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2024 "View in source") [Ⓣ][1]
|
||||
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1988 "View in source") [Ⓣ][1]
|
||||
|
||||
Creates a new function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once, `func` will also be called on the trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
||||
|
||||
@@ -2144,7 +2144,7 @@ jQuery(window).on('scroll', throttled);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
|
||||
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3024 "View in source") [Ⓣ][1]
|
||||
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2988 "View in source") [Ⓣ][1]
|
||||
|
||||
Executes the `callback` function `n` times. The `callback` is invoked with `1` argument; *(index)*.
|
||||
|
||||
@@ -2166,7 +2166,7 @@ _.times(3, function() { genie.grantWish(); });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_toarraycollection"></a>`_.toArray(collection)`
|
||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L851 "View in source") [Ⓣ][1]
|
||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L827 "View in source") [Ⓣ][1]
|
||||
|
||||
Converts the `collection`, into an array. Useful for converting the `arguments` object.
|
||||
|
||||
@@ -2190,7 +2190,7 @@ Converts the `collection`, into an array. Useful for converting the `arguments`
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
|
||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1515 "View in source") [Ⓣ][1]
|
||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1486 "View in source") [Ⓣ][1]
|
||||
|
||||
Computes the union of the passed-in arrays.
|
||||
|
||||
@@ -2214,7 +2214,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_uniqarray--issortedfalse-callback"></a>`_.uniq(array [, isSorted=false, callback])`
|
||||
<a href="#_uniqarray--issortedfalse-callback">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1550 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqarray--issortedfalse-callback">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1521 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each value of `array` is passed through a transformation `callback` before uniqueness is computed. The `callback` is invoked with `3` arguments; *(value, index, array)*.
|
||||
|
||||
@@ -2240,7 +2240,7 @@ _.uniq([1, 2, 1, 3, 1, 4]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
|
||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3047 "View in source") [Ⓣ][1]
|
||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3011 "View in source") [Ⓣ][1]
|
||||
|
||||
Generates a unique id. If `prefix` is passed, the id will be appended to it.
|
||||
|
||||
@@ -2264,7 +2264,7 @@ _.uniqueId('contact_');
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_valuescollection"></a>`_.values(collection)`
|
||||
<a href="#_valuescollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L879 "View in source") [Ⓣ][1]
|
||||
<a href="#_valuescollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L855 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces an array of enumerable own property values of the `collection`.
|
||||
|
||||
@@ -2288,7 +2288,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_withoutarray--value1-value2-"></a>`_.without(array [, value1, value2, ...])`
|
||||
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1585 "View in source") [Ⓣ][1]
|
||||
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1556 "View in source") [Ⓣ][1]
|
||||
|
||||
Produces a new array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
||||
|
||||
@@ -2313,7 +2313,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_wrapfunc-wrapper--arg1-arg2-"></a>`_.wrap(func, wrapper [, arg1, arg2, ...])`
|
||||
<a href="#_wrapfunc-wrapper--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2076 "View in source") [Ⓣ][1]
|
||||
<a href="#_wrapfunc-wrapper--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2040 "View in source") [Ⓣ][1]
|
||||
|
||||
Create a new function that passes the `func` function to the `wrapper` function as its first argument. Additional arguments are appended to those passed to the `wrapper` function.
|
||||
|
||||
@@ -2343,7 +2343,7 @@ hello();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
|
||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1615 "View in source") [Ⓣ][1]
|
||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1586 "View in source") [Ⓣ][1]
|
||||
|
||||
Merges together the values of each of the arrays with the value at the corresponding position. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
||||
|
||||
@@ -2374,7 +2374,7 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypechain"></a>`_.prototype.chain()`
|
||||
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3095 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3059 "View in source") [Ⓣ][1]
|
||||
|
||||
Extracts the value from a wrapped chainable object.
|
||||
|
||||
@@ -2395,7 +2395,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_prototypevalue"></a>`_.prototype.value()`
|
||||
<a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3112 "View in source") [Ⓣ][1]
|
||||
<a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3076 "View in source") [Ⓣ][1]
|
||||
|
||||
Extracts the value from a wrapped chainable object.
|
||||
|
||||
@@ -2423,7 +2423,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatesettings"></a>`_.templateSettings`
|
||||
<a href="#_templatesettings">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L167 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatesettings">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L143 "View in source") [Ⓣ][1]
|
||||
|
||||
*(Object)*: By default, Lo-Dash uses ERB-style template delimiters, change the following template settings to use alternative delimiters.
|
||||
|
||||
@@ -2435,7 +2435,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
|
||||
<a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L176 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L152 "View in source") [Ⓣ][1]
|
||||
|
||||
*(RegExp)*: Used to detect `data` property values to be HTML-escaped.
|
||||
|
||||
@@ -2447,7 +2447,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
|
||||
<a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L185 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L161 "View in source") [Ⓣ][1]
|
||||
|
||||
*(RegExp)*: Used to detect code to be evaluated.
|
||||
|
||||
@@ -2459,7 +2459,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
|
||||
<a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L194 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L170 "View in source") [Ⓣ][1]
|
||||
|
||||
*(RegExp)*: Used to detect `data` property values to inject.
|
||||
|
||||
@@ -2471,7 +2471,7 @@ _([1, 2, 3]).value();
|
||||
<!-- div -->
|
||||
|
||||
### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
|
||||
<a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L203 "View in source") [Ⓣ][1]
|
||||
<a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L179 "View in source") [Ⓣ][1]
|
||||
|
||||
*(String)*: Used to reference the data object in the template text.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <sup>v0.2.0</sup>',
|
||||
'title' => 'Lo-Dash <sup>v0.2.1</sup>',
|
||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||
));
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Lo-Dash v0.2.0 <http://lodash.com>
|
||||
* Lo-Dash v0.2.1 <http://lodash.com>
|
||||
* Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
* <http://documentcloud.github.com/underscore>
|
||||
@@ -3086,7 +3086,7 @@
|
||||
* @memberOf _
|
||||
* @type String
|
||||
*/
|
||||
lodash.VERSION = '0.2.0';
|
||||
lodash.VERSION = '0.2.1';
|
||||
|
||||
// assign static methods
|
||||
lodash.after = after;
|
||||
|
||||
54
lodash.min.js
vendored
54
lodash.min.js
vendored
@@ -1,30 +1,30 @@
|
||||
/*!
|
||||
Lo-Dash 0.2.0 lodash.com/license
|
||||
Lo-Dash 0.2.1 lodash.com/license
|
||||
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
|
||||
*/
|
||||
;(function(u,m){"use strict";function R(a){return"[object Arguments]"==h.call(a)}function b(a){return new p(a)}function p(a){if(a&&a._wrapped)return a;this._wrapped=a}function j(){for(var a,c,d,q=-1,b=arguments.length,e={e:"",f:"",k:"",q:"",c:{d:"",m:"++l<m"},o:{d:""}};++q<b;)for(c in a=arguments[q],a)d=(d=a[c])==n?"":d,/d|m|j/.test(c)?("string"==typeof d&&(d={b:d,n:d}),e.c[c]=d.b,e.o[c]=d.n):e[c]=d;a=e.a,c=e.c,d=e.o;var q=/^[^,]+/.exec(a)[0],b=d.m,g=/\S+$/.exec(b||q)[0];e.g=q,e.i=H,e.h="j.call("+
|
||||
g+",l)",e.l=g,e.p=da,e.r=e.r!==o,e.f||(e.f="if(!"+q+")return r");if("n"==q||!c.j)e.c=n;return b||(d.m="l in "+g),Function("b,c,i,j,k,o,v,y,z,h,A",'"use strict";return function('+a+"){"+ta(e)+"}")(I,v,r,s,ea,J,K,h,l,o)}function ua(a,c){return w[c]}function va(a){return"\\"+wa[a]}function fa(){}function xa(a,c){var d=w.length;return w[d]="'+((__t=("+c+"))==null?'':_['escape'](__t))+'",S+d}function ya(a,c){var d=w.length;return w[d]="'+((__t=("+c+"))==null?'':__t)+'",S+d}function za(a,c){var d=w.length
|
||||
;return w[d]="';"+c+";__p+='",S+d}function ga(a,c,d,q){if(!a)return d;var b=a.length,e=3>arguments.length;q&&(c=v(c,q));if(b===+b){for(b&&e&&(d=a[--b]);b--;)d=c(d,a[b],b,a);return d}var g=T(a);for((b=g.length)&&e&&(d=a[g[--b]]);b--;)e=g[b],d=c(d,a[e],e,a);return d}function U(a,c,d){return c==m||d?a[0]:k.call(a,0,c)}function ha(a,c){for(var d,b=-1,f=a.length,e=[];++b<f;)d=a[b],V(d)?B.apply(e,c?d:ha(d)):e.push(d);return e}function x(a,c,d){var b;if(!a)return-1;if(d)return d=ia(a,c),a[d]===c?d:-1;d=0
|
||||
;for(b=a.length;d<b;d++)if(a[d]===c)return d;return-1}function ja(a,c,d){var b=-Infinity,f=-1,e=a.length,g=b;if(c)d&&(c=v(c,d));else{if(a[0]===+a[0]&&e<=L)try{return Math.max.apply(Math,a)}catch(i){}if(!a.length)return g}for(;++f<e;)d=c?c(a[f],f,a):a[f],d>b&&(b=d,g=a[f]);return g}function ka(a,c,d){return k.call(a,c==m||d?1:c)}function ia(a,c,d){var b,f=0,e=a.length;for(d&&(c=d(c));f<e;)b=f+e>>1,(d?d(a[b]):a[b])<c?f=b+1:e=b;return f}function la(a,c,d){for(var b,f=-1,e=a.length,g=[],i=[];++f<e;)if(
|
||||
b=d?d(a[f]):a[f],c?!f||i[i.length-1]!==b:0>x(i,b))i.push(b),g.push(a[f]);return g}function v(a,c){function d(){var i=arguments,h=this instanceof d,j=c;return f||(a=c[b]),g&&(i.length&&(e.length=g,B.apply(e,i)),i=e),h&&(fa.prototype=a.prototype,j=new fa),i=i.length?a.apply(j,i):a.call(j),e.length=g,h?J[typeof i]&&i!==n?i:j:i}var b,f=h.call(a)==r;if(f){if(y)return y.call.apply(y,arguments)}else b=c,c=a;var e=k.call(arguments,2),g=e.length;return d}function M(a,c,d){d||(d=[]);if(a===c)return 0!==a||1/
|
||||
a==1/c;if(a==m||c==m)return a===c;a.s&&(a=a._wrapped),c.s&&(c=c._wrapped);if(a.isEqual&&h.call(a.isEqual)==r)return a.isEqual(c);if(c.isEqual&&h.call(c.isEqual)==r)return c.isEqual(a);var b=h.call(a);if(b!=h.call(c))return o;switch(b){case K:return a==""+c;case N:return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case ma:case na:return+a==+c;case oa:return a.source==c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return o;for(var f=
|
||||
d.length;f--;)if(d[f]==a)return l;var f=-1,e=l,g=0;d.push(a);if(b==I){if(g=a.length,e=g==c.length)for(;g--&&(e=M(a[g],c[g],d)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return o;for(var i in a)if(s.call(a,i)&&(g++,!(e=s.call(c,i)&&M(a[i],c[i],d))))break;if(e){for(i in c)if(s.call(c,i)&&!(g--))break;e=!g}if(e&&H)for(;7>++f&&(i=da[f],!s.call(a,i)||!!(e=s.call(c,i)&&M(a[i],c[i],d))););}return d.pop(),e}function ea(a){return a}function pa(a){C(O(a),function(c){var d=
|
||||
b[c]=a[c];p.prototype[c]=function(){var a=[this._wrapped];return arguments.length&&B.apply(a,arguments),a=1==a.length?d.call(b,a[0]):d.apply(b,a),this.s&&(a=new p(a),a.s=l),a}})}var l=!0,n=null,o=!1,W="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(u=global),exports),L=5e4;try{(function(){L=arguments.length}).apply(n,Array(L))}catch(Ga){}var wa={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},H=!{valueOf:0}.propertyIsEnumerable
|
||||
("valueOf"),Aa=0,J={"boolean":o,"function":l,object:l,number:o,string:o,"undefined":o},Ba=u._,z=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ca=/__token__(\d+)/g,Da=/['\n\r\t\u2028\u2029\\]/g,da="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),S="__token__",w=[],I="[object Array]",ma="[object Boolean]",na="[object Date]",r="[object Function]",N="[object Number]",oa="[object RegExp]"
|
||||
,K="[object String]",A=Array.prototype,D=Object.prototype,X=A.concat,s=D.hasOwnProperty,B=A.push,k=A.slice,h=D.toString,y=z.test(y=k.bind)&&/\n|Opera/.test(y+h.call(u.opera))&&y,E=z.test(E=Array.isArray)&&E,Ea=u.isFinite,Y=z.test(Y=Object.keys)&&Y,Fa=u.clearTimeout,P=u.setTimeout;b.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"object"};var ta=Function("n","var __p;with(n){__p='var l,r';if(k){__p+='='+k};__p+=';'+f+';'+q+';';if(c){__p+='var m='+g+'.length;l=-1;';if(o){__p+='if(m===+m){'};__p+=''+c['d']+';while('+c['m']+'){'+c['j']+'}';if(o){__p+='}'}}if(o){if(c){__p+='else{'}if(!i){__p+='var s=typeof '+l+'==\\'function\\';'};__p+=''+o['d']+';for('+o['m']+'){';if(i){if(r){__p+='if('+h+'){'};__p+=''+o['j']+';';if(r){__p+='}'}}else{__p+='if(!(s&&l==\\'prototype\\')';if(r){__p+='&&'+h};__p+='){'+o['j']+'}'};__p+='}';if(i){__p+='var g='+l+'.constructor;';for(var k=0;k<7;k++){__p+='l=\\''+p[k]+'\\';if(';if(p[k]=='constructor'){__p+='!(g&&g.prototype==='+l+')&&'};__p+=''+h+'){'+o['j']+'}'}}if(c){__p+='}'}};__p+=''+e+';return r'}return __p"
|
||||
),t={a:"f,d,x",k:"f",q:"if(!d){d=k}else if(x){d=c(d,x)}",j:"d(f[l],l,f)"},Z={k:"z",j:"if(!d(f[l],l,f))return!r"},$={a:"n",k:"n",q:"for(var t,u=1,m=arguments.length;u<m;u++){t=arguments[u];"+(H?"if(t){":""),m:"l in t",r:o,j:"n[l]=t[l]",e:(H?"}":"")+"}"},F={k:"[]",j:"d(f[l],l,f)&&r.push(f[l])"},G={k:"",f:"if(!f)return[]",d:{b:"r=Array(m)",n:"r=[]"},j:{b:"r[l]=d(f[l],l,f)",n:"r.push(d(f[l],l,f))"}},z=j({a:"f,w",k:"h",j:"if(f[l]===w)return z"}),aa=j(t,Z),D=j(t,F),qa=j(t,{j:"if(d(f[l],l,f))return f[l]"
|
||||
}),C=j(t,{q:"if(x)d=c(d,x)"}),ba=j(t,G),Q=j(G,{a:"f,q",j:{b:"r[l]=f[l][q]",n:"r.push(f[l][q])"}}),ca=j({a:"f,d,a,x",k:"a",q:"var p=arguments.length<3;if(x)d=c(d,x)",d:{b:"if(p)r=f[++l]"},j:{b:"r=d(r,f[l],l,f)",n:"r=p?(p=h,f[l]):d(r,f[l],l,f)"}}),F=j(t,F,{j:"!"+F.j}),t=j(t,Z,{k:"h",j:Z.j.replace("!","")}),ra=j(G,{a:"f",j:{b:"r[l]=f[l]",n:"r.push(f[l])"}}),G=j($,{j:"if(n[l]==A)"+$.j}),sa=j($),O=j({a:"n",k:"[]",r:o,j:"if(y.call(n[l])==i)r.push(l)",e:"r.sort()"});R(arguments)||(R=function(a){return!!
|
||||
a&&!!s.call(a,"callee")});var V=E||function(a){return h.call(a)==I},E=j({a:"B",k:"z",q:"var e=y.call(B);if(e==b||e==v)return!B.length",j:{n:"return h"}}),T=Y||j({a:"n",f:"if(!o[typeof n]||n===null)throw TypeError()",k:"[]",j:"r.push(l)"});b.VERSION="0.2.0",b.after=function(a,c){return 1>a?c():function(){if(1>--a)return c.apply(this,arguments)}},b.bind=v,b.bindAll=function(a){var c=arguments,d=1;1==c.length&&(d=0,c=O(a));for(var b=c.length;d<b;d++)a[c[d]]=v(a[c[d]],a);return a},b.chain=function(a)
|
||||
{return a=new p(a),a.s=l,a},b.clone=function(a){return J[typeof a]&&a!==n?V(a)?a.slice():sa({},a):a},b.compact=function(a){for(var c=-1,d=a.length,b=[];++c<d;)a[c]&&b.push(a[c]);return b},b.compose=function(){var a=arguments;return function(){for(var c=arguments,d=a.length;d--;)c=[a[d].apply(this,c)];return c[0]}},b.contains=z,b.debounce=function(a,c,d){function b(){i=m,d||a.apply(g,f)}var f,e,g,i;return function(){var h=d&&!i;return f=arguments,g=this,Fa(i),i=P(b,c),h&&(e=a.apply(g,f)),e}},b.defaults=
|
||||
G,b.defer=function(a){var c=k.call(arguments,1);return P(function(){return a.apply(m,c)},1)},b.delay=function(a,c){var d=k.call(arguments,2);return P(function(){return a.apply(m,d)},c)},b.difference=function(a){for(var c=-1,d=a.length,b=[],f=X.apply(b,k.call(arguments,1));++c<d;)0>x(f,a[c])&&b.push(a[c]);return b},b.escape=function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},b.every=aa,b.extend=sa,b.filter=D,b.find=
|
||||
qa,b.first=U,b.flatten=ha,b.forEach=C,b.functions=O,b.groupBy=function(a,c,d){var b,f=-1,e=h.call(c)==r,g=a.length,i={};for(e&&d&&(c=v(c,d));++f<g;)b=a[f],d=e?c(b,f,a):b[c],(s.call(i,d)?i[d]:i[d]=[]).push(b);return i},b.has=function(a,c){return s.call(a,c)},b.identity=ea,b.indexOf=x,b.initial=function(a,c,d){return k.call(a,0,-(c==m||d?1:c))},b.intersection=function(a){for(var c,d=-1,b=a.length,f=k.call(arguments,1),e=[];++d<b;)c=a[d],0>x(e,c)&&aa(f,function(a){return-1<x(a,c)})&&e.push(c);return e
|
||||
},b.invoke=function(a,c){for(var d=k.call(arguments,2),b=-1,f=a.length,e=h.call(c)==r,g=[];++b<f;)g[b]=(e?c:a[b][c]).apply(a[b],d);return g},b.isArguments=R,b.isArray=V,b.isBoolean=function(a){return a===l||a===o||h.call(a)==ma},b.isDate=function(a){return h.call(a)==na},b.isElement=function(a){return!!a&&1==a.nodeType},b.isEmpty=E,b.isEqual=M,b.isFinite=function(a){return Ea(a)&&h.call(a)==N},b.isFunction=function(a){return h.call(a)==r},b.isNaN=function(a){return h.call(a)==N&&a!=+a},b.isNull=function(
|
||||
a){return a===n},b.isNumber=function(a){return h.call(a)==N},b.isObject=function(a){return J[typeof a]&&a!==n},b.isRegExp=function(a){return h.call(a)==oa},b.isString=function(a){return h.call(a)==K},b.isUndefined=function(a){return a===m},b.keys=T,b.last=function(a,c,d){var b=a.length;return c==m||d?a[b-1]:k.call(a,-c||b)},b.lastIndexOf=function(a,c){if(!a)return-1;for(var d=a.length;d--;)if(a[d]===c)return d;return-1},b.map=ba,b.max=ja,b.memoize=function(a,c){var d={};return function(){var b=c?
|
||||
c.apply(this,arguments):arguments[0];return s.call(d,b)?d[b]:d[b]=a.apply(this,arguments)}},b.min=function(a,c,d){var b=Infinity,f=-1,e=a.length,g=b;if(c)d&&(c=v(c,d));else{if(a[0]===+a[0]&&e<=L)try{return Math.min.apply(Math,a)}catch(i){}if(!a.length)return g}for(;++f<e;)d=c?c(a[f],f,a):a[f],d<b&&(b=d,g=a[f]);return g},b.mixin=pa,b.noConflict=function(){return u._=Ba,this},b.once=function(a){var c,d=o;return function(){return d?c:(d=l,c=a.apply(this,arguments))}},b.partial=function(a){var c=k.call
|
||||
(arguments,1),d=c.length;return function(){var b;return b=arguments,b.length&&(c.length=d,B.apply(c,b)),b=1==c.length?a.call(this,c[0]):a.apply(this,c),c.length=d,b}},b.pick=function(a){for(var c,d=0,b=X.apply(A,arguments),f=b.length,e={};++d<f;)c=b[d],c in a&&(e[c]=a[c]);return e},b.pluck=Q,b.range=function(a,c,d){d||(d=1),2>arguments.length&&(c=a||0,a=0);for(var b=-1,f=Math.max(Math.ceil((c-a)/d),0),e=Array(f);++b<f;)e[b]=a,a+=d;return e},b.reduce=ca,b.reduceRight=ga,b.reject=F,b.rest=ka,b.result=
|
||||
function(a,c){if(!a)return n;var d=a[c];return h.call(d)==r?a[c]():d},b.shuffle=function(a){for(var c,d=-1,b=a.length,f=Array(b);++d<b;)c=Math.floor(Math.random()*(d+1)),f[d]=f[c],f[c]=a[d];return f},b.size=function(a){var c=h.call(a);return c==I||c==K?a.length:T(a).length},b.some=t,b.sortBy=function(a,c,d){if(h.call(c)!=r)var b=c,c=function(a){return a[b]};else d&&(c=v(c,d));return Q(ba(a,function(b,d){return{a:c(b,d,a),b:b}}).sort(function(a,c){var b=a.a,d=c.a;return b===m?1:d===m?-1:b<d?-1:b>d?1
|
||||
:0}),"b")},b.sortedIndex=ia,b.tap=function(a,c){return c(a),a},b.template=function(a,c,d){d||(d={});var h;h=b.templateSettings;var f=d.escape,e=d.evaluate,g=d.interpolate,d=d.variable;return f==n&&(f=h.escape),e==n&&(e=h.evaluate),g==n&&(g=h.interpolate),f&&(a=a.replace(f,xa)),g&&(a=a.replace(g,ya)),e&&(a=a.replace(e,za)),a="__p='"+a.replace(Da,va).replace(Ca,ua)+"';\n",w.length=0,d||(d=h.variable,a="with("+d+"||{}){"+a+"}"),a="function("+d+"){var __p,__t,__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+
|
||||
a+"return __p}",h=Function("_","return "+a)(b),c?h(c):(h.source=a,h)},b.throttle=function(a,c){function b(){i=new Date,g=m,a.apply(e,h)}var h,f,e,g,i=0;return function(){var j=new Date,k=c-(j-i);return h=arguments,e=this,0>=k?(i=j,f=a.apply(e,h)):g||(g=P(b,k)),f}},b.times=function(a,c,b){b&&(c=v(c,b));for(b=0;b<a;b++)c(b)},b.toArray=function(a){if(!a)return[];if(h.call(a.toArray)==r)return a.toArray();var b=a.length;return b===+b?k.call(a):ra(a)},b.union=function(){for(var a=-1,b=[],d=X.apply(b,arguments
|
||||
),h=d.length;++a<h;)0>x(b,d[a])&&b.push(d[a]);return b},b.uniq=la,b.uniqueId=function(a){var b=Aa++;return a?a+b:b},b.values=ra,b.without=function(a){for(var b=k.call(arguments,1),d=-1,h=a.length,f=[];++d<h;)0>x(b,a[d])&&f.push(a[d]);return f},b.wrap=function(a,b){return function(){var d=[a];return arguments.length&&B.apply(d,arguments),b.apply(this,d)}},b.zip=function(){for(var a=-1,b=ja(Q(arguments,"length")),d=Array(b);++a<b;)d[a]=Q(arguments,a);return d},b.all=aa,b.any=t,b.collect=ba,b.detect=
|
||||
qa,b.each=C,b.foldl=ca,b.foldr=ga,b.head=U,b.include=z,b.inject=ca,b.methods=O,b.select=D,b.tail=ka,b.take=U,b.unique=la,p.prototype=b.prototype,pa(b),p.prototype.chain=function(){return this.s=l,this},p.prototype.value=function(){return this._wrapped},C("pop push reverse shift sort splice unshift".split(" "),function(a){var b=A[a];p.prototype[a]=function(){var a=this._wrapped;return arguments.length?b.apply(a,arguments):b.call(a),a.length===0&&delete a[0],this.s&&(a=new p(a),a.s=l),a}}),C(["concat"
|
||||
,"join","slice"],function(a){var b=A[a];p.prototype[a]=function(){var a=this._wrapped,a=arguments.length?b.apply(a,arguments):b.call(a);return this.s&&(a=new p(a),a.s=l),a}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(u._=b,define(function(){return b})):W?"object"==typeof module&&module&&module.t==W?(module.t=b)._=b:W._=b:u._=b})(this);
|
||||
;(function(u,n){"use strict";function R(a){return"[object Arguments]"==i.call(a)}function b(a){return new p(a)}function p(a){if(a&&a._wrapped)return a;this._wrapped=a}function k(){for(var a,c,d,j=-1,b=arguments.length,e={e:"",f:"",k:"",q:"",c:{d:"",m:"++l<m"},o:{d:""}};++j<b;)for(c in a=arguments[j],a)d=(d=a[c])==o?"":d,/d|m|j/.test(c)?("string"==typeof d&&(d={b:d,n:d}),e.c[c]=d.b,e.o[c]=d.n):e[c]=d;a=e.a,c=e.c,d=e.o;var j=/^[^,]+/.exec(a)[0],b=d.m,g=/\S+$/.exec(b||j)[0];e.g=j,e.i=G,e.h="j.call("+
|
||||
g+",l)",e.l=g,e.p=ca,e.r=e.r!==q,e.f||(e.f="if(!"+j+")return r");if("n"==j||!c.j)e.c=o;return b||(d.m="l in "+g),Function("b,c,i,j,k,o,v,y,z,h,A",'"use strict";return function('+a+"){"+sa(e)+"}")(H,v,r,s,da,I,J,i,m,q)}function ta(a,c){return w[c]}function ua(a){return"\\"+va[a]}function ea(){}function wa(a,c){var d=w.length;return w[d]="'+((__t=("+c+"))==null?'':_['escape'](__t))+'",S+d}function xa(a,c){var d=w.length;return w[d]="'+((__t=("+c+"))==null?'':__t)+'",S+d}function ya(a,c){var d=w.length
|
||||
;return w[d]="';"+c+";__p+='",S+d}function fa(a,c,d,j){if(!a)return d;var b=a.length,e=3>arguments.length;j&&(c=v(c,j));if(b===+b){for(b&&e&&(d=a[--b]);b--;)d=c(d,a[b],b,a);return d}var g=T(a);for((b=g.length)&&e&&(d=a[g[--b]]);b--;)e=g[b],d=c(d,a[e],e,a);return d}function U(a,c,d){return c==n||d?a[0]:l.call(a,0,c)}function ga(a,c){for(var d,b=-1,f=a.length,e=[];++b<f;)d=a[b],V(d)?K.apply(e,c?d:ga(d)):e.push(d);return e}function x(a,c,d){var b;if(!a)return-1;if(d)return d=ha(a,c),a[d]===c?d:-1;d=0
|
||||
;for(b=a.length;d<b;d++)if(a[d]===c)return d;return-1}function ia(a,c,d){var b=-Infinity,f=-1,e=a.length,g=b;if(!c){for(;++f<e;)a[f]>g&&(g=a[f]);return g}for(d&&(c=v(c,d));++f<e;)d=c(a[f],f,a),d>b&&(b=d,g=a[f]);return g}function ja(a,c,d){return l.call(a,c==n||d?1:c)}function ha(a,c,d){var b,f=0,e=a.length;for(d&&(c=d(c));f<e;)b=f+e>>1,(d?d(a[b]):a[b])<c?f=b+1:e=b;return f}function ka(a,c,d){for(var b,f=-1,e=a.length,g=[],h=[];++f<e;)if(b=d?d(a[f]):a[f],c?!f||h[h.length-1]!==b:0>x(h,b))h.push(b),
|
||||
g.push(a[f]);return g}function v(a,c){function d(){var g=arguments,h=c;return f||(a=c[b]),e.length&&(g=g.length?L.apply(e,g):e),this instanceof d?(ea.prototype=a.prototype,h=new ea,g=a.apply(h,g),I[typeof g]&&g!==o?g:h):a.apply(h,g)}var b,f=i.call(a)==r;if(f){if(y)return y.call.apply(y,arguments)}else b=c,c=a;var e=l.call(arguments,2);return d}function M(a,c,d){d||(d=[]);if(a===c)return 0!==a||1/a==1/c;if(a==n||c==n)return a===c;a.s&&(a=a._wrapped),c.s&&(c=c._wrapped);if(a.isEqual&&i.call(a.isEqual
|
||||
)==r)return a.isEqual(c);if(c.isEqual&&i.call(c.isEqual)==r)return c.isEqual(a);var b=i.call(a);if(b!=i.call(c))return q;switch(b){case J:return a==""+c;case N:return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case la:case ma:return+a==+c;case na:return a.source==c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return q;for(var f=d.length;f--;)if(d[f]==a)return m;var f=-1,e=m,g=0;d.push(a);if(b==H){if(g=a.length,e=g==c.length)for(;g--&&
|
||||
(e=M(a[g],c[g],d)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return q;for(var h in a)if(s.call(a,h)&&(g++,!(e=s.call(c,h)&&M(a[h],c[h],d))))break;if(e){for(h in c)if(s.call(c,h)&&!(g--))break;e=!g}if(e&&G)for(;7>++f&&(h=ca[f],!s.call(a,h)||!!(e=s.call(c,h)&&M(a[h],c[h],d))););}return d.pop(),e}function da(a){return a}function oa(a){B(O(a),function(c){var d=b[c]=a[c];p.prototype[c]=function(){var a=[this._wrapped];return arguments.length&&K.apply(a,arguments),a=1==
|
||||
a.length?d.call(b,a[0]):d.apply(b,a),this.s&&(a=new p(a),a.s=m),a}})}var m=!0,o=null,q=!1,W="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(u=global),exports),va={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},G=!{valueOf:0}.propertyIsEnumerable("valueOf"),za=0,I={"boolean":q,"function":m,object:m,number:q,string:q,"undefined":q},Aa=u._,z=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g
|
||||
,".+?")+"$"),Ba=/__token__(\d+)/g,Ca=/['\n\r\t\u2028\u2029\\]/g,ca="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),S="__token__",w=[],H="[object Array]",la="[object Boolean]",ma="[object Date]",r="[object Function]",N="[object Number]",na="[object RegExp]",J="[object String]",A=Array.prototype,C=Object.prototype,L=A.concat,s=C.hasOwnProperty,K=A.push,l=A.slice,i=C.toString,y=z.test(y=l.bind)&&/\n|Opera/.test(y+i.call(u.opera))&&y,D=z.test
|
||||
(D=Array.isArray)&&D,Da=u.isFinite,X=z.test(X=Object.keys)&&X,Ea=u.clearTimeout,P=u.setTimeout;b.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"object"};var sa=Function("n","var __p;with(n){__p='var l,r';if(k){__p+='='+k};__p+=';'+f+';'+q+';';if(c){__p+='var m='+g+'.length;l=-1;';if(o){__p+='if(m===+m){'};__p+=''+c['d']+';while('+c['m']+'){'+c['j']+'}';if(o){__p+='}'}}if(o){if(c){__p+='else{'}if(!i){__p+='var s=typeof '+l+'==\\'function\\';'};__p+=''+o['d']+';for('+o['m']+'){';if(i){if(r){__p+='if('+h+'){'};__p+=''+o['j']+';';if(r){__p+='}'}}else{__p+='if(!(s&&l==\\'prototype\\')';if(r){__p+='&&'+h};__p+='){'+o['j']+'}'};__p+='}';if(i){__p+='var g='+l+'.constructor;';for(var k=0;k<7;k++){__p+='l=\\''+p[k]+'\\';if(';if(p[k]=='constructor'){__p+='!(g&&g.prototype==='+l+')&&'};__p+=''+h+'){'+o['j']+'}'}}if(c){__p+='}'}};__p+=''+e+';return r'}return __p"
|
||||
),t={a:"f,d,x",k:"f",q:"if(!d){d=k}else if(x){d=c(d,x)}",j:"d(f[l],l,f)"},Y={k:"z",j:"if(!d(f[l],l,f))return!r"},Z={a:"n",k:"n",q:"for(var t,u=1,m=arguments.length;u<m;u++){t=arguments[u];"+(G?"if(t){":""),m:"l in t",r:q,j:"n[l]=t[l]",e:(G?"}":"")+"}"},E={k:"[]",j:"d(f[l],l,f)&&r.push(f[l])"},F={k:"",f:"if(!f)return[]",d:{b:"r=Array(m)",n:"r=[]"},j:{b:"r[l]=d(f[l],l,f)",n:"r.push(d(f[l],l,f))"}},z=k({a:"f,w",k:"h",j:"if(f[l]===w)return z"}),$=k(t,Y),C=k(t,E),pa=k(t,{j:"if(d(f[l],l,f))return f[l]"
|
||||
}),B=k(t,{q:"if(x)d=c(d,x)"}),aa=k(t,F),Q=k(F,{a:"f,q",j:{b:"r[l]=f[l][q]",n:"r.push(f[l][q])"}}),ba=k({a:"f,d,a,x",k:"a",q:"var p=arguments.length<3;if(x)d=c(d,x)",d:{b:"if(p)r=f[++l]"},j:{b:"r=d(r,f[l],l,f)",n:"r=p?(p=h,f[l]):d(r,f[l],l,f)"}}),E=k(t,E,{j:"!"+E.j}),t=k(t,Y,{k:"h",j:Y.j.replace("!","")}),qa=k(F,{a:"f",j:{b:"r[l]=f[l]",n:"r.push(f[l])"}}),F=k(Z,{j:"if(n[l]==A)"+Z.j}),ra=k(Z),O=k({a:"n",k:"[]",r:q,j:"if(y.call(n[l])==i)r.push(l)",e:"r.sort()"});R(arguments)||(R=function(a){return!!
|
||||
a&&!!s.call(a,"callee")});var V=D||function(a){return i.call(a)==H},D=k({a:"B",k:"z",q:"var e=y.call(B);if(e==b||e==v)return!B.length",j:{n:"return h"}}),T=X||k({a:"n",f:"if(!o[typeof n]||n===null)throw TypeError()",k:"[]",j:"r.push(l)"});b.VERSION="0.2.1",b.after=function(a,c){return 1>a?c():function(){if(1>--a)return c.apply(this,arguments)}},b.bind=v,b.bindAll=function(a){var c=arguments,d=1;1==c.length&&(d=0,c=O(a));for(var b=c.length;d<b;d++)a[c[d]]=v(a[c[d]],a);return a},b.chain=function(a)
|
||||
{return a=new p(a),a.s=m,a},b.clone=function(a){return I[typeof a]&&a!==o?V(a)?a.slice():ra({},a):a},b.compact=function(a){for(var c=-1,d=a.length,b=[];++c<d;)a[c]&&b.push(a[c]);return b},b.compose=function(){var a=arguments;return function(){for(var c=arguments,d=a.length;d--;)c=[a[d].apply(this,c)];return c[0]}},b.contains=z,b.debounce=function(a,c,d){function b(){h=n,d||a.apply(g,f)}var f,e,g,h;return function(){var i=d&&!h;return f=arguments,g=this,Ea(h),h=P(b,c),i&&(e=a.apply(g,f)),e}},b.defaults=
|
||||
F,b.defer=function(a){var c=l.call(arguments,1);return P(function(){return a.apply(n,c)},1)},b.delay=function(a,c){var d=l.call(arguments,2);return P(function(){return a.apply(n,d)},c)},b.difference=function(a){for(var c=-1,d=a.length,b=[],f=L.apply(b,l.call(arguments,1));++c<d;)0>x(f,a[c])&&b.push(a[c]);return b},b.escape=function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},b.every=$,b.extend=ra,b.filter=C,b.find=
|
||||
pa,b.first=U,b.flatten=ga,b.forEach=B,b.functions=O,b.groupBy=function(a,c,d){var b,f=-1,e=i.call(c)==r,g=a.length,h={};for(e&&d&&(c=v(c,d));++f<g;)b=a[f],d=e?c(b,f,a):b[c],(s.call(h,d)?h[d]:h[d]=[]).push(b);return h},b.has=function(a,c){return s.call(a,c)},b.identity=da,b.indexOf=x,b.initial=function(a,c,d){return l.call(a,0,-(c==n||d?1:c))},b.intersection=function(a){for(var c,d=-1,b=a.length,f=l.call(arguments,1),e=[];++d<b;)c=a[d],0>x(e,c)&&$(f,function(a){return-1<x(a,c)})&&e.push(c);return e
|
||||
},b.invoke=function(a,c){for(var d=l.call(arguments,2),b=-1,f=a.length,e=i.call(c)==r,g=[];++b<f;)g[b]=(e?c:a[b][c]).apply(a[b],d);return g},b.isArguments=R,b.isArray=V,b.isBoolean=function(a){return a===m||a===q||i.call(a)==la},b.isDate=function(a){return i.call(a)==ma},b.isElement=function(a){return!!a&&1==a.nodeType},b.isEmpty=D,b.isEqual=M,b.isFinite=function(a){return Da(a)&&i.call(a)==N},b.isFunction=function(a){return i.call(a)==r},b.isNaN=function(a){return i.call(a)==N&&a!=+a},b.isNull=function(
|
||||
a){return a===o},b.isNumber=function(a){return i.call(a)==N},b.isObject=function(a){return I[typeof a]&&a!==o},b.isRegExp=function(a){return i.call(a)==na},b.isString=function(a){return i.call(a)==J},b.isUndefined=function(a){return a===n},b.keys=T,b.last=function(a,c,d){var b=a.length;return c==n||d?a[b-1]:l.call(a,-c||b)},b.lastIndexOf=function(a,c){if(!a)return-1;for(var d=a.length;d--;)if(a[d]===c)return d;return-1},b.map=aa,b.max=ia,b.memoize=function(a,c){var d={};return function(){var b=c?
|
||||
c.apply(this,arguments):arguments[0];return s.call(d,b)?d[b]:d[b]=a.apply(this,arguments)}},b.min=function(a,c,d){var b=Infinity,f=-1,e=a.length,g=b;if(!c){for(;++f<e;)a[f]<g&&(g=a[f]);return g}for(d&&(c=v(c,d));++f<e;)d=c(a[f],f,a),d<b&&(b=d,g=a[f]);return g},b.mixin=oa,b.noConflict=function(){return u._=Aa,this},b.once=function(a){var c,d=q;return function(){return d?c:(d=m,c=a.apply(this,arguments))}},b.partial=function(a){var c=l.call(arguments,1),d=c.length;return function(){var b;return b=arguments
|
||||
,b.length&&(c.length=d,K.apply(c,b)),b=1==c.length?a.call(this,c[0]):a.apply(this,c),c.length=d,b}},b.pick=function(a){for(var c,d=0,b=L.apply(A,arguments),f=b.length,e={};++d<f;)c=b[d],c in a&&(e[c]=a[c]);return e},b.pluck=Q,b.range=function(a,c,d){d||(d=1),2>arguments.length&&(c=a||0,a=0);for(var b=-1,f=Math.max(Math.ceil((c-a)/d),0),e=Array(f);++b<f;)e[b]=a,a+=d;return e},b.reduce=ba,b.reduceRight=fa,b.reject=E,b.rest=ja,b.result=function(a,c){if(!a)return o;var d=a[c];return i.call(d)==r?a[c]
|
||||
():d},b.shuffle=function(a){for(var c,d=-1,b=a.length,f=Array(b);++d<b;)c=Math.floor(Math.random()*(d+1)),f[d]=f[c],f[c]=a[d];return f},b.size=function(a){var c=i.call(a);return c==H||c==J?a.length:T(a).length},b.some=t,b.sortBy=function(a,c,d){if(i.call(c)!=r)var b=c,c=function(a){return a[b]};else d&&(c=v(c,d));return Q(aa(a,function(b,d){return{a:c(b,d,a),b:b}}).sort(function(a,c){var b=a.a,d=c.a;return b===n?1:d===n?-1:b<d?-1:b>d?1:0}),"b")},b.sortedIndex=ha,b.tap=function(a,c){return c(a),a}
|
||||
,b.template=function(a,c,d){d||(d={});var j;j=b.templateSettings;var f=d.escape,e=d.evaluate,g=d.interpolate,d=d.variable;return f==o&&(f=j.escape),e==o&&(e=j.evaluate),g==o&&(g=j.interpolate),f&&(a=a.replace(f,wa)),g&&(a=a.replace(g,xa)),e&&(a=a.replace(e,ya)),a="__p='"+a.replace(Ca,ua).replace(Ba,ta)+"';\n",w.length=0,d||(d=j.variable,a="with("+d+"||{}){"+a+"}"),a="function("+d+"){var __p,__t,__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}",j=Function("_","return "+
|
||||
a)(b),c?j(c):(j.source=a,j)},b.throttle=function(a,c){function b(){h=new Date,g=n,a.apply(e,j)}var j,f,e,g,h=0;return function(){var i=new Date,k=c-(i-h);return j=arguments,e=this,0>=k?(h=i,f=a.apply(e,j)):g||(g=P(b,k)),f}},b.times=function(a,c,b){b&&(c=v(c,b));for(b=0;b<a;b++)c(b)},b.toArray=function(a){if(!a)return[];if(i.call(a.toArray)==r)return a.toArray();var b=a.length;return b===+b?l.call(a):qa(a)},b.union=function(){for(var a=-1,b=[],d=L.apply(b,arguments),i=d.length;++a<i;)0>x(b,d[a])&&
|
||||
b.push(d[a]);return b},b.uniq=ka,b.uniqueId=function(a){var b=za++;return a?a+b:b},b.values=qa,b.without=function(a){for(var b=l.call(arguments,1),d=-1,i=a.length,f=[];++d<i;)0>x(b,a[d])&&f.push(a[d]);return f},b.wrap=function(a,b){return function(){var d=[a];return arguments.length&&K.apply(d,arguments),b.apply(this,d)}},b.zip=function(){for(var a=-1,b=ia(Q(arguments,"length")),d=Array(b);++a<b;)d[a]=Q(arguments,a);return d},b.all=$,b.any=t,b.collect=aa,b.detect=pa,b.each=B,b.foldl=ba,b.foldr=fa
|
||||
,b.head=U,b.include=z,b.inject=ba,b.methods=O,b.select=C,b.tail=ja,b.take=U,b.unique=ka,p.prototype=b.prototype,oa(b),p.prototype.chain=function(){return this.s=m,this},p.prototype.value=function(){return this._wrapped},B("pop push reverse shift sort splice unshift".split(" "),function(a){var b=A[a];p.prototype[a]=function(){var a=this._wrapped;return arguments.length?b.apply(a,arguments):b.call(a),a.length===0&&delete a[0],this.s&&(a=new p(a),a.s=m),a}}),B(["concat","join","slice"],function(a){var b=
|
||||
A[a];p.prototype[a]=function(){var a=this._wrapped,a=arguments.length?b.apply(a,arguments):b.call(a);return this.s&&(a=new p(a),a.s=m),a}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(u._=b,define(function(){return b})):W?"object"==typeof module&&module&&module.t==W?(module.t=b)._=b:W._=b:u._=b})(this);
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "A drop-in replacement for Underscore.js that delivers performance improvements, bug fixes, and additional features.",
|
||||
"homepage": "http://lodash.com",
|
||||
"main": "lodash",
|
||||
|
||||
12
perf/perf.js
12
perf/perf.js
@@ -89,15 +89,21 @@
|
||||
console.log(event.target + '');
|
||||
},
|
||||
'onComplete': function() {
|
||||
var fastest = this.filter('fastest').pluck('name'),
|
||||
var fastest = this.filter('fastest'),
|
||||
slowest = this.filter('slowest'),
|
||||
lodashHz = 1 / (this[0].stats.mean + this[0].stats.moe),
|
||||
underscoreHz = 1 / (this[1].stats.mean + this[1].stats.moe);
|
||||
|
||||
if (fastest.length > 1) {
|
||||
console.log('It\'s too close to call.');
|
||||
lodashHz = underscoreHz = Math.min(lodashHz, underscoreHz);
|
||||
} else {
|
||||
console.log(fastest + ' is the fastest.');
|
||||
}
|
||||
else {
|
||||
var slowestHz = slowest[0] == this[0] ? lodashHz : underscoreHz,
|
||||
fastestHz = fastest[0] == this[0] ? lodashHz : underscoreHz,
|
||||
percent = Math.round(((fastestHz / slowestHz) - 1) * 100);
|
||||
|
||||
console.log(fastest[0].name + ' is ' + percent + '% faster.');
|
||||
}
|
||||
// add score adjusted for margin of error
|
||||
score.lodash += lodashHz;
|
||||
|
||||
@@ -420,7 +420,7 @@
|
||||
while ((new Date - start) < limit) {
|
||||
throttled();
|
||||
}
|
||||
equal(counter, 3);
|
||||
ok(counter > 1);
|
||||
});
|
||||
}());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user