mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46781e7614 | ||
|
|
1f3546a9f6 | ||
|
|
0dc88bb412 |
57
README.md
57
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Lo-Dash <sup>v0.4.0</sup>
|
# Lo-Dash <sup>v0.4.1</sup>
|
||||||
|
|
||||||
A drop-in replacement for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), that delivers [performance improvements](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#closed-underscorejs-issues), and [additional features](https://github.com/bestiejs/lodash#features).
|
A drop-in replacement for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), that delivers [performance improvements](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#closed-underscorejs-issues), and [additional features](https://github.com/bestiejs/lodash#features).
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ Lo-Dash’s performance is gained by avoiding slower native methods, instead opt
|
|||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
* [Development source](https://raw.github.com/bestiejs/lodash/v0.4.0/lodash.js)
|
* [Development source](https://raw.github.com/bestiejs/lodash/v0.4.1/lodash.js)
|
||||||
* [Production source](https://raw.github.com/bestiejs/lodash/v0.4.0/lodash.min.js)
|
* [Production source](https://raw.github.com/bestiejs/lodash/v0.4.1/lodash.min.js)
|
||||||
* CDN copies of ≤ [v0.3.2](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.3.2/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
|
* CDN copies of ≤ [v0.3.2](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.3.2/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
|
||||||
* For optimal performance, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
* For optimal performance, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ lodash backbone
|
|||||||
lodash legacy
|
lodash legacy
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
* Mobile builds, with IE bug fixes and method compilation removed, may be created using the `mobile` modifier argument.
|
* Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument.
|
||||||
~~~ bash
|
~~~ bash
|
||||||
lodash mobile
|
lodash mobile
|
||||||
~~~
|
~~~
|
||||||
@@ -146,29 +146,29 @@ require({
|
|||||||
|
|
||||||
## Closed Underscore.js issues <sup>(20+)</sup>
|
## Closed Underscore.js issues <sup>(20+)</sup>
|
||||||
|
|
||||||
* Allow iteration of objects with a `length` property [[#148](https://github.com/documentcloud/underscore/issues/148), [#154](https://github.com/documentcloud/underscore/issues/154), [#252](https://github.com/documentcloud/underscore/issues/252), [#448](https://github.com/documentcloud/underscore/issues/448), [#659](https://github.com/documentcloud/underscore/issues/659), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L306-312)]
|
* Allow iteration of objects with a `length` property [[#148](https://github.com/documentcloud/underscore/issues/148), [#154](https://github.com/documentcloud/underscore/issues/154), [#252](https://github.com/documentcloud/underscore/issues/252), [#448](https://github.com/documentcloud/underscore/issues/448), [#659](https://github.com/documentcloud/underscore/issues/659), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L306-312)]
|
||||||
* Ensure array-like objects with invalid `length` properties are treated like regular objects [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L257-263), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L607-621), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L840-843)]
|
* Ensure array-like objects with invalid `length` properties are treated like regular objects [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L257-263), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L607-621), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L863-866)]
|
||||||
* Ensure *"Arrays"* methods allow falsey `array` arguments [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L908-947)]
|
* Ensure *"Arrays"* methods allow falsey `array` arguments [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L931-970)]
|
||||||
* Ensure *"Collections"* methods allow string `collection` arguments [[#247](https://github.com/documentcloud/underscore/issues/247), [#276](https://github.com/documentcloud/underscore/issues/276), [#561](https://github.com/documentcloud/underscore/pull/561), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L265-283), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L623-640), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L845-848)]
|
* Ensure *"Collections"* methods allow string `collection` arguments [[#247](https://github.com/documentcloud/underscore/issues/247), [#276](https://github.com/documentcloud/underscore/issues/276), [#561](https://github.com/documentcloud/underscore/pull/561), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L265-283), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L623-640), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L868-871)]
|
||||||
* Ensure templates compiled with errors are inspectable [[#666](https://github.com/documentcloud/underscore/issues/666), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L737-744)]
|
* Ensure templates compiled with errors are inspectable [[#666](https://github.com/documentcloud/underscore/issues/666), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L737-744)]
|
||||||
* Fix cross-browser object iteration bugs [[#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L195-207), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L317-342), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L438-449), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L457-459), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L477-497), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L667-669)]
|
* Fix cross-browser object iteration bugs [[#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L195-207), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L317-342), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L438-449), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L457-459), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L477-497), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L667-669)]
|
||||||
* Handle arrays with `undefined` values correctly in IE < 9 [[#601](https://github.com/documentcloud/underscore/issues/601)]
|
* 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/v0.4.0/test/test.js#L86-92)]
|
* 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/v0.4.1/test/test.js#L86-92)]
|
||||||
* Register as an AMD module, but still export to global [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L70-84)]
|
* Register as an AMD module, but still export to global [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L70-84)]
|
||||||
* `_(…)` should return passed wrapper instances [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L104-107)]
|
* `_(…)` should return passed wrapper instances [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L104-107)]
|
||||||
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L138-147)]
|
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L138-147)]
|
||||||
* `_.escape` should return an empty string when passed `null` or `undefined` [[#407](https://github.com/documentcloud/underscore/issues/427), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L176-179)]
|
* `_.escape` should return an empty string when passed `null` or `undefined` [[#407](https://github.com/documentcloud/underscore/issues/427), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L176-179)]
|
||||||
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L252-255)]
|
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L252-255)]
|
||||||
* `_.groupBy` should add values to own, not inherited, properties [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L357-364)]
|
* `_.groupBy` should add values to own, not inherited, properties [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L357-364)]
|
||||||
* `_isNaN(new Number(NaN))` should return `true` [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L467-469)]
|
* `_isNaN(new Number(NaN))` should return `true` [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L467-469)]
|
||||||
* `_.reduceRight` should pass correct callback arguments when iterating objects [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L591-605)]
|
* `_.reduceRight` should pass correct callback arguments when iterating objects [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L591-605)]
|
||||||
* `_.size` should return the `length` of string values [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L650-652)]
|
* `_.size` should return the `length` of string values [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L650-652)]
|
||||||
* `_.size` shouldn't error on falsey values [[#650](https://github.com/documentcloud/underscore/pull/650), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L654-661)]
|
* `_.size` shouldn't error on falsey values [[#650](https://github.com/documentcloud/underscore/pull/650), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L654-661)]
|
||||||
* `_.size` should work with `arguments` objects cross-browser [[#653](https://github.com/documentcloud/underscore/issues/653), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L663-665)]
|
* `_.size` should work with `arguments` objects cross-browser [[#653](https://github.com/documentcloud/underscore/issues/653), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L663-665)]
|
||||||
* `_.sortedIndex` should support arrays with high `length` values [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L707-716)]
|
* `_.sortedIndex` should support arrays with high `length` values [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L707-716)]
|
||||||
* `_.template` should not augment the `options` object [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L731-735)]
|
* `_.template` should not augment the `options` object [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L731-735)]
|
||||||
* `_.throttle` should work when called in a tight loop [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L791-801)]
|
* `_.throttle` should work when called in a tight loop [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L814-824)]
|
||||||
* `_.zipObject` should accept less than two arguments [[test](https://github.com/bestiejs/lodash/blob/v0.4.0/test/test.js#L870-872)]
|
* `_.zipObject` should accept less than two arguments [[test](https://github.com/bestiejs/lodash/blob/v0.4.1/test/test.js#L893-895)]
|
||||||
|
|
||||||
## Optimized methods <sup>(50+)</sup>
|
## Optimized methods <sup>(50+)</sup>
|
||||||
|
|
||||||
@@ -233,6 +233,11 @@ require({
|
|||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
|
### <sup>v0.4.1</sup>
|
||||||
|
|
||||||
|
* Fixed `_.template` regression
|
||||||
|
* Optimized build process to detect and remove more unused variables
|
||||||
|
|
||||||
### <sup>v0.4.0</sup>
|
### <sup>v0.4.0</sup>
|
||||||
|
|
||||||
* Added `bin` and `scripts` entries to package.json
|
* Added `bin` and `scripts` entries to package.json
|
||||||
|
|||||||
129
build.js
129
build.js
@@ -405,10 +405,14 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function removeFromCreateIterator(source, refName) {
|
function removeFromCreateIterator(source, refName) {
|
||||||
var snippet = matchFunction(source, 'createIterator').match(/Function\([\s\S]+$/)[0],
|
var snippet = matchFunction(source, 'createIterator');
|
||||||
modified = snippet.replace(RegExp('\\b' + refName + '\\b,? *', 'g'), '');
|
if (snippet) {
|
||||||
|
// clip the snippet the `factory` assignment
|
||||||
return source.replace(snippet, modified);
|
snippet = snippet.match(/Function\([\s\S]+$/)[0];
|
||||||
|
var modified = snippet.replace(RegExp('\\b' + refName + '\\b,? *', 'g'), '');
|
||||||
|
source = source.replace(snippet, modified);
|
||||||
|
}
|
||||||
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -612,55 +616,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove associated functions, variables, and code snippets
|
// remove `isArguments` fallback before `isArguments` is transformed by
|
||||||
|
// other parts of the build process
|
||||||
if (isRemoved(source, 'isArguments')) {
|
if (isRemoved(source, 'isArguments')) {
|
||||||
source = removeIsArgumentsFallback(source);
|
source = removeIsArgumentsFallback(source);
|
||||||
}
|
}
|
||||||
if (isRemoved(source, 'mixin')) {
|
|
||||||
// remove `LoDash` constructor
|
|
||||||
source = removeFunction(source, 'LoDash');
|
|
||||||
// remove `LoDash` calls
|
|
||||||
source = source.replace(/(?:new +LoDash(?!\()|(?:new +)?LoDash\([^)]*\));?/g, '');
|
|
||||||
// remove `LoDash.prototype` additions
|
|
||||||
source = source.replace(/(?:\s*\/\/.*)*\s*LoDash.prototype *=[\s\S]+?\/\*-+\*\//, '');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'sortBy')) {
|
|
||||||
source = removeFunction(source, 'compareAscending');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'template')) {
|
|
||||||
// remove `templateSettings` assignment
|
|
||||||
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *lodash\.templateSettings[\s\S]+?};\n/, '');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'isArray', 'isEmpty', 'isEqual', 'size')) {
|
|
||||||
source = removeVar(source, 'arrayClass');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'bind', 'functions', 'groupBy', 'invoke', 'isEqual', 'isFunction', 'result', 'sortBy', 'toArray')) {
|
|
||||||
source = removeVar(source, 'funcClass');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'bind')) {
|
|
||||||
source = removeVar(source, 'nativeBind');
|
|
||||||
source = removeVar(source, 'isBindFast');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'isArray')) {
|
|
||||||
source = removeVar(source, 'nativeIsArray');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'keys')) {
|
|
||||||
source = removeFunction(source, 'shimKeys');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'clone', 'isObject', 'keys')) {
|
|
||||||
source = removeVar(source, 'objectTypes');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'bind', 'isArray', 'keys')) {
|
|
||||||
source = removeVar(source, 'reNative');
|
|
||||||
}
|
|
||||||
if (isRemoved(source, 'isEmpty', 'isEqual', 'isString', 'size')) {
|
|
||||||
source = removeVar(source, 'stringClass');
|
|
||||||
}
|
|
||||||
|
|
||||||
// consolidate consecutive horizontal rule comment separators
|
|
||||||
source = source.replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) {
|
|
||||||
return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*'));
|
|
||||||
});
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -847,12 +807,13 @@
|
|||||||
|
|
||||||
// remove unnecessary code
|
// remove unnecessary code
|
||||||
snippet = snippet
|
snippet = snippet
|
||||||
.replace(/, *__t,[^;]+|function print[^}]+}/g, '')
|
.replace(/var __t.+/, "var __p = '';")
|
||||||
|
.replace(/function print[^}]+}/, '')
|
||||||
.replace(/'(?:\\n|\s)+'/g, "''")
|
.replace(/'(?:\\n|\s)+'/g, "''")
|
||||||
.replace(/__p *\+= *' *';/g, '')
|
.replace(/__p *\+= *' *';/g, '')
|
||||||
.replace(/(__p *\+= *)' *' *\+/g, '$1')
|
.replace(/(__p *\+= *)' *' *\+/g, '$1')
|
||||||
.replace(/(\{) *;|; *(\})/g, '$1$2')
|
.replace(/(\{) *;|; *(\})/g, '$1$2')
|
||||||
.replace(/\(\(__w?t *= *\( *([^)]+) *\)\) *== *null *\? *'' *: *__w?t\)/g, '$1');
|
.replace(/\(\(__t *= *\( *([^)]+) *\)\) *== *null *\? *'' *: *__t\)/g, '$1');
|
||||||
|
|
||||||
// remove the with-statement
|
// remove the with-statement
|
||||||
snippet = snippet.replace(/ *with *\(.+?\) *{/, '\n').replace(/}([^}]*}[^}]*$)/, '$1');
|
snippet = snippet.replace(/ *with *\(.+?\) *{/, '\n').replace(/}([^}]*}[^}]*$)/, '$1');
|
||||||
@@ -860,7 +821,7 @@
|
|||||||
// minor cleanup
|
// minor cleanup
|
||||||
snippet = snippet
|
snippet = snippet
|
||||||
.replace(/obj *\|\| *\(obj *= *\{}\);/, '')
|
.replace(/obj *\|\| *\(obj *= *\{}\);/, '')
|
||||||
.replace(/var __p;\s*__p/, 'var __p');
|
.replace(/var __p = '';\s*__p \+=/, 'var __p =');
|
||||||
|
|
||||||
// remove comments, including sourceURLs
|
// remove comments, including sourceURLs
|
||||||
snippet = snippet.replace(/\s*\/\/.*(?:\n|$)/g, '');
|
snippet = snippet.replace(/\s*\/\/.*(?:\n|$)/g, '');
|
||||||
@@ -871,9 +832,71 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// remove associated functions, variables, and code snippets that the minifier may miss
|
||||||
|
if (isRemoved(source, 'mixin')) {
|
||||||
|
// remove `LoDash` constructor
|
||||||
|
source = removeFunction(source, 'LoDash');
|
||||||
|
// remove `LoDash` calls
|
||||||
|
source = source.replace(/(?:new +LoDash(?!\()|(?:new +)?LoDash\([^)]*\));?/g, '');
|
||||||
|
// remove `LoDash.prototype` additions
|
||||||
|
source = source.replace(/(?:\s*\/\/.*)*\s*LoDash.prototype *=[\s\S]+?\/\*-+\*\//, '');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'sortBy')) {
|
||||||
|
source = removeFunction(source, 'compareAscending');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'template')) {
|
||||||
|
// remove `templateSettings` assignment
|
||||||
|
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *lodash\.templateSettings[\s\S]+?};\n/, '');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'toArray')) {
|
||||||
|
source = removeVar(source, 'noArraySliceOnStrings');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'isArray', 'isEmpty', 'isEqual', 'size')) {
|
||||||
|
source = removeVar(source, 'arrayClass');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'bind', 'functions', 'groupBy', 'invoke', 'isEqual', 'isFunction', 'result', 'sortBy', 'toArray')) {
|
||||||
|
source = removeVar(source, 'funcClass');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'bind')) {
|
||||||
|
source = removeVar(source, 'nativeBind');
|
||||||
|
source = removeVar(source, 'isBindFast');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'isArray')) {
|
||||||
|
source = removeVar(source, 'nativeIsArray');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'keys')) {
|
||||||
|
source = removeFunction(source, 'shimKeys');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'clone', 'isObject', 'keys')) {
|
||||||
|
source = removeVar(source, 'objectTypes');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'bind', 'isArray', 'keys')) {
|
||||||
|
source = removeVar(source, 'reNative');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'isEmpty', 'isEqual', 'isString', 'size')) {
|
||||||
|
source = removeVar(source, 'stringClass');
|
||||||
|
}
|
||||||
|
if ((source.match(/\bcreateIterator\b/g) || []).length < 2) {
|
||||||
|
source = removeFunction(source, 'createIterator');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'createIterator', 'extend', 'isEqual')) {
|
||||||
|
source = removeVar(source, 'hasDontEnumBug');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'createIterator', 'keys')) {
|
||||||
|
source = removeVar(source, 'nativeKeys');
|
||||||
|
}
|
||||||
|
if (isRemoved(source, 'createIterator', 'reduceRight')) {
|
||||||
|
source = removeVar(source, 'noCharByIndex');
|
||||||
|
}
|
||||||
|
|
||||||
// remove pseudo private properties
|
// remove pseudo private properties
|
||||||
source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
|
source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
|
||||||
|
|
||||||
|
// consolidate consecutive horizontal rule comment separators
|
||||||
|
source = source.replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) {
|
||||||
|
return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*'));
|
||||||
|
});
|
||||||
|
|
||||||
// cleanup code
|
// cleanup code
|
||||||
source = source.replace(/^ *;\n/gm, '');
|
source = source.replace(/^ *;\n/gm, '');
|
||||||
|
|
||||||
|
|||||||
@@ -308,8 +308,8 @@
|
|||||||
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), "['$1']");
|
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), "['$1']");
|
||||||
|
|
||||||
if (isCreateIterator) {
|
if (isCreateIterator) {
|
||||||
// replace with modified snippet early and clip snippet so other arguments
|
// replace with modified snippet early and clip snippet to the `factory`
|
||||||
// aren't minified
|
// call so other arguments aren't minified
|
||||||
source = source.replace(snippet, modified);
|
source = source.replace(snippet, modified);
|
||||||
snippet = modified = modified.replace(/factory\([\s\S]+$/, '');
|
snippet = modified = modified.replace(/factory\([\s\S]+$/, '');
|
||||||
}
|
}
|
||||||
|
|||||||
188
doc/README.md
188
doc/README.md
@@ -1,4 +1,4 @@
|
|||||||
# Lo-Dash <sup>v0.4.0</sup>
|
# Lo-Dash <sup>v0.4.1</sup>
|
||||||
|
|
||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_value"></a>`_(value)`
|
### <a id="_value"></a>`_(value)`
|
||||||
<a href="#_value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L197 "View in source") [Ⓣ][1]
|
<a href="#_value">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L192 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
The `lodash` function.
|
The `lodash` function.
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ The `lodash` function.
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_version"></a>`_.VERSION`
|
### <a id="_version"></a>`_.VERSION`
|
||||||
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3593 "View in source") [Ⓣ][1]
|
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3563 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(String)*: The semantic version number.
|
*(String)*: The semantic version number.
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ The `lodash` function.
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_aftern-func"></a>`_.after(n, func)`
|
### <a id="_aftern-func"></a>`_.after(n, func)`
|
||||||
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1953 "View in source") [Ⓣ][1]
|
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1946 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a new function that is restricted to executing only after it is called `n` times.
|
Creates a new function that is restricted to executing only after it is called `n` times.
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ _.forEach(notes, function(note) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_bindfunc--thisarg-arg1-arg2-"></a>`_.bind(func [, thisArg, arg1, arg2, ...])`
|
### <a id="_bindfunc--thisarg-arg1-arg2-"></a>`_.bind(func [, thisArg, arg1, arg2, ...])`
|
||||||
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2007 "View in source") [Ⓣ][1]
|
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2000 "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`.
|
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`.
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ func();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_bindallobject--methodname1-methodname2-"></a>`_.bindAll(object [, methodName1, methodName2, ...])`
|
### <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#L2077 "View in source") [Ⓣ][1]
|
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2070 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Binds methods on `object` to `object`, overwriting the existing method. If no method names are provided, all the function properties of `object` will be bound.
|
Binds methods on `object` to `object`, overwriting the existing method. If no method names are provided, all the function properties of `object` will be bound.
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ jQuery('#lodash_button').on('click', buttonView.onClick);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_chainvalue"></a>`_.chain(value)`
|
### <a id="_chainvalue"></a>`_.chain(value)`
|
||||||
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3518 "View in source") [Ⓣ][1]
|
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3488 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Wraps the value in a `lodash` wrapper object.
|
Wraps the value in a `lodash` wrapper object.
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ var youngest = _.chain(stooges)
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_clonevalue"></a>`_.clone(value)`
|
### <a id="_clonevalue"></a>`_.clone(value)`
|
||||||
<a href="#_clonevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2403 "View in source") [Ⓣ][1]
|
<a href="#_clonevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2396 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Create a shallow clone of the `value`. Any nested objects or arrays will be assigned by reference and not cloned.
|
Create a shallow clone of the `value`. Any nested objects or arrays will be assigned by reference and not cloned.
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ _.clone({ 'name': 'moe' });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_compactarray"></a>`_.compact(array)`
|
### <a id="_compactarray"></a>`_.compact(array)`
|
||||||
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1200 "View in source") [Ⓣ][1]
|
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1193 "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.
|
Produces a new array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ _.compact([0, 1, false, 2, '', 3]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
|
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
|
||||||
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2109 "View in source") [Ⓣ][1]
|
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2102 "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 the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
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 the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ welcome('moe');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_containscollection-target"></a>`_.contains(collection, target)`
|
### <a id="_containscollection-target"></a>`_.contains(collection, target)`
|
||||||
<a href="#_containscollection-target">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L726 "View in source") [Ⓣ][1]
|
<a href="#_containscollection-target">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L719 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if a given `target` value is present in a `collection` using strict equality for comparisons, i.e. `===`.
|
Checks if a given `target` value is present in a `collection` using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ _.contains('curly', 'ur');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_debouncefunc-wait-immediate"></a>`_.debounce(func, wait, immediate)`
|
### <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#L2142 "View in source") [Ⓣ][1]
|
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2135 "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.
|
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.
|
||||||
|
|
||||||
@@ -436,7 +436,7 @@ jQuery(window).on('resize', lazyLayout);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_defaultsobject--defaults1-defaults2-"></a>`_.defaults(object [, defaults1, defaults2, ...])`
|
### <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#L2426 "View in source") [Ⓣ][1]
|
<a href="#_defaultsobject--defaults1-defaults2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2419 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Assigns missing properties on `object` with default values from the defaults objects. Once a property is set, additional defaults of the same property will be ignored.
|
Assigns missing properties on `object` with default values from the defaults objects. Once a property is set, additional defaults of the same property will be ignored.
|
||||||
|
|
||||||
@@ -462,7 +462,7 @@ _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_deferfunc--arg1-arg2-"></a>`_.defer(func [, arg1, arg2, ...])`
|
### <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#L2207 "View in source") [Ⓣ][1]
|
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2200 "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.
|
Defers executing the `func` function until the current call stack has cleared. Additional arguments are passed to `func` when it is invoked.
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ _.defer(function() { alert('deferred'); });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_delayfunc-wait--arg1-arg2-"></a>`_.delay(func, wait [, arg1, arg2, ...])`
|
### <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#L2187 "View in source") [Ⓣ][1]
|
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2180 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Executes the `func` function after `wait` milliseconds. Additional arguments are passed to `func` when it is invoked.
|
Executes the `func` function after `wait` milliseconds. Additional arguments are passed to `func` when it is invoked.
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ _.delay(log, 1000, 'logged later');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_differencearray--array1-array2-"></a>`_.difference(array [, array1, array2, ...])`
|
### <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#L1232 "View in source") [Ⓣ][1]
|
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1225 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a new array of `array` values not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
Produces a new array of `array` values not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_escapestring"></a>`_.escape(string)`
|
### <a id="_escapestring"></a>`_.escape(string)`
|
||||||
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3135 "View in source") [Ⓣ][1]
|
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3128 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Escapes a string for inclusion in HTML, replacing `&`, `<`, `"`, and `'` characters.
|
Escapes a string for inclusion in HTML, replacing `&`, `<`, `"`, and `'` characters.
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ _.escape('Curly, Larry & Moe');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_everycollection--callbackidentity-thisarg"></a>`_.every(collection [, callback=identity, thisArg])`
|
### <a id="_everycollection--callbackidentity-thisarg"></a>`_.every(collection [, callback=identity, thisArg])`
|
||||||
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L755 "View in source") [Ⓣ][1]
|
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L748 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -589,7 +589,7 @@ _.every([true, 1, null, 'yes'], Boolean);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_extendobject--source1-source2-"></a>`_.extend(object [, source1, source2, ...])`
|
### <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#L2445 "View in source") [Ⓣ][1]
|
<a href="#_extendobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2438 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Copies enumerable properties from the source objects to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
Copies enumerable properties from the source objects to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ _.extend({ 'name': 'moe' }, { 'age': 40 });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_filtercollection--callbackidentity-thisarg"></a>`_.filter(collection [, callback=identity, thisArg])`
|
### <a id="_filtercollection--callbackidentity-thisarg"></a>`_.filter(collection [, callback=identity, thisArg])`
|
||||||
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L776 "View in source") [Ⓣ][1]
|
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L769 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Examines each value in a `collection`, returning an array of all values the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
Examines each value in a `collection`, returning an array of all values the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -640,7 +640,7 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; })
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_findcollection-callback--thisarg"></a>`_.find(collection, callback [, thisArg])`
|
### <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#L798 "View in source") [Ⓣ][1]
|
<a href="#_findcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L791 "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 bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
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 bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -666,7 +666,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_firstarray--n-guard"></a>`_.first(array [, n, guard])`
|
### <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#L1268 "View in source") [Ⓣ][1]
|
<a href="#_firstarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1261 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the first value of the `array`. Pass `n` to return the first `n` values of the `array`.
|
Gets the first value of the `array`. Pass `n` to return the first `n` values of the `array`.
|
||||||
|
|
||||||
@@ -692,7 +692,7 @@ _.first([5, 4, 3, 2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_flattenarray-shallow"></a>`_.flatten(array, shallow)`
|
### <a id="_flattenarray-shallow"></a>`_.flatten(array, shallow)`
|
||||||
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1292 "View in source") [Ⓣ][1]
|
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1285 "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.
|
Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level.
|
||||||
|
|
||||||
@@ -720,7 +720,7 @@ _.flatten([1, [2], [3, [[4]]]], true);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_foreachcollection-callback--thisarg"></a>`_.forEach(collection, callback [, thisArg])`
|
### <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#L825 "View in source") [Ⓣ][1]
|
<a href="#_foreachcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L818 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Iterates over a `collection`, executing the `callback` for each value in the `collection`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
Iterates over a `collection`, executing the `callback` for each value in the `collection`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -749,7 +749,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_forinobject-callback--thisarg"></a>`_.forIn(object, callback [, thisArg])`
|
### <a id="_forinobject-callback--thisarg"></a>`_.forIn(object, callback [, thisArg])`
|
||||||
<a href="#_forinobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2474 "View in source") [Ⓣ][1]
|
<a href="#_forinobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2467 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, key, object)*.
|
Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, key, object)*.
|
||||||
|
|
||||||
@@ -785,7 +785,7 @@ _.forIn(new Dog('Dagny'), function(value, key) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_forownobject-callback--thisarg"></a>`_.forOwn(object, callback [, thisArg])`
|
### <a id="_forownobject-callback--thisarg"></a>`_.forOwn(object, callback [, thisArg])`
|
||||||
<a href="#_forownobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2497 "View in source") [Ⓣ][1]
|
<a href="#_forownobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2490 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Iterates over `object`'s own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, key, object)*.
|
Iterates over `object`'s own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, key, object)*.
|
||||||
|
|
||||||
@@ -813,7 +813,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_functionsobject"></a>`_.functions(object)`
|
### <a id="_functionsobject"></a>`_.functions(object)`
|
||||||
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2514 "View in source") [Ⓣ][1]
|
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2507 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a sorted array of the enumerable properties, own and inherited, of `object` that have function values.
|
Produces a sorted array of the enumerable properties, own and inherited, of `object` that have function values.
|
||||||
|
|
||||||
@@ -837,7 +837,7 @@ _.functions(_);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_groupbycollection-callback--thisarg"></a>`_.groupBy(collection, callback [, thisArg])`
|
### <a id="_groupbycollection-callback--thisarg"></a>`_.groupBy(collection, callback [, thisArg])`
|
||||||
<a href="#_groupbycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L853 "View in source") [Ⓣ][1]
|
<a href="#_groupbycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L846 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Splits `collection` into sets, grouped by the result of running each value through `callback`. The `callback` is bound to `thisArg` and 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 group by.
|
Splits `collection` into sets, grouped by the result of running each value through `callback`. The `callback` is bound to `thisArg` and 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 group by.
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ _.groupBy(['one', 'two', 'three'], 'length');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_hasobject-property"></a>`_.has(object, property)`
|
### <a id="_hasobject-property"></a>`_.has(object, property)`
|
||||||
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2537 "View in source") [Ⓣ][1]
|
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2530 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
|
Checks if the specified object `property` exists and is a direct property, instead of an inherited property.
|
||||||
|
|
||||||
@@ -894,7 +894,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_identityvalue"></a>`_.identity(value)`
|
### <a id="_identityvalue"></a>`_.identity(value)`
|
||||||
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3154 "View in source") [Ⓣ][1]
|
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3147 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
This function returns the first argument passed to it. Note: It is used throughout Lo-Dash as a default callback.
|
This function returns the first argument passed to it. Note: It is used throughout Lo-Dash as a default callback.
|
||||||
|
|
||||||
@@ -919,7 +919,7 @@ moe === _.identity(moe);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_indexofarray-value--fromindex0"></a>`_.indexOf(array, value [, fromIndex=0])`
|
### <a id="_indexofarray-value--fromindex0"></a>`_.indexOf(array, value [, fromIndex=0])`
|
||||||
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1336 "View in source") [Ⓣ][1]
|
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1329 "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.
|
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.
|
||||||
|
|
||||||
@@ -951,7 +951,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_initialarray--n-guard"></a>`_.initial(array [, n, guard])`
|
### <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#L1376 "View in source") [Ⓣ][1]
|
<a href="#_initialarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1369 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets all but the last value of `array`. Pass `n` to exclude the last `n` values from the result.
|
Gets all but the last value of `array`. Pass `n` to exclude the last `n` values from the result.
|
||||||
|
|
||||||
@@ -977,7 +977,7 @@ _.initial([3, 2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
|
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
|
||||||
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1397 "View in source") [Ⓣ][1]
|
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1390 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Computes the intersection of all the passed-in arrays.
|
Computes the intersection of all the passed-in arrays.
|
||||||
|
|
||||||
@@ -1001,7 +1001,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_invokecollection-methodname--arg1-arg2-"></a>`_.invoke(collection, methodName [, arg1, arg2, ...])`
|
### <a id="_invokecollection-methodname--arg1-arg2-"></a>`_.invoke(collection, methodName [, arg1, arg2, ...])`
|
||||||
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L887 "View in source") [Ⓣ][1]
|
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L880 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Invokes the method named by `methodName` on each element in the `collection`. Additional arguments will be passed to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`.
|
Invokes the method named by `methodName` on each element in the `collection`. Additional arguments will be passed to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`.
|
||||||
|
|
||||||
@@ -1030,7 +1030,7 @@ _.invoke([123, 456], String.prototype.split, '');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
|
### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
|
||||||
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2557 "View in source") [Ⓣ][1]
|
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2550 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is an `arguments` object.
|
Checks if `value` is an `arguments` object.
|
||||||
|
|
||||||
@@ -1057,7 +1057,7 @@ _.isArguments([1, 2, 3]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isarrayvalue"></a>`_.isArray(value)`
|
### <a id="_isarrayvalue"></a>`_.isArray(value)`
|
||||||
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2583 "View in source") [Ⓣ][1]
|
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2576 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is an array.
|
Checks if `value` is an array.
|
||||||
|
|
||||||
@@ -1084,7 +1084,7 @@ _.isArray([1, 2, 3]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
|
### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
|
||||||
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2600 "View in source") [Ⓣ][1]
|
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2593 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a boolean *(`true` or `false`)* value.
|
Checks if `value` is a boolean *(`true` or `false`)* value.
|
||||||
|
|
||||||
@@ -1108,7 +1108,7 @@ _.isBoolean(null);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isdatevalue"></a>`_.isDate(value)`
|
### <a id="_isdatevalue"></a>`_.isDate(value)`
|
||||||
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2617 "View in source") [Ⓣ][1]
|
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2610 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a date.
|
Checks if `value` is a date.
|
||||||
|
|
||||||
@@ -1132,7 +1132,7 @@ _.isDate(new Date);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_iselementvalue"></a>`_.isElement(value)`
|
### <a id="_iselementvalue"></a>`_.isElement(value)`
|
||||||
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2634 "View in source") [Ⓣ][1]
|
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2627 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a DOM element.
|
Checks if `value` is a DOM element.
|
||||||
|
|
||||||
@@ -1156,7 +1156,7 @@ _.isElement(document.body);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
|
### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
|
||||||
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2658 "View in source") [Ⓣ][1]
|
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2651 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is empty. Arrays or strings with a length of `0` and objects with no own enumerable properties are considered "empty".
|
Checks if `value` is empty. Arrays or strings with a length of `0` and objects with no own enumerable properties are considered "empty".
|
||||||
|
|
||||||
@@ -1186,7 +1186,7 @@ _.isEmpty('');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isequala-b--stack"></a>`_.isEqual(a, b [, stack])`
|
### <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#L2692 "View in source") [Ⓣ][1]
|
<a href="#_isequala-b--stack">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2685 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Performs a deep comparison between two values to determine if they are equivalent to each other.
|
Performs a deep comparison between two values to determine if they are equivalent to each other.
|
||||||
|
|
||||||
@@ -1218,7 +1218,7 @@ _.isEqual(moe, clone);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
|
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
|
||||||
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2853 "View in source") [Ⓣ][1]
|
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2846 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a finite number. Note: This is not the same as native `isFinite`, which will return true for booleans and other values. See http://es5.github.com/#x15.1.2.5.
|
Checks if `value` is a finite number. Note: This is not the same as native `isFinite`, which will return true for booleans and other values. See http://es5.github.com/#x15.1.2.5.
|
||||||
|
|
||||||
@@ -1248,7 +1248,7 @@ _.isFinite(Infinity);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
|
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
|
||||||
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2870 "View in source") [Ⓣ][1]
|
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2863 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a function.
|
Checks if `value` is a function.
|
||||||
|
|
||||||
@@ -1272,7 +1272,7 @@ _.isFunction(''.concat);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isnanvalue"></a>`_.isNaN(value)`
|
### <a id="_isnanvalue"></a>`_.isNaN(value)`
|
||||||
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2922 "View in source") [Ⓣ][1]
|
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2915 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `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.
|
Checks if `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.
|
||||||
|
|
||||||
@@ -1305,7 +1305,7 @@ _.isNaN(undefined);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isnullvalue"></a>`_.isNull(value)`
|
### <a id="_isnullvalue"></a>`_.isNull(value)`
|
||||||
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2945 "View in source") [Ⓣ][1]
|
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2938 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is `null`.
|
Checks if `value` is `null`.
|
||||||
|
|
||||||
@@ -1332,7 +1332,7 @@ _.isNull(undefined);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
|
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
|
||||||
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2962 "View in source") [Ⓣ][1]
|
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2955 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a number.
|
Checks if `value` is a number.
|
||||||
|
|
||||||
@@ -1356,7 +1356,7 @@ _.isNumber(8.4 * 5;
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isobjectvalue"></a>`_.isObject(value)`
|
### <a id="_isobjectvalue"></a>`_.isObject(value)`
|
||||||
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2891 "View in source") [Ⓣ][1]
|
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2884 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)`, and `new String('')`)*
|
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)`, and `new String('')`)*
|
||||||
|
|
||||||
@@ -1383,7 +1383,7 @@ _.isObject(1);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
|
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
|
||||||
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2979 "View in source") [Ⓣ][1]
|
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2972 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a regular expression.
|
Checks if `value` is a regular expression.
|
||||||
|
|
||||||
@@ -1407,7 +1407,7 @@ _.isRegExp(/moe/);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isstringvalue"></a>`_.isString(value)`
|
### <a id="_isstringvalue"></a>`_.isString(value)`
|
||||||
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2996 "View in source") [Ⓣ][1]
|
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2989 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a string.
|
Checks if `value` is a string.
|
||||||
|
|
||||||
@@ -1431,7 +1431,7 @@ _.isString('moe');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
|
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
|
||||||
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3014 "View in source") [Ⓣ][1]
|
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3007 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is `undefined`.
|
Checks if `value` is `undefined`.
|
||||||
|
|
||||||
@@ -1455,7 +1455,7 @@ _.isUndefined(void 0);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_keysobject"></a>`_.keys(object)`
|
### <a id="_keysobject"></a>`_.keys(object)`
|
||||||
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3031 "View in source") [Ⓣ][1]
|
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3024 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces an array of object`'s own enumerable property names.
|
Produces an array of object`'s own enumerable property names.
|
||||||
|
|
||||||
@@ -1479,7 +1479,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_lastarray--n-guard"></a>`_.last(array [, n, guard])`
|
### <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#L1435 "View in source") [Ⓣ][1]
|
<a href="#_lastarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1428 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the last value of the `array`. Pass `n` to return the lasy `n` values of the `array`.
|
Gets the last value of the `array`. Pass `n` to return the lasy `n` values of the `array`.
|
||||||
|
|
||||||
@@ -1505,7 +1505,7 @@ _.last([3, 2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_lastindexofarray-value--fromindexarraylength-1"></a>`_.lastIndexOf(array, value [, fromIndex=array.length-1])`
|
### <a id="_lastindexofarray-value--fromindexarraylength-1"></a>`_.lastIndexOf(array, value [, fromIndex=array.length-1])`
|
||||||
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1461 "View in source") [Ⓣ][1]
|
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1454 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`.
|
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -1534,7 +1534,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_mapcollection--callbackidentity-thisarg"></a>`_.map(collection [, callback=identity, thisArg])`
|
### <a id="_mapcollection--callbackidentity-thisarg"></a>`_.map(collection [, callback=identity, thisArg])`
|
||||||
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L924 "View in source") [Ⓣ][1]
|
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L917 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a new array of values by mapping each element in the `collection` through a transformation `callback`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
Produces a new array of values by mapping each element in the `collection` through a transformation `callback`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -1563,7 +1563,7 @@ _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_maxarray--callback-thisarg"></a>`_.max(array [, callback, thisArg])`
|
### <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#L1501 "View in source") [Ⓣ][1]
|
<a href="#_maxarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1494 "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 bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -1595,7 +1595,7 @@ _.max(stooges, function(stooge) { return stooge.age; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
|
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
|
||||||
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2230 "View in source") [Ⓣ][1]
|
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2223 "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.
|
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.
|
||||||
|
|
||||||
@@ -1621,7 +1621,7 @@ var fibonacci = _.memoize(function(n) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_minarray--callback-thisarg"></a>`_.min(array [, callback, thisArg])`
|
### <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#L1551 "View in source") [Ⓣ][1]
|
<a href="#_minarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1544 "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 bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -1647,7 +1647,7 @@ _.min([10, 5, 100, 2, 1000]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_mixinobject"></a>`_.mixin(object)`
|
### <a id="_mixinobject"></a>`_.mixin(object)`
|
||||||
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3180 "View in source") [Ⓣ][1]
|
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3173 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
|
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
|
||||||
|
|
||||||
@@ -1677,7 +1677,7 @@ _('larry').capitalize();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_noconflict"></a>`_.noConflict()`
|
### <a id="_noconflict"></a>`_.noConflict()`
|
||||||
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3211 "View in source") [Ⓣ][1]
|
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3204 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
|
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
|
||||||
|
|
||||||
@@ -1697,7 +1697,7 @@ var lodash = _.noConflict();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_oncefunc"></a>`_.once(func)`
|
### <a id="_oncefunc"></a>`_.once(func)`
|
||||||
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2256 "View in source") [Ⓣ][1]
|
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2249 "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.
|
Creates a new function that is restricted to one execution. Repeat calls to the function will return the value of the first call.
|
||||||
|
|
||||||
@@ -1723,7 +1723,7 @@ initialize();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_partialfunc--arg1-arg2-"></a>`_.partial(func [, arg1, arg2, ...])`
|
### <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#L2289 "View in source") [Ⓣ][1]
|
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2282 "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.
|
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.
|
||||||
|
|
||||||
@@ -1750,7 +1750,7 @@ hi('moe');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_pickobject--prop1-prop2-"></a>`_.pick(object [, prop1, prop2, ...])`
|
### <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#L3053 "View in source") [Ⓣ][1]
|
<a href="#_pickobject--prop1-prop2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3046 "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.
|
Creates an object composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names.
|
||||||
|
|
||||||
@@ -1775,7 +1775,7 @@ _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_pluckcollection-property"></a>`_.pluck(collection, property)`
|
### <a id="_pluckcollection-property"></a>`_.pluck(collection, property)`
|
||||||
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L947 "View in source") [Ⓣ][1]
|
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L940 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Retrieves the value of a specified property from all elements in the `collection`.
|
Retrieves the value of a specified property from all elements in the `collection`.
|
||||||
|
|
||||||
@@ -1806,7 +1806,7 @@ _.pluck(stooges, 'name');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_rangestart0-end--step1"></a>`_.range([start=0], end [, step=1])`
|
### <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#L1612 "View in source") [Ⓣ][1]
|
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1605 "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.
|
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.
|
||||||
|
|
||||||
@@ -1844,7 +1844,7 @@ _.range(0);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_reducecollection-callback--accumulator-thisarg"></a>`_.reduce(collection, callback [, accumulator, thisArg])`
|
### <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#L976 "View in source") [Ⓣ][1]
|
<a href="#_reducecollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L969 "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 `thisArg` and invoked with `4` arguments; for arrays they are *(accumulator, value, index, array)* and for objects they are *(accumulator, value, key, object)*.
|
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 `thisArg` and invoked with `4` arguments; for arrays they are *(accumulator, value, index, array)* and for objects they are *(accumulator, value, key, object)*.
|
||||||
|
|
||||||
@@ -1871,7 +1871,7 @@ var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_reducerightcollection-callback--accumulator-thisarg"></a>`_.reduceRight(collection, callback [, accumulator, thisArg])`
|
### <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#L1013 "View in source") [Ⓣ][1]
|
<a href="#_reducerightcollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1006 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
The right-associative version of `_.reduce`.
|
The right-associative version of `_.reduce`.
|
||||||
|
|
||||||
@@ -1899,7 +1899,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_rejectcollection--callbackidentity-thisarg"></a>`_.reject(collection [, callback=identity, thisArg])`
|
### <a id="_rejectcollection--callbackidentity-thisarg"></a>`_.reject(collection [, callback=identity, thisArg])`
|
||||||
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1068 "View in source") [Ⓣ][1]
|
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1061 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
The opposite of `_.filter`, this method returns the values of a `collection` that `callback` does **not** return truthy for.
|
The opposite of `_.filter`, this method returns the values of a `collection` that `callback` does **not** return truthy for.
|
||||||
|
|
||||||
@@ -1925,7 +1925,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_restarray--n-guard"></a>`_.rest(array [, n, guard])`
|
### <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#L1649 "View in source") [Ⓣ][1]
|
<a href="#_restarray--n-guard">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1642 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
The opposite of `_.initial`, this method gets all but the first value of `array`. Pass `n` to exclude the first `n` values from the result.
|
The opposite of `_.initial`, this method gets all but the first value of `array`. Pass `n` to exclude the first `n` values from the result.
|
||||||
|
|
||||||
@@ -1951,7 +1951,7 @@ _.rest([3, 2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_resultobject-property"></a>`_.result(object, property)`
|
### <a id="_resultobject-property"></a>`_.result(object, property)`
|
||||||
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3243 "View in source") [Ⓣ][1]
|
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3236 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Resolves the value of `property` on `object`. If `property` is a function it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned.
|
Resolves the value of `property` on `object`. If `property` is a function it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned.
|
||||||
|
|
||||||
@@ -1986,7 +1986,7 @@ _.result(object, 'stuff');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_shufflearray"></a>`_.shuffle(array)`
|
### <a id="_shufflearray"></a>`_.shuffle(array)`
|
||||||
<a href="#_shufflearray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1670 "View in source") [Ⓣ][1]
|
<a href="#_shufflearray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1663 "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.
|
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.
|
||||||
|
|
||||||
@@ -2010,7 +2010,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sizevalue"></a>`_.size(value)`
|
### <a id="_sizevalue"></a>`_.size(value)`
|
||||||
<a href="#_sizevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3092 "View in source") [Ⓣ][1]
|
<a href="#_sizevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3085 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the size of `value` by returning `value.length` if `value` is a string or array, or the number of own enumerable properties if `value` is an object.
|
Gets the size of `value` by returning `value.length` if `value` is a string or array, or the number of own enumerable properties if `value` is an object.
|
||||||
|
|
||||||
@@ -2040,7 +2040,7 @@ _.size('curly');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_somecollection--callbackidentity-thisarg"></a>`_.some(collection [, callback=identity, thisArg])`
|
### <a id="_somecollection--callbackidentity-thisarg"></a>`_.some(collection [, callback=identity, thisArg])`
|
||||||
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1092 "View in source") [Ⓣ][1]
|
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1085 "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 bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with `3` arguments; for arrays they are *(value, index, array)* and for objects they are *(value, key, object)*.
|
||||||
|
|
||||||
@@ -2066,7 +2066,7 @@ _.some([null, 0, 'yes', false]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sortbycollection-callback--thisarg"></a>`_.sortBy(collection, callback [, thisArg])`
|
### <a id="_sortbycollection-callback--thisarg"></a>`_.sortBy(collection, callback [, thisArg])`
|
||||||
<a href="#_sortbycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1125 "View in source") [Ⓣ][1]
|
<a href="#_sortbycollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1118 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a new sorted array, sorted in ascending order by the results of running each element of `collection` through a transformation `callback`. The `callback` is bound to `thisArg` and 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')*.
|
Produces a new sorted array, sorted in ascending order by the results of running each element of `collection` through a transformation `callback`. The `callback` is bound to `thisArg` and 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')*.
|
||||||
|
|
||||||
@@ -2098,7 +2098,7 @@ _.sortBy(['larry', 'brendan', 'moe'], 'length');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sortedindexarray-value--callbackidentity-thisarg"></a>`_.sortedIndex(array, value [, callback=identity, thisArg])`
|
### <a id="_sortedindexarray-value--callbackidentity-thisarg"></a>`_.sortedIndex(array, value [, callback=identity, thisArg])`
|
||||||
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1722 "View in source") [Ⓣ][1]
|
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1715 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with `1` argument; *(value)*.
|
Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with `1` argument; *(value)*.
|
||||||
|
|
||||||
@@ -2139,7 +2139,7 @@ _.sortedIndex(['twenty', 'thirty', 'fourty'], 'thirty-five', function(word) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
|
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
|
||||||
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3545 "View in source") [Ⓣ][1]
|
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3515 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
|
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
|
||||||
|
|
||||||
@@ -2169,7 +2169,7 @@ _.chain([1,2,3,200])
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
|
### <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#L3303 "View in source") [Ⓣ][1]
|
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3296 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
|
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
|
||||||
|
|
||||||
@@ -2228,7 +2228,7 @@ _.template('<%= data.hasWith %>', { 'hasWith': 'no' }, { 'variable': 'data' });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
|
### <a id="_throttlefunc-wait"></a>`_.throttle(func, wait)`
|
||||||
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2325 "View in source") [Ⓣ][1]
|
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2318 "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 during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
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 during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
||||||
|
|
||||||
@@ -2253,7 +2253,7 @@ jQuery(window).on('scroll', throttled);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
|
### <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#L3461 "View in source") [Ⓣ][1]
|
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3431 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Executes the `callback` function `n` times. The `callback` is bound to `thisArg` and invoked with `1` argument; *(index)*.
|
Executes the `callback` function `n` times. The `callback` is bound to `thisArg` and invoked with `1` argument; *(index)*.
|
||||||
|
|
||||||
@@ -2279,7 +2279,7 @@ _.times(3, function() { this.grantWish(); }, genie);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_toarraycollection"></a>`_.toArray(collection)`
|
### <a id="_toarraycollection"></a>`_.toArray(collection)`
|
||||||
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1168 "View in source") [Ⓣ][1]
|
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1161 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Converts the `collection`, into an array. Useful for converting the `arguments` object.
|
Converts the `collection`, into an array. Useful for converting the `arguments` object.
|
||||||
|
|
||||||
@@ -2303,7 +2303,7 @@ Converts the `collection`, into an array. Useful for converting the `arguments`
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
|
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
|
||||||
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1762 "View in source") [Ⓣ][1]
|
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1755 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Computes the union of the passed-in arrays.
|
Computes the union of the passed-in arrays.
|
||||||
|
|
||||||
@@ -2327,7 +2327,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_uniqarray--issortedfalse-callbackidentity-thisarg"></a>`_.uniq(array [, isSorted=false, callback=identity, thisArg])`
|
### <a id="_uniqarray--issortedfalse-callbackidentity-thisarg"></a>`_.uniq(array [, isSorted=false, callback=identity, thisArg])`
|
||||||
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1807 "View in source") [Ⓣ][1]
|
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1800 "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 bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
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 bound to `thisArg` and invoked with `3` arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -2363,7 +2363,7 @@ _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
|
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
|
||||||
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3488 "View in source") [Ⓣ][1]
|
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3458 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Generates a unique id. If `prefix` is passed, the id will be appended to it.
|
Generates a unique id. If `prefix` is passed, the id will be appended to it.
|
||||||
|
|
||||||
@@ -2387,7 +2387,7 @@ _.uniqueId('contact_');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_valuesobject"></a>`_.values(object)`
|
### <a id="_valuesobject"></a>`_.values(object)`
|
||||||
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3113 "View in source") [Ⓣ][1]
|
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3106 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces an array of `object`'s own enumerable property values.
|
Produces an array of `object`'s own enumerable property values.
|
||||||
|
|
||||||
@@ -2411,7 +2411,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_withoutarray--value1-value2-"></a>`_.without(array [, value1, value2, ...])`
|
### <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#L1856 "View in source") [Ⓣ][1]
|
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1849 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a new array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
Produces a new array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -2436,7 +2436,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_wrapfunc-wrapper--arg1-arg2-"></a>`_.wrap(func, wrapper [, arg1, arg2, ...])`
|
### <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#L2377 "View in source") [Ⓣ][1]
|
<a href="#_wrapfunc-wrapper--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2370 "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.
|
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.
|
||||||
|
|
||||||
@@ -2466,7 +2466,7 @@ hello();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
|
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
|
||||||
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1888 "View in source") [Ⓣ][1]
|
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1881 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Merges the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
Merges the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
||||||
|
|
||||||
@@ -2490,7 +2490,7 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_zipobjectkeys"></a>`_.zipObject(keys)`
|
### <a id="_zipobjectkeys"></a>`_.zipObject(keys)`
|
||||||
<a href="#_zipobjectkeys">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1917 "View in source") [Ⓣ][1]
|
<a href="#_zipobjectkeys">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1910 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Merges an array of `keys` and an array of `values` into a single object.
|
Merges an array of `keys` and an array of `values` into a single object.
|
||||||
|
|
||||||
@@ -2521,7 +2521,7 @@ _.zipObject(['moe', 'larry', 'curly'], [30, 40, 50]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_prototypechain"></a>`_.prototype.chain()`
|
### <a id="_prototypechain"></a>`_.prototype.chain()`
|
||||||
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3563 "View in source") [Ⓣ][1]
|
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3533 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Enables method chaining on the wrapper object.
|
Enables method chaining on the wrapper object.
|
||||||
|
|
||||||
@@ -2542,7 +2542,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_prototypevalue"></a>`_.prototype.value()`
|
### <a id="_prototypevalue"></a>`_.prototype.value()`
|
||||||
<a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3580 "View in source") [Ⓣ][1]
|
<a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3550 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Extracts the wrapped value.
|
Extracts the wrapped value.
|
||||||
|
|
||||||
@@ -2570,7 +2570,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatesettings"></a>`_.templateSettings`
|
### <a id="_templatesettings"></a>`_.templateSettings`
|
||||||
<a href="#_templatesettings">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L225 "View in source") [Ⓣ][1]
|
<a href="#_templatesettings">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L220 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(Object)*: By default, Lo-Dash uses embedded Ruby *(ERB)* style template delimiters, change the following template settings to use alternative delimiters.
|
*(Object)*: By default, Lo-Dash uses embedded Ruby *(ERB)* style template delimiters, change the following template settings to use alternative delimiters.
|
||||||
|
|
||||||
@@ -2582,7 +2582,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
|
### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
|
||||||
<a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L234 "View in source") [Ⓣ][1]
|
<a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L229 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(RegExp)*: Used to detect `data` property values to be HTML-escaped.
|
*(RegExp)*: Used to detect `data` property values to be HTML-escaped.
|
||||||
|
|
||||||
@@ -2594,7 +2594,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
|
### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
|
||||||
<a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L243 "View in source") [Ⓣ][1]
|
<a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L238 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(RegExp)*: Used to detect code to be evaluated.
|
*(RegExp)*: Used to detect code to be evaluated.
|
||||||
|
|
||||||
@@ -2606,7 +2606,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
|
### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
|
||||||
<a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L252 "View in source") [Ⓣ][1]
|
<a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L247 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(RegExp)*: Used to detect `data` property values to inject.
|
*(RegExp)*: Used to detect `data` property values to inject.
|
||||||
|
|
||||||
@@ -2618,7 +2618,7 @@ _([1, 2, 3]).value();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
|
### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
|
||||||
<a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L261 "View in source") [Ⓣ][1]
|
<a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L256 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(String)*: Used to reference the data object in the template text.
|
*(String)*: Used to reference the data object in the template text.
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
// generate Markdown
|
// generate Markdown
|
||||||
$markdown = docdown(array(
|
$markdown = docdown(array(
|
||||||
'path' => '../' . $file,
|
'path' => '../' . $file,
|
||||||
'title' => 'Lo-Dash <sup>v0.4.0</sup>',
|
'title' => 'Lo-Dash <sup>v0.4.1</sup>',
|
||||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
106
lodash.js
106
lodash.js
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Lo-Dash v0.4.0 <http://lodash.com>
|
* Lo-Dash v0.4.1 <http://lodash.com>
|
||||||
* Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
|
* Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
|
||||||
* Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
* Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||||
* <http://documentcloud.github.com/underscore>
|
* <http://documentcloud.github.com/underscore>
|
||||||
@@ -50,15 +50,10 @@
|
|||||||
/** Used to detect delimiter values that should be processed by `tokenizeEvaluate` */
|
/** Used to detect delimiter values that should be processed by `tokenizeEvaluate` */
|
||||||
var reComplexDelimiter = /[-+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/;
|
var reComplexDelimiter = /[-+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/;
|
||||||
|
|
||||||
/** Used to match code generated in place of template delimiters */
|
|
||||||
var reDelimiterCodeLeading = /^';\n/,
|
|
||||||
reDelimiterCodeMiddle = /^' \+\n/,
|
|
||||||
reDelimiterCodeTrailing = /(?:__p \+= '|\+\n')$/;
|
|
||||||
|
|
||||||
/** Used to match empty string literals in compiled template source */
|
/** Used to match empty string literals in compiled template source */
|
||||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||||
reEmptyStringMiddle = /\b(__p \+?=) '' \+/g,
|
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||||
reEmptyStringTrailing = /(__w?e\(.*?\)|\b__w?t\)) \+\n'';/g;
|
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
||||||
|
|
||||||
/** Used to insert the data object variable into compiled template source */
|
/** Used to insert the data object variable into compiled template source */
|
||||||
var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g;
|
var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g;
|
||||||
@@ -672,12 +667,10 @@
|
|||||||
var index = tokenized.length;
|
var index = tokenized.length;
|
||||||
if (value) {
|
if (value) {
|
||||||
tokenized[index] = "';\n" + value + ";\n__p += '"
|
tokenized[index] = "';\n" + value + ";\n__p += '"
|
||||||
}
|
} else if (escapeValue) {
|
||||||
else if (escapeValue) {
|
tokenized[index] = "' +\n__e(" + escapeValue + ") +\n'";
|
||||||
tokenized[index] = "' +\n__we(" + escapeValue + ") +\n'";
|
} else if (interpolateValue) {
|
||||||
}
|
tokenized[index] = "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
|
||||||
else if (interpolateValue) {
|
|
||||||
tokenized[index] = "' +\n((__wt = (" + interpolateValue + ")) == null ? '' : __wt) +\n'";
|
|
||||||
}
|
}
|
||||||
return token + index;
|
return token + index;
|
||||||
}
|
}
|
||||||
@@ -3307,11 +3300,8 @@
|
|||||||
// https://github.com/olado/doT
|
// https://github.com/olado/doT
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
|
|
||||||
var endIndex,
|
var isEvaluating,
|
||||||
isEvaluating,
|
|
||||||
startIndex,
|
|
||||||
result,
|
result,
|
||||||
useWith,
|
|
||||||
escapeDelimiter = options.escape,
|
escapeDelimiter = options.escape,
|
||||||
evaluateDelimiter = options.evaluate,
|
evaluateDelimiter = options.evaluate,
|
||||||
interpolateDelimiter = options.interpolate,
|
interpolateDelimiter = options.interpolate,
|
||||||
@@ -3337,83 +3327,63 @@
|
|||||||
text = text.replace(interpolateDelimiter, tokenizeInterpolate);
|
text = text.replace(interpolateDelimiter, tokenizeInterpolate);
|
||||||
}
|
}
|
||||||
if (evaluateDelimiter != lastEvaluateDelimiter) {
|
if (evaluateDelimiter != lastEvaluateDelimiter) {
|
||||||
|
// generate `reEvaluateDelimiter` to match `_.templateSettings.evaluate`
|
||||||
|
// and internal `<e%- %>`, `<e%= %>` delimiters
|
||||||
lastEvaluateDelimiter = evaluateDelimiter;
|
lastEvaluateDelimiter = evaluateDelimiter;
|
||||||
reEvaluateDelimiter = RegExp(
|
reEvaluateDelimiter = RegExp(
|
||||||
(evaluateDelimiter ? evaluateDelimiter.source : '($^)') +
|
(evaluateDelimiter ? evaluateDelimiter.source : '($^)') +
|
||||||
'|<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>'
|
'|<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>'
|
||||||
, 'g');
|
, 'g');
|
||||||
}
|
}
|
||||||
startIndex = tokenized.length;
|
isEvaluating = tokenized.length;
|
||||||
text = text.replace(reEvaluateDelimiter, tokenizeEvaluate);
|
text = text.replace(reEvaluateDelimiter, tokenizeEvaluate);
|
||||||
endIndex = tokenized.length - 1;
|
isEvaluating = isEvaluating != tokenized.length;
|
||||||
isEvaluating = startIndex <= endIndex;
|
|
||||||
|
|
||||||
// if `options.variable` is not specified and the template contains "evaluate"
|
|
||||||
// delimiters, inject a with-statement around all "evaluate" delimiters to
|
|
||||||
// add the data object to the top of the scope chain
|
|
||||||
if (!variable) {
|
|
||||||
variable = settings.variable || lastVariable || 'obj';
|
|
||||||
useWith = isEvaluating;
|
|
||||||
|
|
||||||
if (useWith) {
|
|
||||||
tokenized[startIndex] = "';\n__with (" + variable + ') {\n' + tokenized[startIndex]
|
|
||||||
.replace(reDelimiterCodeLeading, '')
|
|
||||||
.replace(reDelimiterCodeMiddle, '__p += ');
|
|
||||||
|
|
||||||
tokenized[endIndex] = tokenized[endIndex]
|
|
||||||
.replace(reDelimiterCodeTrailing, '') + "\n}__\n__p += '";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var strInsertVariable = '$&' + variable + '.',
|
|
||||||
strDoubleVariable = '$1__d';
|
|
||||||
|
|
||||||
// escape characters that cannot be included in string literals and
|
// escape characters that cannot be included in string literals and
|
||||||
// detokenize delimiter code snippets
|
// detokenize delimiter code snippets
|
||||||
text = "__p = '" + text
|
text = "__p += '" + text
|
||||||
.replace(reUnescapedString, escapeStringChar)
|
.replace(reUnescapedString, escapeStringChar)
|
||||||
.replace(reToken, detokenize) + "';\n";
|
.replace(reToken, detokenize) + "';\n";
|
||||||
|
|
||||||
// clear stored code snippets
|
// clear stored code snippets
|
||||||
tokenized.length = 0;
|
tokenized.length = 0;
|
||||||
|
|
||||||
// find the start and end indexes of the with-statement
|
// if `options.variable` is not specified and the template contains "evaluate"
|
||||||
if (useWith) {
|
// delimiters, wrap a with-statement around the generated code to add the
|
||||||
startIndex = text.indexOf('__with');
|
// data object to the top of the scope chain
|
||||||
endIndex = text.indexOf('}__', startIndex + 10);
|
if (!variable) {
|
||||||
|
variable = settings.variable || lastVariable || 'obj';
|
||||||
|
|
||||||
|
if (isEvaluating) {
|
||||||
|
text = 'with (' + variable + ') {\n' + text + '\n}\n';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (variable != lastVariable) {
|
||||||
|
// generate `reDoubleVariable` to match references like `obj.obj` inside
|
||||||
|
// transformed "escape" and "interpolate" delimiters
|
||||||
|
lastVariable = variable;
|
||||||
|
reDoubleVariable = RegExp('(\\(\\s*)' + variable + '\\.' + variable + '\\b', 'g');
|
||||||
|
}
|
||||||
|
// avoid a with-statement by prepending data object references to property names
|
||||||
|
text = text
|
||||||
|
.replace(reInsertVariable, '$&' + variable + '.')
|
||||||
|
.replace(reDoubleVariable, '$1__d');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// memoize `reDoubleVariable`
|
|
||||||
if (variable != lastVariable) {
|
|
||||||
lastVariable = variable;
|
|
||||||
reDoubleVariable = RegExp('([(\\s])' + variable + '\\.' + variable + '\\b', 'g');
|
|
||||||
}
|
|
||||||
// prepend data object references to property names outside of the with-statement
|
|
||||||
text = (useWith ? text.slice(0, startIndex) : text)
|
|
||||||
.replace(reInsertVariable, strInsertVariable)
|
|
||||||
.replace(reDoubleVariable, strDoubleVariable) +
|
|
||||||
(useWith
|
|
||||||
? text.slice(startIndex + 2, endIndex + 1) +
|
|
||||||
text.slice(endIndex + 3)
|
|
||||||
.replace(reInsertVariable, strInsertVariable)
|
|
||||||
.replace(reDoubleVariable, strDoubleVariable)
|
|
||||||
: ''
|
|
||||||
);
|
|
||||||
|
|
||||||
// cleanup code by stripping empty strings
|
// cleanup code by stripping empty strings
|
||||||
text = (isEvaluating ? text.replace(reEmptyStringLeading, '') : text)
|
text = ( isEvaluating ? text.replace(reEmptyStringLeading, '') : text)
|
||||||
.replace(reEmptyStringMiddle, '$1')
|
.replace(reEmptyStringMiddle, '$1')
|
||||||
.replace(reEmptyStringTrailing, '$1;');
|
.replace(reEmptyStringTrailing, '$1;');
|
||||||
|
|
||||||
// frame code as the function body
|
// frame code as the function body
|
||||||
text = 'function(' + variable + ') {\n' +
|
text = 'function(' + variable + ') {\n' +
|
||||||
variable + ' || (' + variable + ' = {});\n' +
|
variable + ' || (' + variable + ' = {});\n' +
|
||||||
'var __p, __t, __wt' +
|
'var __t, __p = \'\', __e = _.escape' +
|
||||||
', __d = ' + variable + '.' + variable + ' || ' + variable +
|
|
||||||
', __e = _.escape, __we = __e' +
|
|
||||||
(isEvaluating
|
(isEvaluating
|
||||||
? ', __j = Array.prototype.join;\n' +
|
? ', __j = Array.prototype.join;\n' +
|
||||||
'function print() { __p += __j.call(arguments, \'\') }\n'
|
'function print() { __p += __j.call(arguments, \'\') }\n'
|
||||||
: ';\n'
|
: ', __d = ' + variable + '.' + variable + ' || ' + variable + ';\n'
|
||||||
) +
|
) +
|
||||||
text +
|
text +
|
||||||
'return __p\n}';
|
'return __p\n}';
|
||||||
@@ -3590,7 +3560,7 @@
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @type String
|
* @type String
|
||||||
*/
|
*/
|
||||||
lodash.VERSION = '0.4.0';
|
lodash.VERSION = '0.4.1';
|
||||||
|
|
||||||
// assign static methods
|
// assign static methods
|
||||||
lodash.after = after;
|
lodash.after = after;
|
||||||
|
|||||||
62
lodash.min.js
vendored
62
lodash.min.js
vendored
@@ -1,35 +1,35 @@
|
|||||||
/*!
|
/*!
|
||||||
Lo-Dash 0.4.0 lodash.com/license
|
Lo-Dash 0.4.1 lodash.com/license
|
||||||
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
|
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
;(function(e,t){"use strict";function s(e){return new o(e)}function o(e){if(e&&e._wrapped)return e;this._wrapped=e}function u(){for(var e,t,n,s=-1,o=arguments.length,u={e:"",f:"",j:"",q:"",c:{d:""},n:{d:""}};++s<o;)for(t in e=arguments[s],e)n=(n=e[t])==r?"":n,/d|i/.test(t)?("string"==typeof n&&(n={b:n,m:n}),u.c[t]=n.b,u.n[t]=n.m):u[t]=n;e=u.a,t=/^[^,]+/.exec(e)[0],u.l=u.l||t,u.g=t,u.h=yt,u.k=St,u.p=Q,u.r=u.r!==i,"o"in u||(u.o=wt),u.f||(u.f="if(!"+t+")return A");if("f"!=t||!u.c.i)u.c=r;t="var A",u.
|
;(function(e,t){"use strict";function s(e){return new o(e)}function o(e){if(e&&e._wrapped)return e;this._wrapped=e}function u(){for(var e,t,n,s=-1,o=arguments.length,u={e:"",f:"",j:"",q:"",c:{d:""},n:{d:""}};++s<o;)for(t in e=arguments[s],e)n=(n=e[t])==r?"":n,/d|i/.test(t)?("string"==typeof n&&(n={b:n,m:n}),u.c[t]=n.b,u.n[t]=n.m):u[t]=n;e=u.a,t=/^[^,]+/.exec(e)[0],u.l=u.l||t,u.g=t,u.h=vt,u.k=bt,u.p=$,u.r=u.r!==i,"o"in u||(u.o=gt),u.f||(u.f="if(!"+t+")return A");if("f"!=t||!u.c.i)u.c=r;t="var A",u.
|
||||||
j&&(t+="="+u.j),t+=";"+u.f+";"+u.q+";var l,n="+u.l+";",u.c&&(t+="var p=n.length;l=-1;",u.n&&(t+="if(p===p>>>0){"),u.o&&(t+="if(I.call(n)==F){n=n.split('')}"),t+=u.c.d+";while(++l<p){"+u.c.i+"}",u.n&&(t+="}"));if(u.n){u.c&&(t+="else{"),u.h||(t+="var B=typeof n=='function'&&z.call(n,'prototype');"),u.k&&u.r?t+="var x=r(n),w=-1,p=x.length;"+u.n.d+";while(++w<p){l=x[w];if(!(B&&l=='prototype')){"+u.n.i+"}}":(t+=u.n.d+";for(l in n){",u.h?(u.r&&(t+="if(j.call(n,l)){"),t+=u.n.i+";",u.r&&(t+="}")):(t+="if(!(B&&l=='prototype')"
|
j&&(t+="="+u.j),t+=";"+u.f+";"+u.q+";var l,n="+u.l+";",u.c&&(t+="var p=n.length;l=-1;",u.n&&(t+="if(p===p>>>0){"),u.o&&(t+="if(I.call(n)==F){n=n.split('')}"),t+=u.c.d+";while(++l<p){"+u.c.i+"}",u.n&&(t+="}"));if(u.n){u.c&&(t+="else{"),u.h||(t+="var B=typeof n=='function'&&z.call(n,'prototype');"),u.k&&u.r?t+="var x=r(n),w=-1,p=x.length;"+u.n.d+";while(++w<p){l=x[w];if(!(B&&l=='prototype')){"+u.n.i+"}}":(t+=u.n.d+";for(l in n){",u.h?(u.r&&(t+="if(j.call(n,l)){"),t+=u.n.i+";",u.r&&(t+="}")):(t+="if(!(B&&l=='prototype')"
|
||||||
,u.r&&(t+="&&j.call(n,l)"),t+="){"+u.n.i+"}"),t+="}");if(u.h){t+="var h=n.constructor;";for(n=0;7>n;n++)t+="l='"+u.p[n]+"';if(","constructor"==u.p[n]&&(t+="!(h&&h.prototype===n)&&"),t+="j.call(n,l)){"+u.n.i+"}"}u.c&&(t+="}")}return t+=u.e+";return A",Function("c,g,i,j,k,o,u,r,z,C,F,I",'"use strict";return function('+e+"){"+t+"}")(ft,a,ht,et,k,h,Tt,at,nt,rt,vt,it)}function a(e,n){return e=e.a,n=n.a,e===t?1:n===t?-1:e<n?-1:e>n?1:0}function f(e,t){return Y[t]}function l(e){return"\\"+Nt[e]}function c
|
,u.r&&(t+="&&j.call(n,l)"),t+="){"+u.n.i+"}"),t+="}");if(u.h){t+="var h=n.constructor;";for(n=0;7>n;n++)t+="l='"+u.p[n]+"';if(","constructor"==u.p[n]&&(t+="!(h&&h.prototype===n)&&"),t+="j.call(n,l)){"+u.n.i+"}"}u.c&&(t+="}")}return t+=u.e+";return A",Function("c,g,i,j,k,o,u,r,z,C,F,I",'"use strict";return function('+e+"){"+t+"}")(ot,a,ft,G,k,h,Et,st,Z,et,ht,tt)}function a(e,n){return e=e.a,n=n.a,e===t?1:n===t?-1:e<n?-1:e>n?1:0}function f(e,t){return K[t]}function l(e){return"\\"+St[e]}function c(
|
||||||
(e){return xt[e]}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(){}function d(e,t){if(F.test(t))return"<e%-"+t+"%>";var n=Y.length;return Y[n]="'+__e("+t+")+'",G+n}function v(e,t,n,r){return e=Y.length,t?Y[e]="';"+t+";__p+='":n?Y[e]="'+__we("+n+")+'":r&&(Y[e]="'+((__wt=("+r+"))==null?'':__wt)+'"),G+e}function m(e,t){if(F.test(t))return"<e%="+t+"%>";var n=Y.length;return Y[n]="'+((__t=("+t+"))==null?'':__t)+'",G+n}function g(e,t,n,r){if(!e)return n;var i=e.length,s=3>arguments
|
e){return wt[e]}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(){}function d(e,t){if(F.test(t))return"<e%-"+t+"%>";var n=K.length;return K[n]="'+__e("+t+")+'",J+n}function v(e,t,n,r){return e=K.length,t?K[e]="';"+t+";__p+='":n?K[e]="'+__e("+n+")+'":r&&(K[e]="'+((__t=("+r+"))==null?'':__t)+'"),J+e}function m(e,t){if(F.test(t))return"<e%="+t+"%>";var n=K.length;return K[n]="'+((__t=("+t+"))==null?'':__t)+'",J+n}function g(e,t,n,r){if(!e)return n;var i=e.length,s=3>arguments
|
||||||
.length;r&&(t=h(t,r));if(i===i>>>0){var o=wt&&it.call(e)==vt?e.split(""):e;for(i&&s&&(n=o[--i]);i--;)n=t(n,o[i],i,e);return n}o=en(e);for((i=o.length)&&s&&(n=e[o[--i]]);i--;)s=o[i],n=t(n,e[s],s,e);return n}function y(e,t,n){if(e)return t==r||n?e[0]:rt.call(e,0,t)}function b(e,t){var n=[];if(!e)return n;for(var r,i=-1,s=e.length;++i<s;)r=e[i],Yt(r)?tt.apply(n,t?r:b(r)):n.push(r);return n}function w(e,t,n){if(!e)return-1;var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=x(e,t),e[r]===t?r:-1;
|
.length;r&&(t=h(t,r));if(i===i>>>0){var o=gt&&tt.call(e)==ht?e.split(""):e;for(i&&s&&(n=o[--i]);i--;)n=t(n,o[i],i,e);return n}o=Gt(e);for((i=o.length)&&s&&(n=e[o[--i]]);i--;)s=o[i],n=t(n,e[s],s,e);return n}function y(e,t,n){if(e)return t==r||n?e[0]:et.call(e,0,t)}function b(e,t){var n=[];if(!e)return n;for(var r,i=-1,s=e.length;++i<s;)r=e[i],Kt(r)?Y.apply(n,t?r:b(r)):n.push(r);return n}function w(e,t,n){if(!e)return-1;var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=x(e,t),e[r]===t?r:-1;r=
|
||||||
r=(0>n?Math.max(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function E(e,t,n){var r=-Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]>i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n>r&&(r=n,i=e[s]);return i}function S(e,t,n){return e?rt.call(e,t==r||n?1:t):[]}function x(e,t,n,r){if(!e)return 0;var i=0,s=e.length;if(n){r&&(n=N(n,r));for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+s>>>1,e[r]<t?i=r+1:s=r;return i}function T(e,t,n,r){var s=
|
(0>n?Math.max(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function E(e,t,n){var r=-Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]>i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n>r&&(r=n,i=e[s]);return i}function S(e,t,n){return e?et.call(e,t==r||n?1:t):[]}function x(e,t,n,r){if(!e)return 0;var i=0,s=e.length;if(n){r&&(n=N(n,r));for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+s>>>1,e[r]<t?i=r+1:s=r;return i}function T(e,t,n,r){var s=
|
||||||
[];if(!e)return s;var o=-1,u=e.length,a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n?r&&(n=h(n,r)):n=k;++o<u;)if(r=n(e[o],o,e),t?!o||a[a.length-1]!==r:0>w(a,r))a.push(r),s.push(e[o]);return s}function N(e,t){function n(){var o=arguments,u=t;return i||(e=t[r]),s.length&&(o=o.length?Z.apply(s,o):s),this instanceof n?(p.prototype=e.prototype,u=new p,(o=e.apply(u,o))&&Tt[typeof o]?o:u):e.apply(u,o)}var r,i=it.call(e)==ht;if(i){if(Et||st&&2<arguments.length)return st.call.apply(st,arguments)}else r=t,
|
[];if(!e)return s;var o=-1,u=e.length,a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n?r&&(n=h(n,r)):n=k;++o<u;)if(r=n(e[o],o,e),t?!o||a[a.length-1]!==r:0>w(a,r))a.push(r),s.push(e[o]);return s}function N(e,t){function n(){var o=arguments,u=t;return i||(e=t[r]),s.length&&(o=o.length?Q.apply(s,o):s),this instanceof n?(p.prototype=e.prototype,u=new p,(o=e.apply(u,o))&&Et[typeof o]?o:u):e.apply(u,o)}var r,i=tt.call(e)==ft;if(i){if(yt||nt&&2<arguments.length)return nt.call.apply(nt,arguments)}else r=t,
|
||||||
t=e;var s=rt.call(arguments,2);return n}function C(e,t,s){s||(s=[]);if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual&&it.call(e.isEqual)==ht)return e.isEqual(t);if(t.isEqual&&it.call(t.isEqual)==ht)return t.isEqual(e);var o=it.call(e);if(o!=it.call(t))return i;switch(o){case vt:return e==""+t;case pt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case lt:case ct:return+e==+t;case dt:return e.source==t.source&&e.global==t.global&&e.multiline==
|
t=e;var s=et.call(arguments,2);return n}function C(e,t,s){s||(s=[]);if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual&&tt.call(e.isEqual)==ft)return e.isEqual(t);if(t.isEqual&&tt.call(t.isEqual)==ft)return t.isEqual(e);var o=tt.call(e);if(o!=tt.call(t))return i;switch(o){case ht:return e==""+t;case lt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case ut:case at:return+e==+t;case ct:return e.source==t.source&&e.global==t.global&&e.multiline==
|
||||||
t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return i;for(var u=s.length;u--;)if(s[u]==e)return n;var u=-1,a=n,f=0;s.push(e);if(o==ft){if(f=e.length,a=f==t.length)for(;f--&&(a=C(e[f],t[f],s)););}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return i;for(var l in e)if(et.call(e,l)&&(f++,!(a=et.call(t,l)&&C(e[l],t[l],s))))break;if(a){for(l in t)if(et.call(t,l)&&!(f--))break;a=!f}if(a&&yt)for(;7>++u&&(l=Q[u],!et.call(e,l)||!!(a=et.call
|
t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return i;for(var u=s.length;u--;)if(s[u]==e)return n;var u=-1,a=n,f=0;s.push(e);if(o==ot){if(f=e.length,a=f==t.length)for(;f--&&(a=C(e[f],t[f],s)););}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return i;for(var l in e)if(G.call(e,l)&&(f++,!(a=G.call(t,l)&&C(e[l],t[l],s))))break;if(a){for(l in t)if(G.call(t,l)&&!(f--))break;a=!f}if(a&&vt)for(;7>++u&&(l=$[u],!G.call(e,l)||!!(a=G.call(t,l
|
||||||
(t,l)&&C(e[l],t[l],s))););}return s.pop(),a}function k(e){return e}function L(e){Ft(Gt(e),function(t){var r=s[t]=e[t];o.prototype[t]=function(){var e=[this._wrapped];return arguments.length&&tt.apply(e,arguments),e=r.apply(s,e),this._chain&&(e=new o(e),e._chain=n),e}})}var n=!0,r=null,i=!1,A,O,M,_,D="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),P=Array.prototype,H=Object.prototype,B=0,j=e._,F=/[-+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/
|
)&&C(e[l],t[l],s))););}return s.pop(),a}function k(e){return e}function L(e){Ht(Jt(e),function(t){var r=s[t]=e[t];o.prototype[t]=function(){var e=[this._wrapped];return arguments.length&&Y.apply(e,arguments),e=r.apply(s,e),this._chain&&(e=new o(e),e._chain=n),e}})}var n=!0,r=null,i=!1,A,O,M,_,D="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),P=Array.prototype,H=Object.prototype,B=0,j=e._,F=/[-+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/
|
||||||
,I=/^';/,q=/^'\+/,R=/(?:__p\+='|\+')$/,U=/\b__p\+='';/g,z=/\b(__p\+?=)''\+/g,W=/(__w?e\(.*?\)|\b__w?t\))\+'';/g,X=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,V=RegExp("^"+(H.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),$=/__token__(\d+)/g,J=/[&<"']/g,K=/['\n\r\t\u2028\u2029\\]/g,Q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="__token__",Y=[],Z=P.concat,et=H.hasOwnProperty,tt=P.push,nt=H
|
,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,z=RegExp("^"+(H.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),W=/__token__(\d+)/g,X=/[&<"']/g,V=/['\n\r\t\u2028\u2029\\]/g,$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),J="__token__",K=[],Q=P.concat,G=H.hasOwnProperty,Y=P.push,Z=H.propertyIsEnumerable,et=P.slice,tt=H.toString
|
||||||
.propertyIsEnumerable,rt=P.slice,it=H.toString,st=V.test(st=rt.bind)&&st,ot=V.test(ot=Array.isArray)&&ot,ut=e.isFinite,at=V.test(at=Object.keys)&&at,ft="[object Array]",lt="[object Boolean]",ct="[object Date]",ht="[object Function]",pt="[object Number]",dt="[object RegExp]",vt="[object String]",mt=e.clearTimeout,gt=e.setTimeout,yt=!nt.call({valueOf:0},"valueOf"),bt="x"!=rt.call("x")[0],wt="xx"!="x"[0]+Object("x")[0],Et=st&&/\n|Opera/.test(st+it.call(e.opera)),St=at&&/^.+$|true/.test(at+!!e.attachEvent
|
,nt=z.test(nt=et.bind)&&nt,rt=z.test(rt=Array.isArray)&&rt,it=e.isFinite,st=z.test(st=Object.keys)&&st,ot="[object Array]",ut="[object Boolean]",at="[object Date]",ft="[object Function]",lt="[object Number]",ct="[object RegExp]",ht="[object String]",pt=e.clearTimeout,dt=e.setTimeout,vt=!Z.call({valueOf:0},"valueOf"),mt="x"!=et.call("x")[0],gt="xx"!="x"[0]+Object("x")[0],yt=nt&&/\n|Opera/.test(nt+tt.call(e.opera)),bt=st&&/^.+$|true/.test(st+!!e.attachEvent),wt={"&":"&","<":"<",'"':""","'"
|
||||||
),xt={"&":"&","<":"<",'"':""","'":"'"},Tt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Nt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"};var Ct={a:"f,d,H",j:"f",q:"if(!d){d=k}else if(H)d=o(d,H)",i:"d(n[l],l,f)"},kt={j:"true",i:"if(!d(n[l],l,f))return!A"},Lt={a:"t",j:"t",q:"for(var D,E=1,p=arguments.length;E<p;E++){D=arguments[E];"+
|
:"'"},Et={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},St={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"};var xt={a:"f,d,H",j:"f",q:"if(!d){d=k}else if(H)d=o(d,H)",i:"d(n[l],l,f)"},Tt={j:"true",i:"if(!d(n[l],l,f))return!A"},Nt={a:"t",j:"t",q:"for(var D,E=1,p=arguments.length;E<p;E++){D=arguments[E];"+(vt?"if(D){":""),l:"D"
|
||||||
(yt?"if(D){":""),l:"D",r:i,i:"A[l]=n[l]",e:(yt?"}":"")+"}"},At={j:"[]",i:"d(n[l],l,f)&&A.push(n[l])"},Ot={q:"if(H)d=o(d,H)"},Mt={i:{m:Ct.i}},_t={j:"",f:"if(!f)return[]",d:{b:"A=Array(p)",m:"A="+(St?"Array(p)":"[]")},i:{b:"A[l]=d(n[l],l,f)",m:"A"+(St?"[w]=":".push")+"(d(n[l],l,f))"}},Dt=u({a:"t",f:"if(!(t&&u[typeof t]))throw TypeError()",j:"[]",i:"A.push(l)"}),Pt=u({a:"f,G",j:"false",o:i,d:{b:"if(I.call(n)==F)return f.indexOf(G)>-1"},i:"if(n[l]===G)return true"}),Ht=u(Ct,kt),Bt=u(Ct,At),jt=u(Ct,Ot
|
,r:i,i:"A[l]=n[l]",e:(vt?"}":"")+"}"},Ct={j:"[]",i:"d(n[l],l,f)&&A.push(n[l])"},kt={q:"if(H)d=o(d,H)"},Lt={i:{m:xt.i}},At={j:"",f:"if(!f)return[]",d:{b:"A=Array(p)",m:"A="+(bt?"Array(p)":"[]")},i:{b:"A[l]=d(n[l],l,f)",m:"A"+(bt?"[w]=":".push")+"(d(n[l],l,f))"}},Ot=u({a:"t",f:"if(!(t&&u[typeof t]))throw TypeError()",j:"[]",i:"A.push(l)"}),Mt=u({a:"f,G",j:"false",o:i,d:{b:"if(I.call(n)==F)return f.indexOf(G)>-1"},i:"if(n[l]===G)return true"}),_t=u(xt,Tt),Dt=u(xt,Ct),Pt=u(xt,kt,{j:"",i:"if(d(n[l],l,f))return n[l]"
|
||||||
,{j:"",i:"if(d(n[l],l,f))return n[l]"}),Ft=u(Ct,Ot),It=u(Ct,{j:"{}",q:"var v,m=typeof d=='function';if(m&&H)d=o(d,H)",i:"v=m?d(n[l],l,f):n[l][d];(j.call(A,v)?A[v]:A[v]=[]).push(n[l])"}),qt=u(_t,{a:"f,q",q:"var b=C.call(arguments,2),m=typeof q=='function'",i:{b:"A[l]=(m?q:n[l][q]).apply(n[l],b)",m:"A"+(St?"[w]=":".push")+"((m?q:n[l][q]).apply(n[l],b))"}}),Rt=u(Ct,_t),Ut=u(_t,{a:"f,y",i:{b:"A[l]=n[l][y]",m:"A"+(St?"[w]=":".push")+"(n[l][y])"}}),zt=u({a:"f,d,a,H",j:"a",q:"var s=arguments.length<3;if(H)d=o(d,H)"
|
}),Ht=u(xt,kt),Bt=u(xt,{j:"{}",q:"var v,m=typeof d=='function';if(m&&H)d=o(d,H)",i:"v=m?d(n[l],l,f):n[l][d];(j.call(A,v)?A[v]:A[v]=[]).push(n[l])"}),jt=u(At,{a:"f,q",q:"var b=C.call(arguments,2),m=typeof q=='function'",i:{b:"A[l]=(m?q:n[l][q]).apply(n[l],b)",m:"A"+(bt?"[w]=":".push")+"((m?q:n[l][q]).apply(n[l],b))"}}),Ft=u(xt,At),It=u(At,{a:"f,y",i:{b:"A[l]=n[l][y]",m:"A"+(bt?"[w]=":".push")+"(n[l][y])"}}),qt=u({a:"f,d,a,H",j:"a",q:"var s=arguments.length<3;if(H)d=o(d,H)",d:{b:"if(s)A=f[++l]"},i:
|
||||||
,d:{b:"if(s)A=f[++l]"},i:{b:"A=d(A,n[l],l,f)",m:"A=s?(s=false,n[l]):d(A,n[l],l,f)"}}),Wt=u(Ct,At,{i:"!"+At.i}),Xt=u(Ct,kt,{j:"false",i:kt.i.replace("!","")}),Vt=u(Ct,_t,{q:"if(typeof d=='string'){var v=d;d=function(f){return f[v]}}else if(H)d=o(d,H)",i:{b:"A[l]={a:d(n[l],l,f),b:n[l]}",m:"A"+(St?"[w]=":".push")+"({a:d(n[l],l,f),b:n[l]})"},e:"A.sort(g);p=A.length;while(p--){A[p]=A[p].b}"}),$t=u(Lt,{i:"if(A[l]==null)"+Lt.i}),Jt=u(Lt),Kt=u(Ct,Ot,Mt,{r:i}),Qt=u(Ct,Ot,Mt),Gt=u({a:"t",j:"[]",r:i,i:"if(I.call(n[l])==i)A.push(l)"
|
{b:"A=d(A,n[l],l,f)",m:"A=s?(s=false,n[l]):d(A,n[l],l,f)"}}),Rt=u(xt,Ct,{i:"!"+Ct.i}),Ut=u(xt,Tt,{j:"false",i:Tt.i.replace("!","")}),zt=u(xt,At,{q:"if(typeof d=='string'){var v=d;d=function(f){return f[v]}}else if(H)d=o(d,H)",i:{b:"A[l]={a:d(n[l],l,f),b:n[l]}",m:"A"+(bt?"[w]=":".push")+"({a:d(n[l],l,f),b:n[l]})"},e:"A.sort(g);p=A.length;while(p--){A[p]=A[p].b}"}),Wt=u(Nt,{i:"if(A[l]==null)"+Nt.i}),Xt=u(Nt),Vt=u(xt,kt,Lt,{r:i}),$t=u(xt,kt,Lt),Jt=u({a:"t",j:"[]",r:i,i:"if(I.call(n[l])==i)A.push(l)"
|
||||||
,e:"A.sort()"});Ft({Arguments:"[object Arguments]",Date:ct,Function:ht,Number:pt,RegExp:dt,String:vt},function(e,t){s["is"+t]=function(t){return it.call(t)==e}}),s.isArguments(arguments)||(s.isArguments=function(e){return!!e&&!!et.call(e,"callee")});var Yt=ot||function(e){return it.call(e)==ft},Zt=u({a:"J",j:"true",q:"var e=I.call(J);if(e==c||e==F)return!J.length",i:{m:"return false"}}),en=at?function(e){return"function"==typeof e&&nt.call(e,"prototype")?Dt(e):at(e)}:Dt,tn=u({a:"t",j:"[]",i:"A.push(n[l])"
|
,e:"A.sort()"});Ht({Arguments:"[object Arguments]",Date:at,Function:ft,Number:lt,RegExp:ct,String:ht},function(e,t){s["is"+t]=function(t){return tt.call(t)==e}}),s.isArguments(arguments)||(s.isArguments=function(e){return!!e&&!!G.call(e,"callee")});var Kt=rt||function(e){return tt.call(e)==ot},Qt=u({a:"J",j:"true",q:"var e=I.call(J);if(e==c||e==F)return!J.length",i:{m:"return false"}}),Gt=st?function(e){return"function"==typeof e&&Z.call(e,"prototype")?Ot(e):st(e)}:Ot,Yt=u({a:"t",j:"[]",i:"A.push(n[l])"
|
||||||
});s.VERSION="0.4.0",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=N,s.bindAll=function(e){var t=arguments,n=1;1==t.length&&(n=0,t=Gt(e));for(var r=t.length;n<r;n++)e[t[n]]=N(e[t[n]],e);return e},s.chain=function(e){return e=new o(e),e._chain=n,e},s.clone=function(e){return e&&Tt[typeof e]?Yt(e)?e.slice():Jt({},e):e},s.compact=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)e[n]&&t.push(e[n]);return t},s.compose=function(){var e=
|
});s.VERSION="0.4.1",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=N,s.bindAll=function(e){var t=arguments,n=1;1==t.length&&(n=0,t=Jt(e));for(var r=t.length;n<r;n++)e[t[n]]=N(e[t[n]],e);return e},s.chain=function(e){return e=new o(e),e._chain=n,e},s.clone=function(e){return e&&Et[typeof e]?Kt(e)?e.slice():Xt({},e):e},s.compact=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)e[n]&&t.push(e[n]);return t},s.compose=function(){var e=
|
||||||
arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=Pt,s.debounce=function(e,t,n){function i(){a=r,n||e.apply(u,s)}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,mt(a),a=gt(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=$t,s.defer=function(e){var n=rt.call(arguments,1);return gt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=rt.call(arguments,2);return gt(function(){return e.apply(t,r)},n)},s.difference=function(
|
arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=Mt,s.debounce=function(e,t,n){function i(){a=r,n||e.apply(u,s)}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,pt(a),a=dt(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=Wt,s.defer=function(e){var n=et.call(arguments,1);return dt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=et.call(arguments,2);return dt(function(){return e.apply(t,r)},n)},s.difference=function(
|
||||||
e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Z.apply(t,arguments);++n<r;)0>w(i,e[n],r)&&t.push(e[n]);return t},s.escape=function(e){return e==r?"":(e+"").replace(J,c)},s.every=Ht,s.extend=Jt,s.filter=Bt,s.find=jt,s.first=y,s.flatten=b,s.forEach=Ft,s.forIn=Kt,s.forOwn=Qt,s.functions=Gt,s.groupBy=It,s.has=function(e,t){return et.call(e,t)},s.identity=k,s.indexOf=w,s.initial=function(e,t,n){return e?rt.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=[];if(!e)return t;for(var n,
|
e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Q.apply(t,arguments);++n<r;)0>w(i,e[n],r)&&t.push(e[n]);return t},s.escape=function(e){return e==r?"":(e+"").replace(X,c)},s.every=_t,s.extend=Xt,s.filter=Dt,s.find=Pt,s.first=y,s.flatten=b,s.forEach=Ht,s.forIn=Vt,s.forOwn=$t,s.functions=Jt,s.groupBy=Bt,s.has=function(e,t){return G.call(e,t)},s.identity=k,s.indexOf=w,s.initial=function(e,t,n){return e?et.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=[];if(!e)return t;for(var n,r=-1
|
||||||
r=-1,i=e.length,s=rt.call(arguments,1);++r<i;)n=e[r],0>w(t,n)&&Ht(s,function(e){return-1<w(e,n)})&&t.push(n);return t},s.invoke=qt,s.isArray=Yt,s.isBoolean=function(e){return e===n||e===i||it.call(e)==lt},s.isElement=function(e){return!!e&&1==e.nodeType},s.isEmpty=Zt,s.isEqual=C,s.isFinite=function(e){return ut(e)&&it.call(e)==pt},s.isNaN=function(e){return it.call(e)==pt&&e!=+e},s.isNull=function(e){return e===r},s.isObject=function(e){return e&&Tt[typeof e]},s.isUndefined=function(e){return e===
|
,i=e.length,s=et.call(arguments,1);++r<i;)n=e[r],0>w(t,n)&&_t(s,function(e){return-1<w(e,n)})&&t.push(n);return t},s.invoke=jt,s.isArray=Kt,s.isBoolean=function(e){return e===n||e===i||tt.call(e)==ut},s.isElement=function(e){return!!e&&1==e.nodeType},s.isEmpty=Qt,s.isEqual=C,s.isFinite=function(e){return it(e)&&tt.call(e)==lt},s.isNaN=function(e){return tt.call(e)==lt&&e!=+e},s.isNull=function(e){return e===r},s.isObject=function(e){return e&&Et[typeof e]},s.isUndefined=function(e){return e===t},
|
||||||
t},s.keys=en,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:rt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){if(!e)return-1;var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?Math.max(0,r+n):Math.min(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=Rt,s.max=E,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return et.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.min=function(e,t,n){var r=Infinity,i=r;if(!e)return i;var s=-1,o=
|
s.keys=Gt,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:et.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){if(!e)return-1;var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?Math.max(0,r+n):Math.min(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=Ft,s.max=E,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return G.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.min=function(e,t,n){var r=Infinity,i=r;if(!e)return i;var s=-1,o=e.length
|
||||||
e.length;if(!t){for(;++s<o;)e[s]<i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n<r&&(r=n,i=e[s]);return i},s.mixin=L,s.noConflict=function(){return e._=j,this},s.once=function(e){var t,r=i;return function(){return r?t:(r=n,t=e.apply(this,arguments))}},s.partial=function(e){var t=rt.call(arguments,1),n=t.length;return function(){var r;return r=arguments,r.length&&(t.length=n,tt.apply(t,r)),r=1==t.length?e.call(this,t[0]):e.apply(this,t),t.length=n,r}},s.pick=function(e){for(var t,n=0
|
;if(!t){for(;++s<o;)e[s]<i&&(i=e[s]);return i}for(n&&(t=h(t,n));++s<o;)n=t(e[s],s,e),n<r&&(r=n,i=e[s]);return i},s.mixin=L,s.noConflict=function(){return e._=j,this},s.once=function(e){var t,r=i;return function(){return r?t:(r=n,t=e.apply(this,arguments))}},s.partial=function(e){var t=et.call(arguments,1),n=t.length;return function(){var r;return r=arguments,r.length&&(t.length=n,Y.apply(t,r)),r=1==t.length?e.call(this,t[0]):e.apply(this,t),t.length=n,r}},s.pick=function(e){for(var t,n=0,r=Q.apply
|
||||||
,r=Z.apply(P,arguments),i=r.length,s={};++n<i;)t=r[n],t in e&&(s[t]=e[t]);return s},s.pluck=Ut,s.range=function(e,t,n){n||(n=1),t==r&&(t=e||0,e=0);for(var i=-1,t=Math.max(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=zt,s.reduceRight=g,s.reject=Wt,s.rest=S,s.result=function(e,t){if(!e)return r;var n=e[t];return it.call(n)==ht?e[t]():n},s.shuffle=function(e){if(!e)return[];for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=Math.floor(Math.random()*(n+1)),i[n]=i[t],i[t]=e[n];return i
|
(P,arguments),i=r.length,s={};++n<i;)t=r[n],t in e&&(s[t]=e[t]);return s},s.pluck=It,s.range=function(e,t,n){n||(n=1),t==r&&(t=e||0,e=0);for(var i=-1,t=Math.max(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=qt,s.reduceRight=g,s.reject=Rt,s.rest=S,s.result=function(e,t){if(!e)return r;var n=e[t];return tt.call(n)==ft?e[t]():n},s.shuffle=function(e){if(!e)return[];for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=Math.floor(Math.random()*(n+1)),i[n]=i[t],i[t]=e[n];return i},s.size=
|
||||||
},s.size=function(e){if(!e)return 0;var t=e.length;return t===t>>>0?e.length:en(e).length},s.some=Xt,s.sortBy=Vt,s.sortedIndex=x,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){n||(n={});var i,o,u,a,c;i=n.escape,o=n.evaluate,u=n.interpolate;var h=s.templateSettings,n=n.variable;i==r&&(i=h.escape),o==r&&(o=h.evaluate),u==r&&(u=h.interpolate),i&&(e=e.replace(i,d)),u&&(e=e.replace(u,m)),o!=A&&(A=o,_=RegExp((o?o.source:"($^)")+"|<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>","g")),u=Y.length,e=
|
function(e){if(!e)return 0;var t=e.length;return t===t>>>0?e.length:Gt(e).length},s.some=Ut,s.sortBy=zt,s.sortedIndex=x,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){n||(n={});var i,o;i=n.escape;var u=n.evaluate,a=n.interpolate,c=s.templateSettings,n=n.variable;i==r&&(i=c.escape),u==r&&(u=c.evaluate),a==r&&(a=c.interpolate),i&&(e=e.replace(i,d)),a&&(e=e.replace(a,m)),u!=A&&(A=u,_=RegExp((u?u.source:"($^)")+"|<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>","g")),i=K.length,e=e.replace(_,v),
|
||||||
e.replace(_,v),i=Y.length-1,o=u<=i,!n&&(n=h.variable||O||"obj",c=o)&&(Y[u]="';__with("+n+"){"+Y[u].replace(I,"").replace(q,"__p+="),Y[i]=Y[i].replace(R,"")+"}____p+='"),h="$&"+n+".",e="__p='"+e.replace(K,l).replace($,f)+"';",Y.length=0,c&&(u=e.indexOf("__with"),i=e.indexOf("}__",u+10)),n!=O&&(O=n,M=RegExp("([(\\s])"+n+"\\."+n+"\\b","g")),e=(c?e.slice(0,u):e).replace(X,h).replace(M,"$1__d")+(c?e.slice(u+2,i+1)+e.slice(i+3).replace(X,h).replace(M,"$1__d"):""),e=(o?e.replace(U,""):e).replace(z,"$1")
|
i=i!=K.length,e="__p += '"+e.replace(V,l).replace(W,f)+"';",K.length=0,n||(n=c.variable||O||"obj",i?e="with("+n+"){"+e+"}":(n!=O&&(O=n,M=RegExp("(\\(\\s*)"+n+"\\."+n+"\\b","g")),e=e.replace(U,"$&"+n+".").replace(M,"$1__d"))),e=(i?e.replace(I,""):e).replace(q,"$1").replace(R,"$1;"),e="function("+n+"){"+n+"||("+n+"={});var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":",__d="+n+"."+n+"||"+n+";")+e+"return __p}";try{o=Function("_","return "+e)(
|
||||||
.replace(W,"$1;"),e="function("+n+"){"+n+"||("+n+"={});var __p,__t,__wt,__d="+n+"."+n+"||"+n+",__e=_.escape,__we=__e"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+e+"return __p}";try{a=Function("_","return "+e)(s)}catch(p){a=function(){throw p}}return t?a(t):(a.source=e,a)},s.throttle=function(e,t){function n(){a=new Date,u=r,e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=gt(n,f
|
s)}catch(h){o=function(){throw h}}return t?o(t):(o.source=e,o)},s.throttle=function(e,t){function n(){a=new Date,u=r,e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=dt(n,f)),s}},s.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r);else for(;++r<e;)t(r)},s.toArray=function(e){if(!e)return[];if(e.toArray&&tt.call(e.toArray)==ft)return e.toArray();var t=e.length;return t===t>>>0?(mt?tt.call(e)==ht:"string"==typeof
|
||||||
)),s}},s.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r);else for(;++r<e;)t(r)},s.toArray=function(e){if(!e)return[];if(e.toArray&&it.call(e.toArray)==ht)return e.toArray();var t=e.length;return t===t>>>0?(bt?it.call(e)==vt:"string"==typeof e)?e.split(""):rt.call(e):tn(e)},s.union=function(){for(var e=-1,t=[],n=Z.apply(t,arguments),r=n.length;++e<r;)0>w(t,n[e])&&t.push(n[e]);return t},s.uniq=T,s.uniqueId=function(e){var t=B++;return e?e+t:t},s.values=tn,s.without=function(e){var t=[];
|
e)?e.split(""):et.call(e):Yt(e)},s.union=function(){for(var e=-1,t=[],n=Q.apply(t,arguments),r=n.length;++e<r;)0>w(t,n[e])&&t.push(n[e]);return t},s.uniq=T,s.uniqueId=function(e){var t=B++;return e?e+t:t},s.values=Yt,s.without=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length;++n<r;)0>w(arguments,e[n],1)&&t.push(e[n]);return t},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&Y.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){if(!e)return[];for(var t=-1,n=
|
||||||
if(!e)return t;for(var n=-1,r=e.length;++n<r;)0>w(arguments,e[n],1)&&t.push(e[n]);return t},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&tt.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){if(!e)return[];for(var t=-1,n=E(Ut(arguments,"length")),r=Array(n);++t<n;)r[t]=Ut(arguments,t);return r},s.zipObject=function(e,t){if(!e)return{};var n=-1,r=e.length,i={};for(t||(t=[]);++n<r;)i[e[n]]=t[n];return i},s.all=Ht,s.any=Xt,s.collect=Rt,s.detect=jt,s.each=Ft,s.foldl=zt
|
E(It(arguments,"length")),r=Array(n);++t<n;)r[t]=It(arguments,t);return r},s.zipObject=function(e,t){if(!e)return{};var n=-1,r=e.length,i={};for(t||(t=[]);++n<r;)i[e[n]]=t[n];return i},s.all=_t,s.any=Ut,s.collect=Ft,s.detect=Pt,s.each=Ht,s.foldl=qt,s.foldr=g,s.head=y,s.include=Mt,s.inject=qt,s.methods=Jt,s.select=Dt,s.tail=S,s.take=y,s.unique=T,o.prototype=s.prototype,L(s),o.prototype.chain=function(){return this._chain=n,this},o.prototype.value=function(){return this._wrapped},Ht("pop push reverse shift sort splice unshift"
|
||||||
,s.foldr=g,s.head=y,s.include=Pt,s.inject=zt,s.methods=Gt,s.select=Bt,s.tail=S,s.take=y,s.unique=T,o.prototype=s.prototype,L(s),o.prototype.chain=function(){return this._chain=n,this},o.prototype.value=function(){return this._wrapped},Ft("pop push reverse shift sort splice unshift".split(" "),function(e){var t=P[e];o.prototype[e]=function(){var e=this._wrapped;return t.apply(e,arguments),e.length===0&&delete e[0],this._chain&&(e=new o(e),e._chain=n),e}}),Ft(["concat","join","slice"],function(e){var t=
|
.split(" "),function(e){var t=P[e];o.prototype[e]=function(){var e=this._wrapped;return t.apply(e,arguments),e.length===0&&delete e[0],this._chain&&(e=new o(e),e._chain=n),e}}),Ht(["concat","join","slice"],function(e){var t=P[e];o.prototype[e]=function(){var e=t.apply(this._wrapped,arguments);return this._chain&&(e=new o(e),e._chain=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):D?"object"==typeof module&&module&&module.s==D?(module
|
||||||
P[e];o.prototype[e]=function(){var e=t.apply(this._wrapped,arguments);return this._chain&&(e=new o(e),e._chain=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):D?"object"==typeof module&&module&&module.s==D?(module.s=s)._=s:D._=s:e._=s})(this);
|
.s=s)._=s:D._=s:e._=s})(this);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"description": "A drop-in replacement for Underscore.js that delivers performance improvements, bug fixes, and additional features.",
|
"description": "A drop-in replacement for Underscore.js that delivers performance improvements, bug fixes, and additional features.",
|
||||||
"homepage": "http://lodash.com",
|
"homepage": "http://lodash.com",
|
||||||
"main": "lodash",
|
"main": "lodash",
|
||||||
|
|||||||
27
test/test.js
27
test/test.js
@@ -771,9 +771,32 @@
|
|||||||
var compiled = _.template(key),
|
var compiled = _.template(key),
|
||||||
data = { 'a': 1, 'b': 2 };
|
data = { 'a': 1, 'b': 2 };
|
||||||
|
|
||||||
equal(compiled(data), value);
|
equal(compiled(data), value, key);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should allow referencing variables declared in "evaluate" delimiters from other delimiters', function() {
|
||||||
|
var compiled = _.template('<% var b = a; %><%= b.value %>'),
|
||||||
|
data = { 'a': { 'value': 1 } };
|
||||||
|
|
||||||
|
equal(compiled(data), '1');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should work when passing `options.variable`', function() {
|
||||||
|
var compiled = _.template(
|
||||||
|
'<% _.forEach( data.a, function( value ) { %>' +
|
||||||
|
'<%= value.valueOf() %>' +
|
||||||
|
'<% }) %>', null, { 'variable': 'data' }
|
||||||
|
);
|
||||||
|
|
||||||
|
var data = { 'a': [1, 2, 3] };
|
||||||
|
|
||||||
|
try {
|
||||||
|
equal(compiled(data), '123');
|
||||||
|
} catch(e) {
|
||||||
|
ok(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -842,7 +865,7 @@
|
|||||||
deepEqual(_.toArray(object), [-1]);
|
deepEqual(_.toArray(object), [-1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should work with a string for `collection` (test in IE < 9)', function() {
|
test('should work with a string for `collection` (test in Opera < 10.52)', function() {
|
||||||
deepEqual(_.toArray('abc'), ['a', 'b', 'c']);
|
deepEqual(_.toArray('abc'), ['a', 'b', 'c']);
|
||||||
deepEqual(_.toArray(Object('abc')), ['a', 'b', 'c']);
|
deepEqual(_.toArray(Object('abc')), ['a', 'b', 'c']);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user