mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e9cbccde6 | ||
|
|
a0cb8ec124 | ||
|
|
21217dfda3 | ||
|
|
25ba18e570 | ||
|
|
a210377f35 | ||
|
|
07b9ca457f | ||
|
|
5f1372d39c | ||
|
|
01b84c79f0 | ||
|
|
4017443b1e | ||
|
|
fd2a17d244 | ||
|
|
126804f7c3 |
62
README.md
62
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Lo-Dash <sup>v0.8.0</sup>
|
# Lo-Dash <sup>v0.8.1</sup>
|
||||||
[](http://travis-ci.org/bestiejs/lodash)
|
[](http://travis-ci.org/bestiejs/lodash)
|
||||||
|
|
||||||
A drop-in replacement<sup>[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer)</sup> for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features).
|
A drop-in replacement<sup>[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer)</sup> for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features).
|
||||||
@@ -7,10 +7,10 @@ Lo-Dash’s performance is gained by avoiding slower native methods, instead opt
|
|||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
* [Development build](https://raw.github.com/bestiejs/lodash/v0.8.0/lodash.js)
|
* [Development build](https://raw.github.com/bestiejs/lodash/v0.8.1/lodash.js)
|
||||||
* [Production build](https://raw.github.com/bestiejs/lodash/v0.8.0/lodash.min.js)
|
* [Production build](https://raw.github.com/bestiejs/lodash/v0.8.1/lodash.min.js)
|
||||||
* [Underscore build](https://raw.github.com/bestiejs/lodash/v0.8.0/lodash.underscore.min.js) tailored for projects already using Underscore
|
* [Underscore build](https://raw.github.com/bestiejs/lodash/v0.8.1/lodash.underscore.min.js) tailored for projects already using Underscore
|
||||||
* CDN copies of ≤ [v0.8.0](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.8.0/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
|
* CDN copies of ≤ [v0.8.1](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.8.1/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
|
||||||
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
||||||
|
|
||||||
## Dive in
|
## Dive in
|
||||||
@@ -197,21 +197,22 @@ require({
|
|||||||
|
|
||||||
## Resolved Underscore.js issues
|
## Resolved Underscore.js issues
|
||||||
|
|
||||||
* Add AMD loader support [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L118-140)]
|
* Add AMD loader support [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L118-140)]
|
||||||
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L510-516)]
|
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L510-516)]
|
||||||
* 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.8.0/test/test.js#L470-487)]
|
* Ensure *“Arrays”*, *“Collections”*, and *“Objects”* methods don’t error when passed falsey arguments [[#650](https://github.com/documentcloud/underscore/pull/650), [#803](https://github.com/documentcloud/underscore/issues/803), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L1729-1764)]
|
||||||
* Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L526-546)]
|
* 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.8.1/test/test.js#L470-487)]
|
||||||
* Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L142-148)]
|
* Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L526-546)]
|
||||||
* `_.clone` should allow `deep` cloning [[#595](https://github.com/documentcloud/underscore/pull/595), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L215-224)]
|
* Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L142-148)]
|
||||||
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L267-276)]
|
* `_.clone` should allow `deep` cloning [[#595](https://github.com/documentcloud/underscore/pull/595), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L215-224)]
|
||||||
* `_.extend` should recursively extend objects [[#379](https://github.com/documentcloud/underscore/pull/379), [#718](https://github.com/documentcloud/underscore/issues/718), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L946-968)]
|
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L267-276)]
|
||||||
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L465-468)]
|
* `_.extend` should recursively extend objects [[#379](https://github.com/documentcloud/underscore/pull/379), [#718](https://github.com/documentcloud/underscore/issues/718), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L955-977)]
|
||||||
* `_.forEach` should allow exiting iteration early [[#211](https://github.com/documentcloud/underscore/issues/211), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L556-570)]
|
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L465-468)]
|
||||||
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L703-708)]
|
* `_.forEach` should allow exiting iteration early [[#211](https://github.com/documentcloud/underscore/issues/211), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L553-570)]
|
||||||
* `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L763-775)]
|
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L712-717)]
|
||||||
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L856-858)]
|
* `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L772-784)]
|
||||||
* `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L1222-1225)]
|
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L865-867)]
|
||||||
* `_.throttle` should work when called in a loop [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/v0.8.0/test/test.js#L1525-1535)]
|
* `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L1231-1234)]
|
||||||
|
* `_.throttle` should work when called in a loop [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/v0.8.1/test/test.js#L1549-1559)]
|
||||||
|
|
||||||
## Optimized methods <sup>(50+)</sup>
|
## Optimized methods <sup>(50+)</sup>
|
||||||
|
|
||||||
@@ -274,25 +275,10 @@ require({
|
|||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
### <sup>v0.8.0</sup>
|
### <sup>v0.8.1</sup>
|
||||||
|
|
||||||
#### Compatibility Warnings ####
|
* Made `underscore` build include deep clone when `clone` is requested via `include` or `plus`
|
||||||
|
* Reverted removal of first argument falsey checks from methods
|
||||||
* Made `_.random` return `0` or `1` when no arguments are passed
|
|
||||||
* Moved late bind functionality from `_.bind` to [_.lateBind](http://lodash.com/docs#lateBind)
|
|
||||||
* Removed first argument falsey checks from methods
|
|
||||||
* Removed support for custom `clone`, `isEqual`, `toArray` methods from<br>
|
|
||||||
`_.clone`, `_.isEqual`, and `_.toArray`
|
|
||||||
|
|
||||||
#### Changes ####
|
|
||||||
|
|
||||||
* Added `-d`/`--debug`, `-m/--minify`, `minus`, `plus`, `settings`, and `template` build options
|
|
||||||
* Added `_.isPlainObject` and `_.lateBind`
|
|
||||||
* Allowed `_.sortedIndex` to accept a property name as the `callback` argument
|
|
||||||
* Ensured methods accept a `thisArg` of `null`
|
|
||||||
* Fixed the `iife` build option to accept more values
|
|
||||||
* Made `_.times` return an array of `callback` results
|
|
||||||
* Simplified `_.max`, `_.min`, and `_.reduceRight`
|
|
||||||
|
|
||||||
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||||
|
|
||||||
|
|||||||
114
build.js
114
build.js
@@ -542,7 +542,7 @@
|
|||||||
function matchFunction(source, funcName) {
|
function matchFunction(source, funcName) {
|
||||||
var result = source.match(RegExp(
|
var result = source.match(RegExp(
|
||||||
// match multi-line comment block (could be on a single line)
|
// match multi-line comment block (could be on a single line)
|
||||||
'\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/\\n' +
|
'(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/\\n)?' +
|
||||||
// begin non-capturing group
|
// begin non-capturing group
|
||||||
'(?:' +
|
'(?:' +
|
||||||
// match a function declaration
|
// match a function declaration
|
||||||
@@ -684,7 +684,7 @@
|
|||||||
// remove `isKeysFast` from `inLoop.object` of `mapIteratorOptions`, `invoke`, `pairs`, `pluck`, and `sortBy`
|
// remove `isKeysFast` from `inLoop.object` of `mapIteratorOptions`, `invoke`, `pairs`, `pluck`, and `sortBy`
|
||||||
.replace(/'\s*\+\s*\(isKeysFast[^)]+?\)\s*\+\s*'/g, '.push')
|
.replace(/'\s*\+\s*\(isKeysFast[^)]+?\)\s*\+\s*'/g, '.push')
|
||||||
// remove data object property assignment in `createIterator`
|
// remove data object property assignment in `createIterator`
|
||||||
.replace(/\s*.+?\.isKeysFast *=.+/, '');
|
.replace(/ *'isKeysFast':.+\n/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -733,16 +733,12 @@
|
|||||||
source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?(true;\\n)'), '$1$2');
|
source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?(true;\\n)'), '$1$2');
|
||||||
}
|
}
|
||||||
source = source.replace(RegExp(
|
source = source.replace(RegExp(
|
||||||
// begin non-capturing group
|
|
||||||
'(?:' +
|
|
||||||
// match multi-line comment block
|
// match multi-line comment block
|
||||||
'(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' +
|
'(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' +
|
||||||
// match a variable declaration that's not part of a declaration list
|
// match a variable declaration that's not part of a declaration list
|
||||||
'( +)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' +
|
'( +)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' +
|
||||||
// match a variable in a declaration list
|
// match a variable in a declaration list
|
||||||
'\\n +' + varName + ' *=.+?,' +
|
'\\n +' + varName + ' *=.+?,'
|
||||||
// end non-capturing group
|
|
||||||
')'
|
|
||||||
), '');
|
), '');
|
||||||
|
|
||||||
// remove a varaible at the start of a variable declaration list
|
// remove a varaible at the start of a variable declaration list
|
||||||
@@ -799,10 +795,8 @@
|
|||||||
.replace(/(?: *\/\/.*\n)*(\s*)' *<% *if *\(useStrict\).+/, value ? "$1'\\'use strict\\';\\n' +" : '')
|
.replace(/(?: *\/\/.*\n)*(\s*)' *<% *if *\(useStrict\).+/, value ? "$1'\\'use strict\\';\\n' +" : '')
|
||||||
// remove `useStrict` from iterator options
|
// remove `useStrict` from iterator options
|
||||||
.replace(/ *'useStrict': *false,\n/g, '')
|
.replace(/ *'useStrict': *false,\n/g, '')
|
||||||
// remove `useStrict` variable assignment in `createIterator`
|
|
||||||
.replace(/,\s*useStrict *=[^;]+/, '')
|
|
||||||
// remove `useStrict` data object property assignment in `createIterator`
|
// remove `useStrict` data object property assignment in `createIterator`
|
||||||
.replace(/\s*.+?\.useStrict *=.+/, '');
|
.replace(/ *'useStrict':.+\n/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -954,6 +948,9 @@
|
|||||||
// flag used to specify if the build should include the "use strict" directive
|
// flag used to specify if the build should include the "use strict" directive
|
||||||
var useStrict = isStrict || !(isLegacy || isMobile);
|
var useStrict = isStrict || !(isLegacy || isMobile);
|
||||||
|
|
||||||
|
// flag used to specify replacing Lo-Dash's `_.clone` with Underscore's
|
||||||
|
var useUnderscoreClone = isUnderscore;
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// names of methods to include in the build
|
// names of methods to include in the build
|
||||||
@@ -978,6 +975,11 @@
|
|||||||
(result = getDependencies(optionToMethodsArray(source, value)));
|
(result = getDependencies(optionToMethodsArray(source, value)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// use Lo-Dash's clone if explicitly requested
|
||||||
|
if (result && result.indexOf('clone') > -1) {
|
||||||
|
useUnderscoreClone = false;
|
||||||
|
}
|
||||||
|
|
||||||
// add method names required by Backbone and Underscore builds
|
// add method names required by Backbone and Underscore builds
|
||||||
if (isBackbone && !result) {
|
if (isBackbone && !result) {
|
||||||
result = getDependencies(backboneDependencies);
|
result = getDependencies(backboneDependencies);
|
||||||
@@ -1042,7 +1044,6 @@
|
|||||||
}
|
}
|
||||||
else if (isUnderscore) {
|
else if (isUnderscore) {
|
||||||
// update dependencies
|
// update dependencies
|
||||||
dependencyMap.clone = ['extend', 'isArray'];
|
|
||||||
dependencyMap.isEqual = ['isArray', 'isFunction'];
|
dependencyMap.isEqual = ['isArray', 'isFunction'];
|
||||||
dependencyMap.isEmpty = ['isArray'];
|
dependencyMap.isEmpty = ['isArray'];
|
||||||
|
|
||||||
@@ -1050,17 +1051,79 @@
|
|||||||
source = removeVar(source, 'arrayLikeClasses');
|
source = removeVar(source, 'arrayLikeClasses');
|
||||||
source = removeVar(source, 'cloneableClasses');
|
source = removeVar(source, 'cloneableClasses');
|
||||||
|
|
||||||
// remove large array optimizations from `cachedContains`
|
// remove large array optimizations
|
||||||
source = source.replace(/( +)function cachedContains[\s\S]+?\n\1}/, [
|
source = removeFunction(source, 'cachedContains');
|
||||||
' function cachedContains(array, fromIndex) {',
|
source = removeVar(source, 'largeArraySize');
|
||||||
' return function(value) {',
|
|
||||||
' return indexOf(array, value, fromIndex || 0) > -1;',
|
// replace `_.clone`
|
||||||
' };',
|
if (useUnderscoreClone) {
|
||||||
|
dependencyMap.clone = ['extend', 'isArray'];
|
||||||
|
source = source.replace(/^( +)function clone[\s\S]+?\n\1}/m, [
|
||||||
|
' function clone(value) {',
|
||||||
|
' return value && objectTypes[typeof value]',
|
||||||
|
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
||||||
|
' : value',
|
||||||
|
' }'
|
||||||
|
].join('\n'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// replace `_.difference`
|
||||||
|
source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [
|
||||||
|
' function difference(array) {',
|
||||||
|
' var index = -1,',
|
||||||
|
' length = array.length,',
|
||||||
|
' flattened = concat.apply(ArrayProto, arguments),',
|
||||||
|
' result = [];',
|
||||||
|
'',
|
||||||
|
' while (++index < length) {',
|
||||||
|
' var value = array[index]',
|
||||||
|
' if (indexOf(flattened, value, length) < 0) {',
|
||||||
|
' result.push(value);',
|
||||||
|
' }',
|
||||||
|
' }',
|
||||||
|
' return result',
|
||||||
' }'
|
' }'
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
|
|
||||||
// reduce the number of arguments passed to `cachedContains` from 3 to 2
|
// replace `_.intersection`
|
||||||
source = source.replace(/(cachedContains\(\w+, *\w+), *\w+/g, '$1');
|
source = source.replace(/^( +)function intersection[\s\S]+?\n\1}/m, [
|
||||||
|
' function intersection(array) {',
|
||||||
|
' var argsLength = arguments.length,',
|
||||||
|
' index = -1,',
|
||||||
|
' length = array.length,',
|
||||||
|
' result = [];',
|
||||||
|
'',
|
||||||
|
' array: while (++index < length) {',
|
||||||
|
' var value = array[index]',
|
||||||
|
' if (indexOf(result, value) < 0) {',
|
||||||
|
' for (var argsIndex = 1; argsIndex < argsLength; argsIndex++) {',
|
||||||
|
' if (indexOf(arguments[argsIndex], value) < 0) {',
|
||||||
|
' continue array;',
|
||||||
|
' }',
|
||||||
|
' }',
|
||||||
|
' result.push(value);',
|
||||||
|
' }',
|
||||||
|
' }',
|
||||||
|
' return result',
|
||||||
|
' }'
|
||||||
|
].join('\n'));
|
||||||
|
|
||||||
|
// replace `_.without`
|
||||||
|
source = source.replace(/^( +)function without[\s\S]+?\n\1}/m, [
|
||||||
|
' function without(array) {',
|
||||||
|
' var index = -1,',
|
||||||
|
' length = array.length,',
|
||||||
|
' result = [];',
|
||||||
|
'',
|
||||||
|
' while (++index < length) {',
|
||||||
|
' var value = array[index]',
|
||||||
|
' if (indexOf(arguments, value, 1) < 0) {',
|
||||||
|
' result.push(value);',
|
||||||
|
' }',
|
||||||
|
' }',
|
||||||
|
' return result',
|
||||||
|
' }'
|
||||||
|
].join('\n'));
|
||||||
|
|
||||||
// replace `arrayLikeClasses` in `_.isEmpty`
|
// replace `arrayLikeClasses` in `_.isEmpty`
|
||||||
source = source.replace(/'if *\(arrayLikeClasses[\s\S]+?' \|\|\\n/, "'if (isArray(value) || className == stringClass ||");
|
source = source.replace(/'if *\(arrayLikeClasses[\s\S]+?' \|\|\\n/, "'if (isArray(value) || className == stringClass ||");
|
||||||
@@ -1069,19 +1132,10 @@
|
|||||||
source = source.replace(/(?: *\/\/.*\n)*( +)var isArr *= *arrayLikeClasses[^}]+}/, '$1var isArr = isArray(a);');
|
source = source.replace(/(?: *\/\/.*\n)*( +)var isArr *= *arrayLikeClasses[^}]+}/, '$1var isArr = isArray(a);');
|
||||||
|
|
||||||
// remove "exit early" feature from `_.each`
|
// remove "exit early" feature from `_.each`
|
||||||
source = source.replace(/( )+var baseIteratorOptions *=[\s\S]+?\n\1.+?;/, function(match) {
|
source = source.replace(/( +)var baseIteratorOptions *=[\s\S]+?\n\1.+?;/, function(match) {
|
||||||
return match.replace(/if *\(callback[^']+/, 'callback(value, index, collection)');
|
return match.replace(/if *\(callback[^']+/, 'callback(value, index, collection)');
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove `deep` clone functionality
|
|
||||||
source = source.replace(/( +)function clone[\s\S]+?\n\1}/, [
|
|
||||||
' function clone(value) {',
|
|
||||||
' return value && objectTypes[typeof value]',
|
|
||||||
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
|
||||||
' : value',
|
|
||||||
' }'
|
|
||||||
].join('\n'));
|
|
||||||
|
|
||||||
// remove unused features from `createBound`
|
// remove unused features from `createBound`
|
||||||
if (buildMethods.indexOf('partial') == -1) {
|
if (buildMethods.indexOf('partial') == -1) {
|
||||||
source = source.replace(matchFunction(source, 'createBound'), function(match) {
|
source = source.replace(matchFunction(source, 'createBound'), function(match) {
|
||||||
@@ -1180,6 +1234,8 @@
|
|||||||
source = removeFromCreateIterator(source, 'nativeKeys');
|
source = removeFromCreateIterator(source, 'nativeKeys');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
// inline all functions defined with `createIterator`
|
// inline all functions defined with `createIterator`
|
||||||
_.functions(lodash).forEach(function(methodName) {
|
_.functions(lodash).forEach(function(methodName) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
'lodash':
|
'lodash':
|
||||||
'/*!\n' +
|
'/*!\n' +
|
||||||
' Lo-Dash @VERSION lodash.com/license\n' +
|
' Lo-Dash @VERSION lodash.com/license\n' +
|
||||||
' Underscore.js 1.4.0 underscorejs.org/LICENSE\n' +
|
' Underscore.js 1.4.1 underscorejs.org/LICENSE\n' +
|
||||||
'*/',
|
'*/',
|
||||||
'underscore':
|
'underscore':
|
||||||
'/*! Underscore.js @VERSION underscorejs.org/LICENSE */'
|
'/*! Underscore.js @VERSION underscorejs.org/LICENSE */'
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
'createCallback',
|
'createCallback',
|
||||||
'ctor',
|
'ctor',
|
||||||
'hasOwnProperty',
|
'hasOwnProperty',
|
||||||
'identity',
|
|
||||||
'index',
|
'index',
|
||||||
'iteratee',
|
'iteratee',
|
||||||
'length',
|
'length',
|
||||||
|
|||||||
196
doc/README.md
196
doc/README.md
@@ -1,4 +1,4 @@
|
|||||||
# Lo-Dash <sup>v0.8.0</sup>
|
# Lo-Dash <sup>v0.8.1</sup>
|
||||||
|
|
||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
@@ -174,7 +174,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#L3993 "View in source") [Ⓣ][1]
|
<a href="#_version">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4002 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
*(String)*: The semantic version number.
|
*(String)*: The semantic version number.
|
||||||
|
|
||||||
@@ -186,7 +186,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#L3100 "View in source") [Ⓣ][1]
|
<a href="#_aftern-func">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3108 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that is restricted to executing only after it is called `n` times.
|
Creates a function that is restricted to executing only after it is called `n` times.
|
||||||
|
|
||||||
@@ -214,7 +214,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#L3133 "View in source") [Ⓣ][1]
|
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3141 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function.
|
Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function.
|
||||||
|
|
||||||
@@ -245,7 +245,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#L3163 "View in source") [Ⓣ][1]
|
<a href="#_bindallobject--methodname1-methodname2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3171 "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.
|
||||||
|
|
||||||
@@ -276,7 +276,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#L3918 "View in source") [Ⓣ][1]
|
<a href="#_chainvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3927 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Wraps the value in a `lodash` wrapper object.
|
Wraps the value in a `lodash` wrapper object.
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ var youngest = _.chain(stooges)
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_clonevalue-deep"></a>`_.clone(value, deep)`
|
### <a id="_clonevalue-deep"></a>`_.clone(value, deep)`
|
||||||
<a href="#_clonevalue-deep">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1045 "View in source") [Ⓣ][1]
|
<a href="#_clonevalue-deep">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1039 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a clone of `value`. If `deep` is `true`, all nested objects will also be cloned otherwise they will be assigned by reference. Functions, DOM nodes, `arguments` objects, and objects created by constructors other than `Object` are **not** cloned.
|
Creates a clone of `value`. If `deep` is `true`, all nested objects will also be cloned otherwise they will be assigned by reference. Functions, DOM nodes, `arguments` objects, and objects created by constructors other than `Object` are **not** cloned.
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ shallow[0] === stooges[0];
|
|||||||
<!-- 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#L2412 "View in source") [Ⓣ][1]
|
<a href="#_compactarray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2413 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
|
Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
|
||||||
|
|
||||||
@@ -373,7 +373,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#L3200 "View in source") [Ⓣ][1]
|
<a href="#_composefunc1-func2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3208 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a 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 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()))`.
|
||||||
|
|
||||||
@@ -400,7 +400,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#L1894 "View in source") [Ⓣ][1]
|
<a href="#_containscollection-target">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1892 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`.
|
Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ _.contains('curly', 'ur');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_countbycollection-callbackproperty--thisarg"></a>`_.countBy(collection, callback|property [, thisArg])`
|
### <a id="_countbycollection-callbackproperty--thisarg"></a>`_.countBy(collection, callback|property [, thisArg])`
|
||||||
<a href="#_countbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1930 "View in source") [Ⓣ][1]
|
<a href="#_countbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1928 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is the number of times the key was returned by `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to count by *(e.g. 'length')*.
|
Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is the number of times the key was returned by `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to count by *(e.g. 'length')*.
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ _.countBy(['one', 'two', 'three'], 'length');
|
|||||||
<!-- 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#L3233 "View in source") [Ⓣ][1]
|
<a href="#_debouncefunc-wait-immediate">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3241 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
|
Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
|
||||||
|
|
||||||
@@ -492,7 +492,7 @@ jQuery(window).on('resize', lazyLayout);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_defaultsobject--default1-default2-"></a>`_.defaults(object [, default1, default2, ...])`
|
### <a id="_defaultsobject--default1-default2-"></a>`_.defaults(object [, default1, default2, ...])`
|
||||||
<a href="#_defaultsobject--default1-default2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1138 "View in source") [Ⓣ][1]
|
<a href="#_defaultsobject--default1-default2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1132 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Assigns enumerable properties of the default object(s) to the `destination` object for all `destination` properties that resolve to `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored.
|
Assigns enumerable properties of the default object(s) to the `destination` object for all `destination` properties that resolve to `null`/`undefined`. Once a property is set, additional defaults of the same property will be ignored.
|
||||||
|
|
||||||
@@ -518,7 +518,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#L3298 "View in source") [Ⓣ][1]
|
<a href="#_deferfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3306 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked.
|
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked.
|
||||||
|
|
||||||
@@ -543,7 +543,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#L3278 "View in source") [Ⓣ][1]
|
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3286 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked.
|
Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked.
|
||||||
|
|
||||||
@@ -570,7 +570,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#L2441 "View in source") [Ⓣ][1]
|
<a href="#_differencearray--array1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2442 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -595,7 +595,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#L3518 "View in source") [Ⓣ][1]
|
<a href="#_escapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3526 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
|
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
|
||||||
|
|
||||||
@@ -619,7 +619,7 @@ _.escape('Moe, Larry & Curly');
|
|||||||
<!-- 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#L1951 "View in source") [Ⓣ][1]
|
<a href="#_everycollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1949 "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 three arguments; *(value, index|key, collection)*.
|
Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||||
|
|
||||||
@@ -648,7 +648,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#L1158 "View in source") [Ⓣ][1]
|
<a href="#_extendobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1152 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Assigns enumerable properties of the source object(s) to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
Assigns enumerable properties of the source object(s) to the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
||||||
|
|
||||||
@@ -673,7 +673,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#L1971 "View in source") [Ⓣ][1]
|
<a href="#_filtercollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1969 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||||
|
|
||||||
@@ -702,7 +702,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#L1993 "View in source") [Ⓣ][1]
|
<a href="#_findcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1991 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Examines each element in a `collection`, returning the first one the `callback` returns truthy for. The function returns as soon as it finds an acceptable element, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
Examines each element in a `collection`, returning the first one the `callback` returns truthy for. The function returns as soon as it finds an acceptable element, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||||
|
|
||||||
@@ -731,7 +731,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_firstarray--n"></a>`_.first(array [, n])`
|
### <a id="_firstarray--n"></a>`_.first(array [, n])`
|
||||||
<a href="#_firstarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2475 "View in source") [Ⓣ][1]
|
<a href="#_firstarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2480 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the first element of the `array`. Pass `n` to return the first `n` elements of the `array`.
|
Gets the first element of the `array`. Pass `n` to return the first `n` elements of the `array`.
|
||||||
|
|
||||||
@@ -759,7 +759,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#L2497 "View in source") [Ⓣ][1]
|
<a href="#_flattenarray-shallow">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2504 "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.
|
||||||
|
|
||||||
@@ -787,7 +787,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#L2020 "View in source") [Ⓣ][1]
|
<a href="#_foreachcollection-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2018 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`.
|
Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||||
|
|
||||||
@@ -819,7 +819,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#L1188 "View in source") [Ⓣ][1]
|
<a href="#_forinobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1182 "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 three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||||
|
|
||||||
@@ -855,7 +855,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#L1212 "View in source") [Ⓣ][1]
|
<a href="#_forownobject-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1206 "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 three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
Iterates over `object`'s own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`.
|
||||||
|
|
||||||
@@ -883,7 +883,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#L1229 "View in source") [Ⓣ][1]
|
<a href="#_functionsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1223 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values.
|
Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values.
|
||||||
|
|
||||||
@@ -910,7 +910,7 @@ _.functions(_);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_groupbycollection-callbackproperty--thisarg"></a>`_.groupBy(collection, callback|property [, thisArg])`
|
### <a id="_groupbycollection-callbackproperty--thisarg"></a>`_.groupBy(collection, callback|property [, thisArg])`
|
||||||
<a href="#_groupbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2048 "View in source") [Ⓣ][1]
|
<a href="#_groupbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2046 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to count by *(e.g. 'length')*.
|
Creates an object composed of keys returned from running each element of `collection` through a `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to count by *(e.g. 'length')*.
|
||||||
|
|
||||||
@@ -942,7 +942,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#L1252 "View in source") [Ⓣ][1]
|
<a href="#_hasobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1246 "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.
|
||||||
|
|
||||||
@@ -967,7 +967,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#L3538 "View in source") [Ⓣ][1]
|
<a href="#_identityvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3546 "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.
|
||||||
|
|
||||||
@@ -992,7 +992,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#L2540 "View in source") [Ⓣ][1]
|
<a href="#_indexofarray-value--fromindex0">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2547 "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.
|
||||||
|
|
||||||
@@ -1024,7 +1024,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_initialarray--n"></a>`_.initial(array [, n])`
|
### <a id="_initialarray--n"></a>`_.initial(array [, n])`
|
||||||
<a href="#_initialarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2577 "View in source") [Ⓣ][1]
|
<a href="#_initialarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2582 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets all but the last element of `array`. Pass `n` to exclude the last `n` elements from the result.
|
Gets all but the last element of `array`. Pass `n` to exclude the last `n` elements from the result.
|
||||||
|
|
||||||
@@ -1049,7 +1049,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#L2596 "View in source") [Ⓣ][1]
|
<a href="#_intersectionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2603 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -1073,7 +1073,7 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_invertobject"></a>`_.invert(object)`
|
### <a id="_invertobject"></a>`_.invert(object)`
|
||||||
<a href="#_invertobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L819 "View in source") [Ⓣ][1]
|
<a href="#_invertobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L814 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an object composed of the inverted keys and values of the given `object`.
|
Creates an object composed of the inverted keys and values of the given `object`.
|
||||||
|
|
||||||
@@ -1097,7 +1097,7 @@ _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' });
|
|||||||
<!-- 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#L2076 "View in source") [Ⓣ][1]
|
<a href="#_invokecollection-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2074 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`.
|
Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`.
|
||||||
|
|
||||||
@@ -1126,7 +1126,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#L841 "View in source") [Ⓣ][1]
|
<a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L836 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is an `arguments` object.
|
Checks if `value` is an `arguments` object.
|
||||||
|
|
||||||
@@ -1153,7 +1153,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#L867 "View in source") [Ⓣ][1]
|
<a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L862 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is an array.
|
Checks if `value` is an array.
|
||||||
|
|
||||||
@@ -1180,7 +1180,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#L1269 "View in source") [Ⓣ][1]
|
<a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1263 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a boolean *(`true` or `false`)* value.
|
Checks if `value` is a boolean *(`true` or `false`)* value.
|
||||||
|
|
||||||
@@ -1204,7 +1204,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#L1286 "View in source") [Ⓣ][1]
|
<a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1280 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a date.
|
Checks if `value` is a date.
|
||||||
|
|
||||||
@@ -1228,7 +1228,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#L1303 "View in source") [Ⓣ][1]
|
<a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1297 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a DOM element.
|
Checks if `value` is a DOM element.
|
||||||
|
|
||||||
@@ -1252,7 +1252,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#L1328 "View in source") [Ⓣ][1]
|
<a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1322 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty".
|
Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty".
|
||||||
|
|
||||||
@@ -1282,7 +1282,7 @@ _.isEmpty('');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isequala-b"></a>`_.isEqual(a, b)`
|
### <a id="_isequala-b"></a>`_.isEqual(a, b)`
|
||||||
<a href="#_isequala-b">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1368 "View in source") [Ⓣ][1]
|
<a href="#_isequala-b">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1361 "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.
|
||||||
|
|
||||||
@@ -1313,7 +1313,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#L1525 "View in source") [Ⓣ][1]
|
<a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1518 "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.
|
||||||
|
|
||||||
@@ -1343,7 +1343,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#L884 "View in source") [Ⓣ][1]
|
<a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L879 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a function.
|
Checks if `value` is a function.
|
||||||
|
|
||||||
@@ -1367,7 +1367,7 @@ _.isFunction(_);
|
|||||||
<!-- 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#L1583 "View in source") [Ⓣ][1]
|
<a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1576 "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.
|
||||||
|
|
||||||
@@ -1400,7 +1400,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#L1606 "View in source") [Ⓣ][1]
|
<a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1599 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is `null`.
|
Checks if `value` is `null`.
|
||||||
|
|
||||||
@@ -1427,7 +1427,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#L1623 "View in source") [Ⓣ][1]
|
<a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1616 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a number.
|
Checks if `value` is a number.
|
||||||
|
|
||||||
@@ -1451,7 +1451,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#L1549 "View in source") [Ⓣ][1]
|
<a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1542 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
|
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
|
||||||
|
|
||||||
@@ -1481,7 +1481,7 @@ _.isObject(1);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
|
### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
|
||||||
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L918 "View in source") [Ⓣ][1]
|
<a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L913 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if a given `value` is an object created by the `Object` constructor.
|
Checks if a given `value` is an object created by the `Object` constructor.
|
||||||
|
|
||||||
@@ -1516,7 +1516,7 @@ _.isPlainObject({ 'name': 'moe', 'age': 40 });
|
|||||||
<!-- 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#L1640 "View in source") [Ⓣ][1]
|
<a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1633 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a regular expression.
|
Checks if `value` is a regular expression.
|
||||||
|
|
||||||
@@ -1540,7 +1540,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#L1657 "View in source") [Ⓣ][1]
|
<a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1650 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is a string.
|
Checks if `value` is a string.
|
||||||
|
|
||||||
@@ -1564,7 +1564,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#L1675 "View in source") [Ⓣ][1]
|
<a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1668 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Checks if `value` is `undefined`.
|
Checks if `value` is `undefined`.
|
||||||
|
|
||||||
@@ -1588,7 +1588,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#L1692 "View in source") [Ⓣ][1]
|
<a href="#_keysobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1685 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array composed of the own enumerable property names of `object`.
|
Creates an array composed of the own enumerable property names of `object`.
|
||||||
|
|
||||||
@@ -1612,7 +1612,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_lastarray--n"></a>`_.last(array [, n])`
|
### <a id="_lastarray--n"></a>`_.last(array [, n])`
|
||||||
<a href="#_lastarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2636 "View in source") [Ⓣ][1]
|
<a href="#_lastarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2642 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the last element of the `array`. Pass `n` to return the last `n` elements of the `array`.
|
Gets the last element of the `array`. Pass `n` to return the last `n` elements of the `array`.
|
||||||
|
|
||||||
@@ -1637,7 +1637,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#L2660 "View in source") [Ⓣ][1]
|
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2668 "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. `===`.
|
||||||
|
|
||||||
@@ -1666,7 +1666,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_latebindobject-methodname--arg1-arg2-"></a>`_.lateBind(object, methodName [, arg1, arg2, ...])`
|
### <a id="_latebindobject-methodname--arg1-arg2-"></a>`_.lateBind(object, methodName [, arg1, arg2, ...])`
|
||||||
<a href="#_latebindobject-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3336 "View in source") [Ⓣ][1]
|
<a href="#_latebindobject-methodname--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3344 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that, when called, invokes `object[methodName]` and prepends any additional `lateBind` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist.
|
Creates a function that, when called, invokes `object[methodName]` and prepends any additional `lateBind` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist.
|
||||||
|
|
||||||
@@ -1707,7 +1707,7 @@ func();
|
|||||||
<!-- 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#L2111 "View in source") [Ⓣ][1]
|
<a href="#_mapcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2109 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array of values by running each element in the `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
Creates an array of values by running each element in the `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||||
|
|
||||||
@@ -1739,7 +1739,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#L2697 "View in source") [Ⓣ][1]
|
<a href="#_maxarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2705 "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 three 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 three arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -1771,7 +1771,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#L3358 "View in source") [Ⓣ][1]
|
<a href="#_memoizefunc--resolver">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3366 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key.
|
Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key.
|
||||||
|
|
||||||
@@ -1797,7 +1797,7 @@ var fibonacci = _.memoize(function(n) {
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_mergeobject--source1-source2-"></a>`_.merge(object [, source1, source2, ...])`
|
### <a id="_mergeobject--source1-source2-"></a>`_.merge(object [, source1, source2, ...])`
|
||||||
<a href="#_mergeobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1730 "View in source") [Ⓣ][1]
|
<a href="#_mergeobject--source1-source2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1728 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Merges enumerable properties of the source object(s) into the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
Merges enumerable properties of the source object(s) into the `destination` object. Subsequent sources will overwrite propery assignments of previous sources.
|
||||||
|
|
||||||
@@ -1832,7 +1832,7 @@ _.merge(stooges, ages);
|
|||||||
<!-- 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#L2733 "View in source") [Ⓣ][1]
|
<a href="#_minarray--callback-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2741 "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 three 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 three arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -1858,7 +1858,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#L3564 "View in source") [Ⓣ][1]
|
<a href="#_mixinobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3572 "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.
|
||||||
|
|
||||||
@@ -1888,7 +1888,7 @@ _('curly').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#L3595 "View in source") [Ⓣ][1]
|
<a href="#_noconflict">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3603 "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.
|
||||||
|
|
||||||
@@ -1908,7 +1908,7 @@ var lodash = _.noConflict();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_objectkeys--values"></a>`_.object(keys [, values=[]])`
|
### <a id="_objectkeys--values"></a>`_.object(keys [, values=[]])`
|
||||||
<a href="#_objectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2768 "View in source") [Ⓣ][1]
|
<a href="#_objectkeys--values">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2776 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`.
|
Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`.
|
||||||
|
|
||||||
@@ -1933,7 +1933,7 @@ _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_omitobject-callback-prop1-prop2--thisarg"></a>`_.omit(object, callback|[prop1, prop2, ..., thisArg])`
|
### <a id="_omitobject-callback-prop1-prop2--thisarg"></a>`_.omit(object, callback|[prop1, prop2, ..., thisArg])`
|
||||||
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1787 "View in source") [Ⓣ][1]
|
<a href="#_omitobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1785 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
||||||
|
|
||||||
@@ -1964,7 +1964,7 @@ _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(va
|
|||||||
<!-- 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#L3384 "View in source") [Ⓣ][1]
|
<a href="#_oncefunc">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3392 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that is restricted to one execution. Repeat calls to the function will return the value of the first call.
|
Creates a function that is restricted to one execution. Repeat calls to the function will return the value of the first call.
|
||||||
|
|
||||||
@@ -1990,7 +1990,7 @@ initialize();
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_pairsobject"></a>`_.pairs(object)`
|
### <a id="_pairsobject"></a>`_.pairs(object)`
|
||||||
<a href="#_pairsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1803 "View in source") [Ⓣ][1]
|
<a href="#_pairsobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1801 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
|
Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`.
|
||||||
|
|
||||||
@@ -2014,7 +2014,7 @@ _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 });
|
|||||||
<!-- 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#L3419 "View in source") [Ⓣ][1]
|
<a href="#_partialfunc--arg1-arg2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3427 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `bind`, except it does **not** alter the `this` binding.
|
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `bind`, except it does **not** alter the `this` binding.
|
||||||
|
|
||||||
@@ -2041,7 +2041,7 @@ hi('moe');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_pickobject-callback-prop1-prop2--thisarg"></a>`_.pick(object, callback|[prop1, prop2, ..., thisArg])`
|
### <a id="_pickobject-callback-prop1-prop2--thisarg"></a>`_.pick(object, callback|[prop1, prop2, ..., thisArg])`
|
||||||
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1834 "View in source") [Ⓣ][1]
|
<a href="#_pickobject-callback-prop1-prop2--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1832 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*.
|
||||||
|
|
||||||
@@ -2072,7 +2072,7 @@ _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(va
|
|||||||
<!-- 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#L2134 "View in source") [Ⓣ][1]
|
<a href="#_pluckcollection-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2132 "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`.
|
||||||
|
|
||||||
@@ -2103,7 +2103,7 @@ _.pluck(stooges, 'name');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
|
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
|
||||||
<a href="#_randommin0-max1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3618 "View in source") [Ⓣ][1]
|
<a href="#_randommin0-max1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3626 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned.
|
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned.
|
||||||
|
|
||||||
@@ -2131,7 +2131,7 @@ _.random(5);
|
|||||||
<!-- 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#L2812 "View in source") [Ⓣ][1]
|
<a href="#_rangestart0-end--step1">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2820 "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.
|
||||||
|
|
||||||
@@ -2169,7 +2169,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#L2162 "View in source") [Ⓣ][1]
|
<a href="#_reducecollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2160 "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|key, collection)*.
|
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|key, collection)*.
|
||||||
|
|
||||||
@@ -2199,7 +2199,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#L2199 "View in source") [Ⓣ][1]
|
<a href="#_reducerightcollection-callback--accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2197 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
The right-associative version of `_.reduce`.
|
The right-associative version of `_.reduce`.
|
||||||
|
|
||||||
@@ -2230,7 +2230,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#L2236 "View in source") [Ⓣ][1]
|
<a href="#_rejectcollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2234 "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.
|
||||||
|
|
||||||
@@ -2256,7 +2256,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_restarray--n"></a>`_.rest(array [, n])`
|
### <a id="_restarray--n"></a>`_.rest(array [, n])`
|
||||||
<a href="#_restarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2851 "View in source") [Ⓣ][1]
|
<a href="#_restarray--n">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2859 "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.
|
||||||
|
|
||||||
@@ -2284,7 +2284,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#L3657 "View in source") [Ⓣ][1]
|
<a href="#_resultobject-property">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3665 "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.
|
||||||
|
|
||||||
@@ -2319,7 +2319,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#L2869 "View in source") [Ⓣ][1]
|
<a href="#_shufflearray">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2879 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
|
||||||
|
|
||||||
@@ -2343,7 +2343,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sizecollection"></a>`_.size(collection)`
|
### <a id="_sizecollection"></a>`_.size(collection)`
|
||||||
<a href="#_sizecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2260 "View in source") [Ⓣ][1]
|
<a href="#_sizecollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2258 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects.
|
Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects.
|
||||||
|
|
||||||
@@ -2373,7 +2373,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#L2285 "View in source") [Ⓣ][1]
|
<a href="#_somecollection--callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2283 "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 three arguments; *(value, index|key, collection)*.
|
Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
|
||||||
|
|
||||||
@@ -2402,7 +2402,7 @@ _.some([null, 0, 'yes', false]);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sortbycollection-callbackproperty--thisarg"></a>`_.sortBy(collection, callback|property [, thisArg])`
|
### <a id="_sortbycollection-callbackproperty--thisarg"></a>`_.sortBy(collection, callback|property [, thisArg])`
|
||||||
<a href="#_sortbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2315 "View in source") [Ⓣ][1]
|
<a href="#_sortbycollection-callbackproperty--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2313 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array, stable sorted in ascending order by the results of running each element of `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to sort by *(e.g. 'length')*.
|
Creates an array, stable sorted in ascending order by the results of running each element of `collection` through a `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. The `callback` argument may also be the name of a property to sort by *(e.g. 'length')*.
|
||||||
|
|
||||||
@@ -2434,7 +2434,7 @@ _.sortBy(['larry', 'brendan', 'moe'], 'length');
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_sortedindexarray-value--callbackidentityproperty-thisarg"></a>`_.sortedIndex(array, value [, callback=identity|property, thisArg])`
|
### <a id="_sortedindexarray-value--callbackidentityproperty-thisarg"></a>`_.sortedIndex(array, value [, callback=identity|property, thisArg])`
|
||||||
<a href="#_sortedindexarray-value--callbackidentityproperty-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2923 "View in source") [Ⓣ][1]
|
<a href="#_sortedindexarray-value--callbackidentityproperty-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2932 "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 one argument; *(value)*. The `callback` argument may also be the name of a property to order by.
|
Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. The `callback` argument may also be the name of a property to order by.
|
||||||
|
|
||||||
@@ -2478,7 +2478,7 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', 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#L3945 "View in source") [Ⓣ][1]
|
<a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3954 "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.
|
||||||
|
|
||||||
@@ -2508,7 +2508,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#L3727 "View in source") [Ⓣ][1]
|
<a href="#_templatetext-data-options">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3735 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. Note: In the development build `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. See http://developer.chrome.com/trunk/extensions/sandboxingEval.html
|
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. Note: In the development build `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. See http://developer.chrome.com/trunk/extensions/sandboxingEval.html
|
||||||
|
|
||||||
@@ -2573,7 +2573,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\
|
|||||||
<!-- 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#L3441 "View in source") [Ⓣ][1]
|
<a href="#_throttlefunc-wait">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3449 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
|
||||||
|
|
||||||
@@ -2598,7 +2598,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#L3845 "View in source") [Ⓣ][1]
|
<a href="#_timesn-callback--thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3854 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*.
|
Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*.
|
||||||
|
|
||||||
@@ -2630,7 +2630,7 @@ _.times(3, function(n) { this.cast(n); }, mage);
|
|||||||
<!-- 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#L2351 "View in source") [Ⓣ][1]
|
<a href="#_toarraycollection">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2349 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Converts the `collection`, to an array.
|
Converts the `collection`, to an array.
|
||||||
|
|
||||||
@@ -2654,7 +2654,7 @@ Converts the `collection`, to an array.
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_unescapestring"></a>`_.unescape(string)`
|
### <a id="_unescapestring"></a>`_.unescape(string)`
|
||||||
<a href="#_unescapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3870 "View in source") [Ⓣ][1]
|
<a href="#_unescapestring">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3879 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters.
|
Converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters.
|
||||||
|
|
||||||
@@ -2678,7 +2678,7 @@ _.unescape('Moe, Larry & Curly');
|
|||||||
<!-- 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#L2952 "View in source") [Ⓣ][1]
|
<a href="#_unionarray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2960 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -2702,7 +2702,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#L2996 "View in source") [Ⓣ][1]
|
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3004 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
|
||||||
|
|
||||||
@@ -2741,7 +2741,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#L3888 "View in source") [Ⓣ][1]
|
<a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3897 "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.
|
||||||
|
|
||||||
@@ -2765,7 +2765,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#L1864 "View in source") [Ⓣ][1]
|
<a href="#_valuesobject">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1862 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array composed of the own enumerable property values of `object`.
|
Creates an array composed of the own enumerable property values of `object`.
|
||||||
|
|
||||||
@@ -2789,7 +2789,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_wherecollection-properties"></a>`_.where(collection, properties)`
|
### <a id="_wherecollection-properties"></a>`_.where(collection, properties)`
|
||||||
<a href="#_wherecollection-properties">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2382 "View in source") [Ⓣ][1]
|
<a href="#_wherecollection-properties">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2383 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Examines each element in a `collection`, returning an array of all elements that contain the given `properties`.
|
Examines each element in a `collection`, returning an array of all elements that contain the given `properties`.
|
||||||
|
|
||||||
@@ -2820,7 +2820,7 @@ _.where(stooges, { 'age': 40 });
|
|||||||
<!-- 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#L3038 "View in source") [Ⓣ][1]
|
<a href="#_withoutarray--value1-value2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3045 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`.
|
||||||
|
|
||||||
@@ -2845,7 +2845,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
|
|||||||
<!-- div -->
|
<!-- div -->
|
||||||
|
|
||||||
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
|
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
|
||||||
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3492 "View in source") [Ⓣ][1]
|
<a href="#_wrapvalue-wrapper">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3500 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the new function are appended to those passed to the `wrapper` function.
|
Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the new function are appended to those passed to the `wrapper` function.
|
||||||
|
|
||||||
@@ -2874,7 +2874,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#L3068 "View in source") [Ⓣ][1]
|
<a href="#_ziparray1-array2-">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3076 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion.
|
||||||
|
|
||||||
@@ -2905,7 +2905,7 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
|
|||||||
<!-- 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#L3963 "View in source") [Ⓣ][1]
|
<a href="#_prototypechain">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3972 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Enables method chaining on the wrapper object.
|
Enables method chaining on the wrapper object.
|
||||||
|
|
||||||
@@ -2926,7 +2926,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#L3980 "View in source") [Ⓣ][1]
|
<a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3989 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Extracts the wrapped value.
|
Extracts the wrapped value.
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
// generate Markdown
|
// generate Markdown
|
||||||
$markdown = docdown(array(
|
$markdown = docdown(array(
|
||||||
'path' => '../' . $file,
|
'path' => '../' . $file,
|
||||||
'title' => 'Lo-Dash <sup>v0.8.0</sup>',
|
'title' => 'Lo-Dash <sup>v0.8.1</sup>',
|
||||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
177
lodash.js
177
lodash.js
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* Lo-Dash v0.8.0 <http://lodash.com>
|
* Lo-Dash v0.8.1 <http://lodash.com>
|
||||||
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
|
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
|
||||||
* Based on Underscore.js 1.4.0 <http://underscorejs.org>
|
* Based on Underscore.js 1.4.1 <http://underscorejs.org>
|
||||||
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||||
* Available under MIT license <http://lodash.com/license>
|
* Available under MIT license <http://lodash.com/license>
|
||||||
*/
|
*/
|
||||||
@@ -315,6 +315,8 @@
|
|||||||
'var index, value, iteratee = <%= firstArg %>, ' +
|
'var index, value, iteratee = <%= firstArg %>, ' +
|
||||||
// assign the `result` variable an initial value
|
// assign the `result` variable an initial value
|
||||||
'result<% if (init) { %> = <%= init %><% } %>;\n' +
|
'result<% if (init) { %> = <%= init %><% } %>;\n' +
|
||||||
|
// exit early if the first argument is falsey
|
||||||
|
'if (!<%= firstArg %>) return result;\n' +
|
||||||
// add code before the iteration branches
|
// add code before the iteration branches
|
||||||
'<%= top %>;\n' +
|
'<%= top %>;\n' +
|
||||||
|
|
||||||
@@ -480,7 +482,7 @@
|
|||||||
|
|
||||||
/** Reusable iterator options for `invoke`, `map`, `pluck`, and `sortBy` */
|
/** Reusable iterator options for `invoke`, `map`, `pluck`, and `sortBy` */
|
||||||
var mapIteratorOptions = {
|
var mapIteratorOptions = {
|
||||||
'init': '',
|
'init': false,
|
||||||
'beforeLoop': {
|
'beforeLoop': {
|
||||||
'array': 'result = Array(length)',
|
'array': 'result = Array(length)',
|
||||||
'object': 'result = ' + (isKeysFast ? 'Array(length)' : '[]')
|
'object': 'result = ' + (isKeysFast ? 'Array(length)' : '[]')
|
||||||
@@ -670,8 +672,7 @@
|
|||||||
* useStrict - A boolean to specify whether or not to include the ES5
|
* useStrict - A boolean to specify whether or not to include the ES5
|
||||||
* "use strict" directive.
|
* "use strict" directive.
|
||||||
*
|
*
|
||||||
* args - A string of comma separated arguments the iteration function will
|
* args - A string of comma separated arguments the iteration function will accept.
|
||||||
* accept.
|
|
||||||
*
|
*
|
||||||
* init - A string to specify the initial value of the `result` variable.
|
* init - A string to specify the initial value of the `result` variable.
|
||||||
*
|
*
|
||||||
@@ -689,31 +690,35 @@
|
|||||||
* @returns {Function} Returns the compiled function.
|
* @returns {Function} Returns the compiled function.
|
||||||
*/
|
*/
|
||||||
function createIterator() {
|
function createIterator() {
|
||||||
var object,
|
var index = -1,
|
||||||
prop,
|
|
||||||
value,
|
|
||||||
index = -1,
|
|
||||||
length = arguments.length;
|
length = arguments.length;
|
||||||
|
|
||||||
// merge options into a template data object
|
// merge options into a template data object
|
||||||
var data = {
|
var data = {
|
||||||
'bottom': '',
|
'bottom': '',
|
||||||
|
'hasDontEnumBug': hasDontEnumBug,
|
||||||
|
'isKeysFast': isKeysFast,
|
||||||
|
'noArgsEnum': noArgsEnum,
|
||||||
|
'noCharByIndex': noCharByIndex,
|
||||||
|
'shadowed': shadowed,
|
||||||
'top': '',
|
'top': '',
|
||||||
'arrayBranch': { 'beforeLoop': '' },
|
'useHas': true,
|
||||||
'objectBranch': { 'beforeLoop': '' }
|
'useStrict': isStrictFast,
|
||||||
|
'arrayBranch': {},
|
||||||
|
'objectBranch': {}
|
||||||
};
|
};
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
object = arguments[index];
|
var object = arguments[index];
|
||||||
for (prop in object) {
|
for (var prop in object) {
|
||||||
value = (value = object[prop]) == null ? '' : value;
|
var value = object[prop];
|
||||||
// keep this regexp explicit for the build pre-process
|
// keep this regexp explicit for the build pre-process
|
||||||
if (/beforeLoop|inLoop/.test(prop)) {
|
if (/beforeLoop|inLoop/.test(prop)) {
|
||||||
if (typeof value == 'string') {
|
if (typeof value == 'string') {
|
||||||
value = { 'array': value, 'object': value };
|
value = { 'array': value, 'object': value };
|
||||||
}
|
}
|
||||||
data.arrayBranch[prop] = value.array || '';
|
data.arrayBranch[prop] = value.array;
|
||||||
data.objectBranch[prop] = value.object || '';
|
data.objectBranch[prop] = value.object;
|
||||||
} else {
|
} else {
|
||||||
data[prop] = value;
|
data[prop] = value;
|
||||||
}
|
}
|
||||||
@@ -722,28 +727,18 @@
|
|||||||
// set additional template `data` values
|
// set additional template `data` values
|
||||||
var args = data.args,
|
var args = data.args,
|
||||||
firstArg = /^[^,]+/.exec(args)[0],
|
firstArg = /^[^,]+/.exec(args)[0],
|
||||||
init = data.init,
|
init = data.init;
|
||||||
useStrict = data.useStrict;
|
|
||||||
|
|
||||||
data.firstArg = firstArg;
|
data.firstArg = firstArg;
|
||||||
data.hasDontEnumBug = hasDontEnumBug;
|
|
||||||
data.init = init == null ? firstArg : init;
|
data.init = init == null ? firstArg : init;
|
||||||
data.isKeysFast = isKeysFast;
|
|
||||||
data.noArgsEnum = noArgsEnum;
|
|
||||||
data.shadowed = shadowed;
|
|
||||||
data.useHas = data.useHas !== false;
|
|
||||||
data.useStrict = useStrict == null ? isStrictFast : useStrict;
|
|
||||||
|
|
||||||
if (data.noCharByIndex == null) {
|
|
||||||
data.noCharByIndex = noCharByIndex;
|
|
||||||
}
|
|
||||||
if (firstArg != 'collection' || !data.arrayBranch.inLoop) {
|
if (firstArg != 'collection' || !data.arrayBranch.inLoop) {
|
||||||
data.arrayBranch = null;
|
data.arrayBranch = null;
|
||||||
}
|
}
|
||||||
// create the function factory
|
// create the function factory
|
||||||
var factory = Function(
|
var factory = Function(
|
||||||
'arrayLikeClasses, ArrayProto, bind, compareAscending, concat, createCallback, ' +
|
'arrayLikeClasses, ArrayProto, bind, compareAscending, concat, createCallback, ' +
|
||||||
'forIn, hasOwnProperty, identity, indexOf, isArguments, isArray, isFunction, ' +
|
'forIn, hasOwnProperty, indexOf, isArguments, isArray, isFunction, ' +
|
||||||
'isPlainObject, objectClass, objectTypes, nativeKeys, propertyIsEnumerable, ' +
|
'isPlainObject, objectClass, objectTypes, nativeKeys, propertyIsEnumerable, ' +
|
||||||
'slice, stringClass, toString, undefined',
|
'slice, stringClass, toString, undefined',
|
||||||
'var callee = function(' + args + ') {\n' + iteratorTemplate(data) + '\n};\n' +
|
'var callee = function(' + args + ') {\n' + iteratorTemplate(data) + '\n};\n' +
|
||||||
@@ -752,7 +747,7 @@
|
|||||||
// return the compiled function
|
// return the compiled function
|
||||||
return factory(
|
return factory(
|
||||||
arrayLikeClasses, ArrayProto, bind, compareAscending, concat, createCallback,
|
arrayLikeClasses, ArrayProto, bind, compareAscending, concat, createCallback,
|
||||||
forIn, hasOwnProperty, identity, indexOf, isArguments, isArray, isFunction,
|
forIn, hasOwnProperty, indexOf, isArguments, isArray, isFunction,
|
||||||
isPlainObject, objectClass, objectTypes, nativeKeys, propertyIsEnumerable,
|
isPlainObject, objectClass, objectTypes, nativeKeys, propertyIsEnumerable,
|
||||||
slice, stringClass, toString
|
slice, stringClass, toString
|
||||||
);
|
);
|
||||||
@@ -844,7 +839,7 @@
|
|||||||
// fallback for browsers that can't detect `arguments` objects by [[Class]]
|
// fallback for browsers that can't detect `arguments` objects by [[Class]]
|
||||||
if (noArgsClass) {
|
if (noArgsClass) {
|
||||||
isArguments = function(value) {
|
isArguments = function(value) {
|
||||||
return !!(value && hasOwnProperty.call(value, 'callee'));
|
return value ? hasOwnProperty.call(value, 'callee') : false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -981,7 +976,6 @@
|
|||||||
var shimKeys = createIterator({
|
var shimKeys = createIterator({
|
||||||
'args': 'object',
|
'args': 'object',
|
||||||
'init': '[]',
|
'init': '[]',
|
||||||
'top': 'if (!(object && objectTypes[typeof object])) throw TypeError()',
|
|
||||||
'inLoop': 'result.push(index)'
|
'inLoop': 'result.push(index)'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1250,7 +1244,7 @@
|
|||||||
* // => true
|
* // => true
|
||||||
*/
|
*/
|
||||||
function has(object, property) {
|
function has(object, property) {
|
||||||
return hasOwnProperty.call(object, property);
|
return object ? hasOwnProperty.call(object, property) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1329,7 +1323,6 @@
|
|||||||
'args': 'value',
|
'args': 'value',
|
||||||
'init': 'true',
|
'init': 'true',
|
||||||
'top':
|
'top':
|
||||||
'if (!value) return result;\n' +
|
|
||||||
'var className = toString.call(value),\n' +
|
'var className = toString.call(value),\n' +
|
||||||
' length = value.length;\n' +
|
' length = value.length;\n' +
|
||||||
'if (arrayLikeClasses[className]' +
|
'if (arrayLikeClasses[className]' +
|
||||||
@@ -1690,10 +1683,15 @@
|
|||||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||||
*/
|
*/
|
||||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||||
|
var type = typeof object;
|
||||||
|
|
||||||
// avoid iterating over the `prototype` property
|
// avoid iterating over the `prototype` property
|
||||||
return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype')
|
if (type == 'function' && propertyIsEnumerable.call(object, 'prototype')) {
|
||||||
? shimKeys(object)
|
return shimKeys(object);
|
||||||
: nativeKeys(object);
|
}
|
||||||
|
return object && objectTypes[type]
|
||||||
|
? nativeKeys(object)
|
||||||
|
: [];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1991,7 +1989,7 @@
|
|||||||
* // => 2
|
* // => 2
|
||||||
*/
|
*/
|
||||||
var find = createIterator(baseIteratorOptions, forEachIteratorOptions, {
|
var find = createIterator(baseIteratorOptions, forEachIteratorOptions, {
|
||||||
'init': '',
|
'init': false,
|
||||||
'inLoop': 'if (callback(value, index, collection)) return value'
|
'inLoop': 'if (callback(value, index, collection)) return value'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2198,7 +2196,7 @@
|
|||||||
*/
|
*/
|
||||||
function reduceRight(collection, callback, accumulator, thisArg) {
|
function reduceRight(collection, callback, accumulator, thisArg) {
|
||||||
var iteratee = collection,
|
var iteratee = collection,
|
||||||
length = collection.length,
|
length = collection ? collection.length : 0,
|
||||||
noaccum = arguments.length < 3;
|
noaccum = arguments.length < 3;
|
||||||
|
|
||||||
if (length !== +length) {
|
if (length !== +length) {
|
||||||
@@ -2349,7 +2347,10 @@
|
|||||||
* // => [2, 3, 4]
|
* // => [2, 3, 4]
|
||||||
*/
|
*/
|
||||||
function toArray(collection) {
|
function toArray(collection) {
|
||||||
var length = collection ? collection.length : 0;
|
if (!collection) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
var length = collection.length;
|
||||||
if (length === +length) {
|
if (length === +length) {
|
||||||
return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
|
return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
|
||||||
? collection.split('')
|
? collection.split('')
|
||||||
@@ -2411,7 +2412,7 @@
|
|||||||
*/
|
*/
|
||||||
function compact(array) {
|
function compact(array) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length,
|
length = array ? array.length : 0,
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
@@ -2439,15 +2440,19 @@
|
|||||||
* // => [1, 3, 4]
|
* // => [1, 3, 4]
|
||||||
*/
|
*/
|
||||||
function difference(array) {
|
function difference(array) {
|
||||||
|
var result = [];
|
||||||
|
if (!array) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length,
|
length = array.length,
|
||||||
flattened = concat.apply(ArrayProto, arguments),
|
flattened = concat.apply(ArrayProto, arguments),
|
||||||
contains = cachedContains(flattened, length),
|
contains = cachedContains(flattened, length);
|
||||||
result = [];
|
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
if (!contains(array[index])) {
|
var value = array[index];
|
||||||
result.push(array[index]);
|
if (!contains(value)) {
|
||||||
|
result.push(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -2473,7 +2478,9 @@
|
|||||||
* // => 5
|
* // => 5
|
||||||
*/
|
*/
|
||||||
function first(array, n, guard) {
|
function first(array, n, guard) {
|
||||||
return (n == null || guard) ? array[0] : slice.call(array, 0, n);
|
if (array) {
|
||||||
|
return (n == null || guard) ? array[0] : slice.call(array, 0, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2497,7 +2504,7 @@
|
|||||||
function flatten(array, shallow) {
|
function flatten(array, shallow) {
|
||||||
var value,
|
var value,
|
||||||
index = -1,
|
index = -1,
|
||||||
length = array.length,
|
length = array ? array.length : 0,
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
@@ -2539,15 +2546,13 @@
|
|||||||
*/
|
*/
|
||||||
function indexOf(array, value, fromIndex) {
|
function indexOf(array, value, fromIndex) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length;
|
length = array ? array.length : 0;
|
||||||
|
|
||||||
if (fromIndex) {
|
if (typeof fromIndex == 'number') {
|
||||||
if (typeof fromIndex == 'number') {
|
index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1;
|
||||||
index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) - 1;
|
} else if (fromIndex) {
|
||||||
} else {
|
index = sortedIndex(array, value);
|
||||||
index = sortedIndex(array, value);
|
return array[index] === value ? index : -1;
|
||||||
return array[index] === value ? index : -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
if (array[index] === value) {
|
if (array[index] === value) {
|
||||||
@@ -2575,7 +2580,9 @@
|
|||||||
* // => [3, 2]
|
* // => [3, 2]
|
||||||
*/
|
*/
|
||||||
function initial(array, n, guard) {
|
function initial(array, n, guard) {
|
||||||
return slice.call(array, 0, -((n == null || guard) ? 1 : n));
|
return array
|
||||||
|
? slice.call(array, 0, -((n == null || guard) ? 1 : n))
|
||||||
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2594,15 +2601,14 @@
|
|||||||
* // => [1, 2]
|
* // => [1, 2]
|
||||||
*/
|
*/
|
||||||
function intersection(array) {
|
function intersection(array) {
|
||||||
var value,
|
var argsLength = arguments.length,
|
||||||
argsLength = arguments.length,
|
|
||||||
cache = [],
|
cache = [],
|
||||||
index = -1,
|
index = -1,
|
||||||
length = array.length,
|
length = array ? array.length : 0,
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
array: while (++index < length) {
|
array: while (++index < length) {
|
||||||
value = array[index];
|
var value = array[index];
|
||||||
if (indexOf(result, value) < 0) {
|
if (indexOf(result, value) < 0) {
|
||||||
for (var argsIndex = 1; argsIndex < argsLength; argsIndex++) {
|
for (var argsIndex = 1; argsIndex < argsLength; argsIndex++) {
|
||||||
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(arguments[argsIndex])))(value)) {
|
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(arguments[argsIndex])))(value)) {
|
||||||
@@ -2634,8 +2640,10 @@
|
|||||||
* // => 1
|
* // => 1
|
||||||
*/
|
*/
|
||||||
function last(array, n, guard) {
|
function last(array, n, guard) {
|
||||||
var length = array.length;
|
if (array) {
|
||||||
return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length);
|
var length = array.length;
|
||||||
|
return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2658,8 +2666,8 @@
|
|||||||
* // => 1
|
* // => 1
|
||||||
*/
|
*/
|
||||||
function lastIndexOf(array, value, fromIndex) {
|
function lastIndexOf(array, value, fromIndex) {
|
||||||
var index = array.length;
|
var index = array ? array.length : 0;
|
||||||
if (fromIndex && typeof fromIndex == 'number') {
|
if (typeof fromIndex == 'number') {
|
||||||
index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;
|
index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;
|
||||||
}
|
}
|
||||||
while (index--) {
|
while (index--) {
|
||||||
@@ -2767,7 +2775,7 @@
|
|||||||
*/
|
*/
|
||||||
function object(keys, values) {
|
function object(keys, values) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = keys.length,
|
length = keys ? keys.length : 0,
|
||||||
result = {};
|
result = {};
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
@@ -2849,7 +2857,9 @@
|
|||||||
* // => [2, 1]
|
* // => [2, 1]
|
||||||
*/
|
*/
|
||||||
function rest(array, n, guard) {
|
function rest(array, n, guard) {
|
||||||
return slice.call(array, (n == null || guard) ? 1 : n);
|
return array
|
||||||
|
? slice.call(array, (n == null || guard) ? 1 : n)
|
||||||
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2867,13 +2877,12 @@
|
|||||||
* // => [4, 1, 6, 3, 5, 2]
|
* // => [4, 1, 6, 3, 5, 2]
|
||||||
*/
|
*/
|
||||||
function shuffle(array) {
|
function shuffle(array) {
|
||||||
var rand,
|
var index = -1,
|
||||||
index = -1,
|
length = array ? array.length : 0,
|
||||||
length = array.length,
|
|
||||||
result = Array(length);
|
result = Array(length);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
rand = nativeFloor(nativeRandom() * (index + 1));
|
var rand = nativeFloor(nativeRandom() * (index + 1));
|
||||||
result[index] = result[rand];
|
result[index] = result[rand];
|
||||||
result[rand] = array[index];
|
result[rand] = array[index];
|
||||||
}
|
}
|
||||||
@@ -2921,14 +2930,13 @@
|
|||||||
* // => 2
|
* // => 2
|
||||||
*/
|
*/
|
||||||
function sortedIndex(array, value, callback, thisArg) {
|
function sortedIndex(array, value, callback, thisArg) {
|
||||||
var mid,
|
var low = 0,
|
||||||
low = 0,
|
high = array ? array.length : low;
|
||||||
high = array.length;
|
|
||||||
|
|
||||||
callback = createCallback(callback, thisArg);
|
callback = createCallback(callback, thisArg);
|
||||||
value = callback(value);
|
value = callback(value);
|
||||||
while (low < high) {
|
while (low < high) {
|
||||||
mid = (low + high) >>> 1;
|
var mid = (low + high) >>> 1;
|
||||||
callback(array[mid]) < value ? low = mid + 1 : high = mid;
|
callback(array[mid]) < value ? low = mid + 1 : high = mid;
|
||||||
}
|
}
|
||||||
return low;
|
return low;
|
||||||
@@ -2994,9 +3002,8 @@
|
|||||||
* // => [1, 2, 3]
|
* // => [1, 2, 3]
|
||||||
*/
|
*/
|
||||||
function uniq(array, isSorted, callback, thisArg) {
|
function uniq(array, isSorted, callback, thisArg) {
|
||||||
var computed,
|
var index = -1,
|
||||||
index = -1,
|
length = array ? array.length : 0,
|
||||||
length = array.length,
|
|
||||||
result = [],
|
result = [],
|
||||||
seen = [];
|
seen = [];
|
||||||
|
|
||||||
@@ -3008,7 +3015,7 @@
|
|||||||
}
|
}
|
||||||
callback = createCallback(callback, thisArg);
|
callback = createCallback(callback, thisArg);
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
computed = callback(array[index], index, array);
|
var computed = callback(array[index], index, array);
|
||||||
if (isSorted
|
if (isSorted
|
||||||
? !index || seen[seen.length - 1] !== computed
|
? !index || seen[seen.length - 1] !== computed
|
||||||
: indexOf(seen, computed) < 0
|
: indexOf(seen, computed) < 0
|
||||||
@@ -3037,13 +3044,14 @@
|
|||||||
*/
|
*/
|
||||||
function without(array) {
|
function without(array) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length,
|
length = array ? array.length : 0,
|
||||||
contains = cachedContains(arguments, 1, 20),
|
contains = cachedContains(arguments, 1, 20),
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
if (!contains(array[index])) {
|
var value = array[index];
|
||||||
result.push(array[index]);
|
if (!contains(value)) {
|
||||||
|
result.push(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -3067,7 +3075,7 @@
|
|||||||
*/
|
*/
|
||||||
function zip(array) {
|
function zip(array) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = max(pluck(arguments, 'length')),
|
length = array ? max(pluck(arguments, 'length')) : 0,
|
||||||
result = Array(length);
|
result = Array(length);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
@@ -3174,8 +3182,8 @@
|
|||||||
' return result\n' +
|
' return result\n' +
|
||||||
'}',
|
'}',
|
||||||
'inLoop':
|
'inLoop':
|
||||||
'if (isFunction(result[index])) {\n' +
|
'if (isFunction(value)) {\n' +
|
||||||
' result[index] = bind(result[index], result)\n' +
|
' result[index] = bind(value, result)\n' +
|
||||||
'}'
|
'}'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -3729,6 +3737,7 @@
|
|||||||
// http://ejohn.org/blog/javascript-micro-templating/
|
// http://ejohn.org/blog/javascript-micro-templating/
|
||||||
// and Laura Doktorova's doT.js
|
// and Laura Doktorova's doT.js
|
||||||
// https://github.com/olado/doT
|
// https://github.com/olado/doT
|
||||||
|
text += '';
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
|
|
||||||
var isEvaluating,
|
var isEvaluating,
|
||||||
@@ -3990,7 +3999,7 @@
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @type String
|
* @type String
|
||||||
*/
|
*/
|
||||||
lodash.VERSION = '0.8.0';
|
lodash.VERSION = '0.8.1';
|
||||||
|
|
||||||
// assign static methods
|
// assign static methods
|
||||||
lodash.after = after;
|
lodash.after = after;
|
||||||
|
|||||||
66
lodash.min.js
vendored
66
lodash.min.js
vendored
@@ -1,39 +1,39 @@
|
|||||||
/*!
|
/*!
|
||||||
Lo-Dash 0.8.0 lodash.com/license
|
Lo-Dash 0.8.1 lodash.com/license
|
||||||
Underscore.js 1.4.0 underscorejs.org/LICENSE
|
Underscore.js 1.4.1 underscorejs.org/LICENSE
|
||||||
*/
|
*/
|
||||||
;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(var o=t-1;++o<r;)n=e[o]+"",(Q.call(s,n)?s[n]:s[n]=[]).push(e[o]);return function(e){if(i){var n=e+"";return Q.call(s,n)&&-1<x(s[n],e)}return-1<x(s,e,t)}}function u(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function a(e,t,n){function r(){var u=arguments
|
;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(var o=t-1;++o<r;)n=e[o]+"",(Q.call(s,n)?s[n]:s[n]=[]).push(e[o]);return function(e){if(i){var n=e+"";return Q.call(s,n)&&-1<x(s[n],e)}return-1<x(s,e,t)}}function u(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function a(e,t,n){function r(){var u=arguments
|
||||||
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(Z.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Pt[typeof u]?u:a):e.apply(a,u)}var i=m(e),s=!n,o=e;return s&&(n=t),r}function f(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:A}function l(){for(var e,t,n,s=-1,o=arguments.length,a={e:"",p:"",c:{d:""},l:{d:""}};++s<o;)for(t in e=arguments[s],e)n=(n=e[t])==r?"":n,/d|h/.test(t)?("string"==typeof
|
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(Z.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Pt[typeof u]?u:a):e.apply(a,u)}var i=m(e),s=!n,o=e;return s&&(n=t),r}function f(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:A}function l(){for(var e=-1,t=arguments.length,i={e:"",g:wt,j:Ot,m:xt,n:Ct,o:J,p:"",q:n,r:Mt,c:{},l:{}};++e<t;){var s=arguments[e],o;for(o in s){var a=s[o];/d|h/.test(o
|
||||||
n&&(n={b:n,k:n}),a.c[t]=n.b||"",a.l[t]=n.k||""):a[t]=n;e=a.a,t=/^[^,]+/.exec(e)[0],n=a.i,s=a.r,a.f=t,a.g=wt,a.i=n==r?t:n,a.j=Ot,a.m=xt,a.o=J,a.q=a.q!==i,a.r=s==r?Mt:s,a.n==r&&(a.n=Ct);if("d"!=t||!a.c.h)a.c=r;t="",a.r&&(t+="'use strict';"),t+="var j,B,k="+a.f+",u",a.i&&(t+="="+a.i),t+=";"+a.p+";",a.c&&(t+="var l=k.length;j=-1;",a.l&&(t+="if(l===+l){"),a.n&&(t+="if(z.call(k)==x){k=k.split('')}"),t+=a.c.d+";while(++j<l){B=k[j];"+a.c.h+"}",a.l&&(t+="}"));if(a.l){a.c?t+="else {":a.m&&(t+="var l=k.length;j=-1;if(l&&P(k)){while(++j<l){B=k[j+=''];"+
|
)?("string"==typeof a&&(a={b:a,k:a}),i.c[o]=a.b,i.l[o]=a.k):i[o]=a}}e=i.a,t=/^[^,]+/.exec(e)[0],s=i.i,i.f=t,i.i=s==r?t:s;if("d"!=t||!i.c.h)i.c=r;t="",i.r&&(t+="'use strict';"),t+="var i,A,j="+i.f+",t",i.i&&(t+="="+i.i),t+=";if(!"+i.f+")return t;"+i.p+";",i.c&&(t+="var k=j.length;i=-1;",i.l&&(t+="if(k===+k){"),i.n&&(t+="if(y.call(j)==w){j=j.split('')}"),t+=i.c.d+";while(++i<k){A=j[i];"+i.c.h+"}",i.l&&(t+="}"));if(i.l){i.c?t+="else {":i.m&&(t+="var k=j.length;i=-1;if(k&&O(j)){while(++i<k){A=j[i+=''];"+
|
||||||
a.l.h+"}}else {"),a.g||(t+="var v=typeof k=='function'&&r.call(k,'prototype');");if(a.j&&a.q)t+="var o=-1,p=Z[typeof k]?m(k):[],l=p.length;"+a.l.d+";while(++o<l){j=p[o];",a.g||(t+="if(!(v&&j=='prototype')){"),t+="B=k[j];"+a.l.h+"",a.g||(t+="}");else{t+=a.l.d+";for(j in k){";if(!a.g||a.q)t+="if(",a.g||(t+="!(v&&j=='prototype')"),!a.g&&a.q&&(t+="&&"),a.q&&(t+="h.call(k,j)"),t+="){";t+="B=k[j];"+a.l.h+";";if(!a.g||a.q)t+="}"}t+="}";if(a.g){t+="var g=k.constructor;";for(n=0;7>n;n++)t+="j='"+a.o[n]+"';if("
|
i.l.h+"}}else {"),i.g||(t+="var u=typeof j=='function'&&q.call(j,'prototype');");if(i.j&&i.q)t+="var n=-1,o=Y[typeof j]?l(j):[],k=o.length;"+i.l.d+";while(++n<k){i=o[n];",i.g||(t+="if(!(u&&i=='prototype')){"),t+="A=j[i];"+i.l.h+"",i.g||(t+="}");else{t+=i.l.d+";for(i in j){";if(!i.g||i.q)t+="if(",i.g||(t+="!(u&&i=='prototype')"),!i.g&&i.q&&(t+="&&"),i.q&&(t+="h.call(j,i)"),t+="){";t+="A=j[i];"+i.l.h+";";if(!i.g||i.q)t+="}"}t+="}";if(i.g){t+="var g=j.constructor;";for(s=0;7>s;s++)t+="i='"+i.o[s]+"';if("
|
||||||
,"constructor"==a.o[n]&&(t+="!(g&&g.prototype===k)&&"),t+="h.call(k,j)){B=k[j];"+a.l.h+"}"}if(a.c||a.m)t+="}"}return t+=a.e+";return u",Function("E,F,G,J,e,f,K,h,i,N,P,R,T,U,Y,Z,m,r,w,x,z,A","var H=function("+e+"){"+t+"};return H")(_t,_,L,u,K,f,Zt,Q,A,x,v,Vt,m,$t,vt,Pt,ot,Y,Z,gt,et)}function c(e){return"\\"+Ht[e]}function h(e){return Kt[e]}function p(){}function d(e){return Qt[e]}function v(e){return et.call(e)==lt}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof
|
,"constructor"==i.o[s]&&(t+="!(g&&g.prototype===j)&&"),t+="h.call(j,i)){A=j[i];"+i.l.h+"}"}if(i.c||i.m)t+="}"}return t+=i.e+";return t",Function("D,E,F,I,e,f,J,h,M,O,Q,S,T,X,Y,l,q,v,w,y,z","var G=function("+e+"){"+t+"};return G")(_t,_,L,u,K,f,Zt,Q,x,v,Vt,m,$t,vt,Pt,ot,Y,Z,gt,et)}function c(e){return"\\"+Ht[e]}function h(e){return Kt[e]}function p(){}function d(e){return Qt[e]}function v(e){return et.call(e)==lt}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof
|
||||||
e||v(e))return t;var n=e.constructor;return(!kt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!m(n)||n instanceof n)?St?(Zt(e,function(e,n,r){return t=!Q.call(r,n),i}),t===i):(Zt(e,function(e,n){t=n}),t===i||Q.call(e,t)):t}function y(e,t,s,o,u){if(e==r)return e;s&&(t=i);if(s=Pt[typeof e]){var a=et.call(e);if(!Dt[a]||Tt&&v(e))return e;var f=a==ct,s=f||(a==vt?$t(e):s)}if(!s||!t)return s?f?Z.call(e):Yt({},e):e;s=e.constructor;switch(a){case ht:return new s(e==n);case pt:return new s(+e)
|
e||v(e))return t;var n=e.constructor;return(!kt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!m(n)||n instanceof n)?St?(Zt(e,function(e,n,r){return t=!Q.call(r,n),i}),t===i):(Zt(e,function(e,n){t=n}),t===i||Q.call(e,t)):t}function y(e,t,s,o,u){if(e==r)return e;s&&(t=i);if(s=Pt[typeof e]){var a=et.call(e);if(!Dt[a]||Tt&&v(e))return e;var f=a==ct,s=f||(a==vt?$t(e):s)}if(!s||!t)return s?f?Z.call(e):Yt({},e):e;s=e.constructor;switch(a){case ht:return new s(e==n);case pt:return new s(+e)
|
||||||
;case dt:case gt:return new s(e);case mt:return s(e.source,U.exec(e))}o||(o=[]),u||(u=[]);for(a=o.length;a--;)if(o[a]==e)return u[a];var l=f?s(a=e.length):{};o.push(e),u.push(l);if(f)for(f=-1;++f<a;)l[f]=y(e[f],t,r,o,u);else en(e,function(e,n){l[n]=y(e,t,r,o,u)});return l}function b(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Pt[typeof e]||Pt[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=et.call(e);if(u!=et.call(t))return i;switch(u){case ht:case pt:return+e==+t
|
;case dt:case gt:return new s(e);case mt:return s(e.source,U.exec(e))}o||(o=[]),u||(u=[]);for(a=o.length;a--;)if(o[a]==e)return u[a];var l=f?s(a=e.length):{};o.push(e),u.push(l);if(f)for(f=-1;++f<a;)l[f]=y(e[f],t,r,o,u);else en(e,function(e,n){l[n]=y(e,t,r,o,u)});return l}function b(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Pt[typeof e]||Pt[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=et.call(e);if(u!=et.call(t))return i;switch(u){case ht:case pt:return+e==+t
|
||||||
;case dt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case mt:case gt:return e==t+""}var a=_t[u];if(Tt&&!a&&(a=v(e))&&!v(t)||!a&&(u!=vt||kt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+""))))return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=b(e[l],t[l],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!m(a)||!(a instanceof
|
;case dt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case mt:case gt:return e==t+""}var a=_t[u];if(Tt&&!a&&(a=v(e))&&!v(t)||!a&&(u!=vt||kt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+""))))return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=b(e[l],t[l],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!m(a)||!(a instanceof
|
||||||
a&&m(f)&&f instanceof f)))return i;for(var c in e)if(Q.call(e,c)&&(l++,!Q.call(t,c)||!b(e[c],t[c],s,o)))return i;for(c in t)if(Q.call(t,c)&&!(l--))return i;if(wt)for(;7>++u;)if(c=J[u],Q.call(e,c)&&(!Q.call(t,c)||!b(e[c],t[c],s,o)))return i;return n}function w(e,t,n,r){var s=e,o=e.length,u=3>arguments.length;if(o!==+o)var a=rn(e),o=a.length;else Ct&&et.call(e)==gt&&(s=e.split(""));return vn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function E(e,t,n){return t==r||n?e[0
|
a&&m(f)&&f instanceof f)))return i;for(var c in e)if(Q.call(e,c)&&(l++,!Q.call(t,c)||!b(e[c],t[c],s,o)))return i;for(c in t)if(Q.call(t,c)&&!(l--))return i;if(wt)for(;7>++u;)if(c=J[u],Q.call(e,c)&&(!Q.call(t,c)||!b(e[c],t[c],s,o)))return i;return n}function w(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=rn(e),o=a.length;else Ct&&et.call(e)==gt&&(s=e.split(""));return vn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function E(e,t,n){if(e)return t==
|
||||||
]:Z.call(e,0,t)}function S(e,t){for(var n,r=-1,i=e.length,s=[];++r<i;)n=e[r],Vt(n)?G.apply(s,t?n:S(n)):s.push(n);return s}function x(e,t,n){var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=C(e,t),e[r]===t?r:-1;r=(0>n?ut(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function T(e,t,n){for(var r=-Infinity,i=-1,s=e?e.length:0,o=r,t=f(t,n);++i<s;)n=t(e[i],i,e),n>r&&(r=n,o=e[i]);return o}function N(e,t,n){return Z.call(e,t==r||n?1:t)}function C(e,t,n,r){for(var i=0,s=e.length,n=f(n,r),t=
|
r||n?e[0]:Z.call(e,0,t)}function S(e,t){for(var n,r=-1,i=e?e.length:0,s=[];++r<i;)n=e[r],Vt(n)?G.apply(s,t?n:S(n)):s.push(n);return s}function x(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?ut(0,i+n):n||0)-1;else if(n)return r=C(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function T(e,t,n){for(var r=-Infinity,i=-1,s=e?e.length:0,o=r,t=f(t,n);++i<s;)n=t(e[i],i,e),n>r&&(r=n,o=e[i]);return o}function N(e,t,n){return e?Z.call(e,t==r||n?1:t):[]}function C(e,t,n,r){for(var i=0
|
||||||
n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function k(e,t,n,r){var s=-1,o=e.length,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=f(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>x(a,r))a.push(r),u.push(e[s]);return u}function L(e,t){return At||tt&&2<arguments.length?tt.call.apply(tt,arguments):a(e,t,Z.call(arguments,2))}function A(e){return e}function O(e){vn(tn(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&G.apply(e
|
,s=e?e.length:i,n=f(n,r),t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function k(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=f(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>x(a,r))a.push(r),u.push(e[s]);return u}function L(e,t){return At||tt&&2<arguments.length?tt.call.apply(tt,arguments):a(e,t,Z.call(arguments,2))}function A(e){return e}function O(e){vn(tn(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return arguments
|
||||||
,arguments),e=r.apply(s,e),this.__chain__&&(e=new s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,M="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),_=Array.prototype,D=Object.prototype,P=0,H=30,B=e._,j=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,F=/&(?:amp|lt|gt|quot|#x27);/g,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/\w*$/,z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,W=RegExp("^"+(D
|
.length&&G.apply(e,arguments),e=r.apply(s,e),this.__chain__&&(e=new s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,M="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),_=Array.prototype,D=Object.prototype,P=0,H=30,B=e._,j=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,F=/&(?:amp|lt|gt|quot|#x27);/g,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/\w*$/,z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g
|
||||||
.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),X=/($^)/,V=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,J="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),K=_.concat,Q=D.hasOwnProperty,G=_.push,Y=D.propertyIsEnumerable,Z=_.slice,et=D.toString,tt=W.test(tt=Z.bind)&&tt,nt=Math.floor,rt=W.test(rt=Object.getPrototypeOf)&&rt,it=W.test(it=Array.isArray)&&it,st=e.isFinite,ot=W.test(ot=Object.keys)&&ot,
|
,W=RegExp("^"+(D.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),X=/($^)/,V=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,J="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),K=_.concat,Q=D.hasOwnProperty,G=_.push,Y=D.propertyIsEnumerable,Z=_.slice,et=D.toString,tt=W.test(tt=Z.bind)&&tt,nt=Math.floor,rt=W.test(rt=Object.getPrototypeOf)&&rt,it=W.test(it=Array.isArray)&&it,st=e.isFinite,ot=W.test(ot=Object
|
||||||
ut=Math.max,at=Math.min,ft=Math.random,lt="[object Arguments]",ct="[object Array]",ht="[object Boolean]",pt="[object Date]",dt="[object Number]",vt="[object Object]",mt="[object RegExp]",gt="[object String]",yt=e.clearTimeout,bt=e.setTimeout,wt,Et,St,xt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)xt=!r;wt=4>(n+"").length,St="x"!=n[0],Et=(n.splice.call(t,0,1),t[0])})(1);var Tt=!v(arguments),Nt="x"!=Z.call("x"
|
.keys)&&ot,ut=Math.max,at=Math.min,ft=Math.random,lt="[object Arguments]",ct="[object Array]",ht="[object Boolean]",pt="[object Date]",dt="[object Number]",vt="[object Object]",mt="[object RegExp]",gt="[object String]",yt=e.clearTimeout,bt=e.setTimeout,wt,Et,St,xt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)xt=!r;wt=4>(n+"").length,St="x"!=n[0],Et=(n.splice.call(t,0,1),t[0])})(1);var Tt=!v(arguments),Nt="x"!=
|
||||||
)[0],Ct="xx"!="x"[0]+Object("x")[0];try{var kt=("[object Object]",et.call(e.document||0)==vt)}catch(Lt){}var At=tt&&/\n|Opera/.test(tt+et.call(e.opera)),Ot=ot&&/^.+$|true/.test(ot+!!e.attachEvent),Mt=!At,_t={};_t[ht]=_t[pt]=_t["[object Function]"]=_t[dt]=_t[vt]=_t[mt]=i,_t[lt]=_t[ct]=_t[gt]=n;var Dt={};Dt[lt]=Dt["[object Function]"]=i,Dt[ct]=Dt[ht]=Dt[pt]=Dt[dt]=Dt[vt]=Dt[mt]=Dt[gt]=n;var Pt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Ht={"\\":"\\","'":"'","\n":"n"
|
Z.call("x")[0],Ct="xx"!="x"[0]+Object("x")[0];try{var kt=("[object Object]",et.call(e.document||0)==vt)}catch(Lt){}var At=tt&&/\n|Opera/.test(tt+et.call(e.opera)),Ot=ot&&/^.+$|true/.test(ot+!!e.attachEvent),Mt=!At,_t={};_t[ht]=_t[pt]=_t["[object Function]"]=_t[dt]=_t[vt]=_t[mt]=i,_t[lt]=_t[ct]=_t[gt]=n;var Dt={};Dt[lt]=Dt["[object Function]"]=i,Dt[ct]=Dt[ht]=Dt[pt]=Dt[dt]=Dt[vt]=Dt[mt]=Dt[gt]=n;var Pt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Ht={"\\":"\\","'":"'"
|
||||||
,"\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Bt={a:"d,c,y",i:"d",p:"c=f(c,y)",h:"if(c(B,j,d)===false)return u"},jt={i:"{}",p:"c=f(c,y)",h:"var q=c(B,j,d);(h.call(u,q)?u[q]++:u[q]=1)"},Ft={i:"true",h:"if(!c(B,j,d))return!u"},It={q:i,r:i,a:"n",i:"n",p:"for(var a=1,b=arguments.length;a<b;a++){if(k=arguments[a]){",h:"u[j]=B",e:"}}"},qt={i:"[]",h:"c(B,j,d)&&u.push(B)"},Rt={p
|
,"\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Bt={a:"d,c,x",i:"d",p:"c=f(c,x)",h:"if(c(A,i,d)===false)return t"},jt={i:"{}",p:"c=f(c,x)",h:"var p=c(A,i,d);(h.call(t,p)?t[p]++:t[p]=1)"},Ft={i:"true",h:"if(!c(A,i,d))return!t"},It={q:i,r:i,a:"m",i:"m",p:"for(var a=1,b=arguments.length;a<b;a++){if(j=arguments[a]){",h:"t[i]=A",e:"}}"},qt={i:"[]",h:"c(A,i,d)&&t.push(A)"
|
||||||
:"c=f(c,y)"},Ut={h:{k:Bt.h}},zt={i:"",d:{b:"u=Array(l)",k:"u="+(Ot?"Array(l)":"[]")},h:{b:"u[j]=c(B,j,d)",k:"u"+(Ot?"[o]=":".push")+"(c(B,j,d))"}},Wt={q:i,a:"n,c,y",i:"{}",p:"var S=typeof c=='function';if(S)c=f(c,y);else var t=e.apply(F,arguments)",h:"if(S?!c(B,j,n):N(t,j)<0)u[j]=B"},Xt=l({a:"n",i:"{}",h:"u[B]=j"});Tt&&(v=function(e){return!!e&&!!Q.call(e,"callee")});var Vt=it||function(e){return et.call(e)==ct};m(/x/)&&(m=function(e){return"[object Function]"==et.call(e)});var $t=rt?function(e){
|
},Rt={p:"c=f(c,x)"},Ut={h:{k:Bt.h}},zt={i:i,d:{b:"t=Array(k)",k:"t="+(Ot?"Array(k)":"[]")},h:{b:"t[i]=c(A,i,d)",k:"t"+(Ot?"[n]=":".push")+"(c(A,i,d))"}},Wt={q:i,a:"m,c,x",i:"{}",p:"var R=typeof c=='function';if(R)c=f(c,x);else var s=e.apply(E,arguments)",h:"if(R?!c(A,i,m):M(s,i)<0)t[i]=A"},Xt=l({a:"m",i:"{}",h:"t[A]=i"});Tt&&(v=function(e){return e?Q.call(e,"callee"):i});var Vt=it||function(e){return et.call(e)==ct};m(/x/)&&(m=function(e){return"[object Function]"==et.call(e)});var $t=rt?function(
|
||||||
if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=rt(t))&&rt(n);return n?e==n||rt(e)==n&&!v(e):g(e)}:g,Jt=l({a:"n",i:"[]",p:"if(!(n&&Z[typeof n]))throw TypeError()",h:"u.push(j)"}),Kt={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt=Xt(Kt),Gt=l(It,{h:"if(u[j]==null)"+It.h}),Yt=l(It),Zt=l(Bt,Rt,Ut,{q:i}),en=l(Bt,Rt,Ut),tn=l({q:i,a:"n",i:"[]",h:"if(T(B))u.push(j)",e:"u.sort()"}),nn=l({a:"B",i:"true",p:"if(!B)return u;var I=z.call(B),l=B.length;if(E[I]"+(Tt?"||P(B)"
|
e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=rt(t))&&rt(n);return n?e==n||rt(e)==n&&!v(e):g(e)}:g,Jt=l({a:"m",i:"[]",h:"t.push(i)"}),Kt={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt=Xt(Kt),Gt=l(It,{h:"if(t[i]==null)"+It.h}),Yt=l(It),Zt=l(Bt,Rt,Ut,{q:i}),en=l(Bt,Rt,Ut),tn=l({q:i,a:"m",i:"[]",h:"if(S(A))t.push(i)",e:"t.sort()"}),nn=l({a:"A",i:"true",p:"var H=y.call(A),k=A.length;if(D[H]"+(Tt?"||O(A)":"")+"||(H==X&&k===+k&&S(A.splice)))return!k"
|
||||||
:"")+"||(I==Y&&l===+l&&T(B.splice)))return!l",h:{k:"return false"}}),rn=ot?function(e){return"function"==typeof e&&Y.call(e,"prototype")?Jt(e):ot(e)}:Jt,sn=l(It,{a:"n,ee,O",p:"var Q,D=arguments,a=0;if(O==J){var b=2,ff=D[3],gg=D[4]}else var b=D.length,ff=[],gg=[];while(++a<b){if(k=D[a]){",h:"if((ee=B)&&((Q=R(ee))||U(ee))){var L=false,hh=ff.length;while(hh--)if(L=ff[hh]==ee)break;if(L){u[j]=gg[hh]}else {ff.push(ee);gg.push(B=(B=u[j])&&Q?(R(B)?B:[]):(U(B)?B:{}));u[j]=H(B,ee,J,ff,gg)}}else if(ee!=null)u[j]=ee"
|
,h:{k:"return false"}}),rn=ot?function(e){var t=typeof e;return"function"==t&&Y.call(e,"prototype")?Jt(e):e&&Pt[t]?ot(e):[]}:Jt,sn=l(It,{a:"m,dd,N",p:"var P,C=arguments,a=0;if(N==I){var b=2,ee=C[3],ff=C[4]}else var b=C.length,ee=[],ff=[];while(++a<b){if(j=C[a]){",h:"if((dd=A)&&((P=Q(dd))||T(dd))){var K=false,gg=ee.length;while(gg--)if(K=ee[gg]==dd)break;if(K){t[i]=ff[gg]}else {ee.push(dd);ff.push(A=(A=t[i])&&P?(Q(A)?A:[]):(T(A)?A:{}));t[i]=G(A,dd,I,ee,ff)}}else if(dd!=null)t[i]=dd"}),on=l(Wt),un=
|
||||||
}),on=l(Wt),un=l({a:"n",i:"[]",h:"u"+(Ot?"[o]=":".push")+"([j,B])"}),an=l(Wt,{p:"if(typeof c!='function'){var q,t=e.apply(F,arguments),l=t.length;for(j=1;j<l;j++){q=t[j];if(q in n)u[q]=n[q]}}else {c=f(c,y)",h:"if(c(B,j,n))u[j]=B",e:"}"}),fn=l({a:"n",i:"[]",h:"u.push(B)"}),ln=l({a:"d,ii",i:"false",n:i,d:{b:"if(z.call(d)==x)return d.indexOf(ii)>-1"},h:"if(B===ii)return true"}),cn=l(Bt,jt),hn=l(Bt,Ft),pn=l(Bt,qt),dn=l(Bt,Rt,{i:"",h:"if(c(B,j,d))return B"}),vn=l(Bt,Rt),mn=l(Bt,jt,{h:"var q=c(B,j,d);(h.call(u,q)?u[q]:u[q]=[]).push(B)"
|
l({a:"m",i:"[]",h:"t"+(Ot?"[n]=":".push")+"([i,A])"}),an=l(Wt,{p:"if(typeof c!='function'){var p,s=e.apply(E,arguments),k=s.length;for(i=1;i<k;i++){p=s[i];if(p in m)t[p]=m[p]}}else {c=f(c,x)",h:"if(c(A,i,m))t[i]=A",e:"}"}),fn=l({a:"m",i:"[]",h:"t.push(A)"}),ln=l({a:"d,hh",i:"false",n:i,d:{b:"if(y.call(d)==w)return d.indexOf(hh)>-1"},h:"if(A===hh)return true"}),cn=l(Bt,jt),hn=l(Bt,Ft),pn=l(Bt,qt),dn=l(Bt,Rt,{i:i,h:"if(c(A,i,d))return A"}),vn=l(Bt,Rt),mn=l(Bt,jt,{h:"var p=c(A,i,d);(h.call(t,p)?t[p]:t[p]=[]).push(A)"
|
||||||
}),gn=l(zt,{a:"d,V",p:"var D=w.call(arguments,2),S=typeof V=='function'",h:{b:"u[j]=(S?V:B[V]).apply(B,D)",k:"u"+(Ot?"[o]=":".push")+"((S?V:B[V]).apply(B,D))"}}),yn=l(Bt,zt),bn=l(zt,{a:"d,cc",h:{b:"u[j]=B[cc]",k:"u"+(Ot?"[o]=":".push")+"(B[cc])"}}),wn=l({a:"d,c,C,y",i:"C",p:"var W=arguments.length<3;c=f(c,y)",d:{b:"if(W)u=k[++j]"},h:{b:"u=c(u,B,j,d)",k:"u=W?(W=false,B):c(u,B,j,d)"}}),En=l(Bt,qt,{h:"!"+qt.h}),Sn=l(Bt,Ft,{i:"false",h:Ft.h.replace("!","")}),xn=l(Bt,jt,zt,{h:{b:"u[j]={a:c(B,j,d),b:j,c:B}"
|
}),gn=l(zt,{a:"d,U",p:"var C=v.call(arguments,2),R=typeof U=='function'",h:{b:"t[i]=(R?U:A[U]).apply(A,C)",k:"t"+(Ot?"[n]=":".push")+"((R?U:A[U]).apply(A,C))"}}),yn=l(Bt,zt),bn=l(zt,{a:"d,bb",h:{b:"t[i]=A[bb]",k:"t"+(Ot?"[n]=":".push")+"(A[bb])"}}),wn=l({a:"d,c,B,x",i:"B",p:"var V=arguments.length<3;c=f(c,x)",d:{b:"if(V)t=j[++i]"},h:{b:"t=c(t,A,i,d)",k:"t=V?(V=false,A):c(t,A,i,d)"}}),En=l(Bt,qt,{h:"!"+qt.h}),Sn=l(Bt,Ft,{i:"false",h:Ft.h.replace("!","")}),xn=l(Bt,jt,zt,{h:{b:"t[i]={a:c(A,i,d),b:i,c:A}"
|
||||||
,k:"u"+(Ot?"[o]=":".push")+"({a:c(B,j,d),b:j,c:B})"},e:"u.sort(J);l=u.length;while(l--)u[l]=u[l].c"}),Tn=l(qt,{a:"d,bb",p:"var t=[];K(bb,function(B,q){t.push(q)});var dd=t.length",h:"for(var q,aa=true,s=0;s<dd;s++){q=t[s];if(!(aa=B[q]===bb[q]))break}aa&&u.push(B)"}),Nn=l({q:i,r:i,a:"n",p:"var M=arguments,l=M.length;if(l>1){for(var j=1;j<l;j++)u[M[j]]=G(u[M[j]],u);return u}",h:"if(T(u[j]))u[j]=G(u[j],u)"});s.VERSION="0.8.0",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this
|
,k:"t"+(Ot?"[n]=":".push")+"({a:c(A,i,d),b:i,c:A})"},e:"t.sort(I);k=t.length;while(k--)t[k]=t[k].c"}),Tn=l(qt,{a:"d,aa",p:"var s=[];J(aa,function(A,p){s.push(p)});var cc=s.length",h:"for(var p,Z=true,r=0;r<cc;r++){p=s[r];if(!(Z=A[p]===aa[p]))break}Z&&t.push(A)"}),Nn=l({q:i,r:i,a:"m",p:"var L=arguments,k=L.length;if(k>1){for(var i=1;i<k;i++)t[L[i]]=F(t[L[i]],t);return t}",h:"if(S(A))t[i]=F(A,t)"});s.VERSION="0.8.1",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments
|
||||||
,arguments)}},s.bind=L,s.bindAll=Nn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=y,s.compact=function(e){for(var t=-1,n=e.length,r=[];++t<n;)e[t]&&r.push(e[t]);return r},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=ln,s.countBy=cn,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,yt(a),a=bt(i,t),r&&(o=e.apply
|
)}},s.bind=L,s.bindAll=Nn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=y,s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;)e[t]&&r.push(e[t]);return r},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=ln,s.countBy=cn,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,yt(a),a=bt(i,t),r&&(o=e.apply(u,
|
||||||
(u,s)),o}},s.defaults=Gt,s.defer=function(e){var n=Z.call(arguments,1);return bt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=Z.call(arguments,2);return bt(function(){return e.apply(t,r)},n)},s.difference=function(e){for(var t=-1,n=e.length,r=K.apply(_,arguments),r=o(r,n),i=[];++t<n;)r(e[t])||i.push(e[t]);return i},s.escape=function(e){return e==r?"":(e+"").replace(V,h)},s.every=hn,s.extend=Yt,s.filter=pn,s.find=dn,s.first=E,s.flatten=S,s.forEach=vn,s.forIn=Zt,s.forOwn=en,s.functions=
|
s)),o}},s.defaults=Gt,s.defer=function(e){var n=Z.call(arguments,1);return bt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=Z.call(arguments,2);return bt(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=K.apply(_,arguments),i=o(i,r);++n<r;){var s=e[n];i(s)||t.push(s)}return t},s.escape=function(e){return e==r?"":(e+"").replace(V,h)},s.every=hn,s.extend=Yt,s.filter=pn,s.find=dn,s.first=E,s.flatten=S,s.forEach=vn,s.forIn=
|
||||||
tn,s.groupBy=mn,s.has=function(e,t){return Q.call(e,t)},s.identity=A,s.indexOf=x,s.initial=function(e,t,n){return Z.call(e,0,-(t==r||n?1:t))},s.intersection=function(e){var t,n=arguments.length,r=[],i=-1,s=e.length,u=[];e:for(;++i<s;)if(t=e[i],0>x(u,t)){for(var a=1;a<n;a++)if(!(r[a]||(r[a]=o(arguments[a])))(t))continue e;u.push(t)}return u},s.invert=Xt,s.invoke=gn,s.isArguments=v,s.isArray=Vt,s.isBoolean=function(e){return e===n||e===i||et.call(e)==ht},s.isDate=function(e){return et.call(e)==pt},
|
Zt,s.forOwn=en,s.functions=tn,s.groupBy=mn,s.has=function(e,t){return e?Q.call(e,t):i},s.identity=A,s.indexOf=x,s.initial=function(e,t,n){return e?Z.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments.length,n=[],r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var u=e[r];if(0>x(s,u)){for(var a=1;a<t;a++)if(!(n[a]||(n[a]=o(arguments[a])))(u))continue e;s.push(u)}}return s},s.invert=Xt,s.invoke=gn,s.isArguments=v,s.isArray=Vt,s.isBoolean=function(e){return e===n||e===i||et.call(e)==ht},
|
||||||
s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=nn,s.isEqual=b,s.isFinite=function(e){return st(e)&&et.call(e)==dt},s.isFunction=m,s.isNaN=function(e){return et.call(e)==dt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return et.call(e)==dt},s.isObject=function(e){return e?Pt[typeof e]:i},s.isPlainObject=$t,s.isRegExp=function(e){return et.call(e)==mt},s.isString=function(e){return et.call(e)==gt},s.isUndefined=function(e){return e===t},s.keys=rn,s.last=function(e
|
s.isDate=function(e){return et.call(e)==pt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=nn,s.isEqual=b,s.isFinite=function(e){return st(e)&&et.call(e)==dt},s.isFunction=m,s.isNaN=function(e){return et.call(e)==dt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return et.call(e)==dt},s.isObject=function(e){return e?Pt[typeof e]:i},s.isPlainObject=$t,s.isRegExp=function(e){return et.call(e)==mt},s.isString=function(e){return et.call(e)==gt},s.isUndefined=function(
|
||||||
,t,n){var i=e.length;return t==r||n?e[i-1]:Z.call(e,-t||i)},s.lastIndexOf=function(e,t,n){var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?ut(0,r+n):at(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,Z.call(arguments,2))},s.map=yn,s.max=T,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Q.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=sn,s.min=function(e,t,n){for(var r=Infinity,i=-1,s=e?e.length:0,o=
|
e){return e===t},s.keys=rn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:Z.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?ut(0,r+n):at(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,Z.call(arguments,2))},s.map=yn,s.max=T,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Q.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=sn,s.min=function(
|
||||||
r,t=f(t,n);++i<s;)n=t(e[i],i,e),n<r&&(r=n,o=e[i]);return o},s.mixin=O,s.noConflict=function(){return e._=B,this},s.object=function(e,t){for(var n=-1,r=e.length,i={};++n<r;)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},s.omit=on,s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=un,s.partial=function(e){return a(e,Z.call(arguments,1))},s.pick=an,s.pluck=bn,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+nt(ft()*((+t||0)-
|
e,t,n){for(var r=Infinity,i=-1,s=e?e.length:0,o=r,t=f(t,n);++i<s;)n=t(e[i],i,e),n<r&&(r=n,o=e[i]);return o},s.mixin=O,s.noConflict=function(){return e._=B,this},s.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},s.omit=on,s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=un,s.partial=function(e){return a(e,Z.call(arguments,1))},s.pick=an,s.pluck=bn,s.random=function(e,t){return e==r&&t==
|
||||||
e+1))},s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=ut(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=wn,s.reduceRight=w,s.reject=En,s.rest=N,s.result=function(e,t){var n=e?e[t]:r;return m(n)?e[t]():n},s.shuffle=function(e){for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=nt(ft()*(n+1)),i[n]=i[t],i[t]=e[n];return i},s.size=function(e){var t=e?e.length:0;return t===+t?t:rn(e).length},s.some=Sn,s.sortBy=xn,s.sortedIndex=C,s.tap=function(e,t){return t(e
|
r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+nt(ft()*((+t||0)-e+1))},s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=ut(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=wn,s.reduceRight=w,s.reject=En,s.rest=N,s.result=function(e,t){var n=e?e[t]:r;return m(n)?e[t]():n},s.shuffle=function(e){for(var t=-1,n=e?e.length:0,r=Array(n);++t<n;){var i=nt(ft()*(t+1));r[t]=r[i],r[i]=e[t]}return r},s.size=function(e){var t=e?e.length:0;return t===+t?t:rn(e).length},s.some=Sn
|
||||||
),e},s.template=function(e,t,n){n||(n={});var r,i,o=0,u=s.templateSettings,a="__p += '",f=n.variable||u.variable,l=f;e.replace(RegExp((n.escape||u.escape||X).source+"|"+(n.interpolate||u.interpolate||X).source+"|"+(n.evaluate||u.evaluate||X).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace($,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||j.test(n||i)),o=u+t.length}),a+="';",l||(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+
|
,s.sortBy=xn,s.sortedIndex=C,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e+="",n||(n={});var r,i,o=0,u=s.templateSettings,a="__p += '",f=n.variable||u.variable,l=f;e.replace(RegExp((n.escape||u.escape||X).source+"|"+(n.interpolate||u.interpolate||X).source+"|"+(n.evaluate||u.evaluate||X).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace($,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||j.test(n||i)),o=u+t.length}),a+="';",l||
|
||||||
f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=a,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(
|
(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=a,i)},s.throttle=function(e,t
|
||||||
){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=bt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){var t=e?e.length:0;return t===+t?(Nt?et.call(e)==gt:"string"==typeof e)?e.split(""):Z.call(e):fn(e)},s.unescape=function(e){return e==r?"":(e+"").replace(F,d)},s.union=function(){for(var e=-1,t=K.apply(_,arguments),n=t.length,r=[];++e<n;)0>x(r,t[e])&&r.push(t[e]);return r},s.uniq=k,s.uniqueId=
|
){function n(){a=new Date,u=r,s=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=bt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){if(!e)return[];var t=e.length;return t===+t?(Nt?et.call(e)==gt:"string"==typeof e)?e.split(""):Z.call(e):fn(e)},s.unescape=function(e){return e==r?"":(e+"").replace(F,d)},s.union=function(){for(var e=-1,t=K.apply(_
|
||||||
function(e){var t=P++;return e?e+t:t},s.values=fn,s.where=Tn,s.without=function(e){for(var t=-1,n=e.length,r=o(arguments,1,20),i=[];++t<n;)r(e[t])||i.push(e[t]);return i},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&G.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=T(bn(arguments,"length")),r=Array(n);++t<n;)r[t]=bn(arguments,t);return r},s.all=hn,s.any=Sn,s.collect=yn,s.detect=dn,s.drop=N,s.each=vn,s.foldl=wn,s.foldr=w,s.head=E,s.include=ln,s.inject=
|
,arguments),n=t.length,r=[];++e<n;)0>x(r,t[e])&&r.push(t[e]);return r},s.uniq=k,s.uniqueId=function(e){var t=P++;return e?e+t:t},s.values=fn,s.where=Tn,s.without=function(e){for(var t=-1,n=e?e.length:0,r=o(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&G.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?T(bn(arguments,"length")):0,r=Array(n);++t<n;)r[t]=bn(arguments,t);return r},s.all=
|
||||||
wn,s.methods=tn,s.select=pn,s.tail=N,s.take=E,s.unique=k,O(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},vn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=_[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Et&&e.length===0&&delete e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),vn(["concat","join","slice"],function(e){var t=_[e];s.prototype[e]=function(){var e=t.apply
|
hn,s.any=Sn,s.collect=yn,s.detect=dn,s.drop=N,s.each=vn,s.foldl=wn,s.foldr=w,s.head=E,s.include=ln,s.inject=wn,s.methods=tn,s.select=pn,s.tail=N,s.take=E,s.unique=k,O(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},vn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=_[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Et&&e.length===0&&delete e[0],this.__chain__&&(e=new s(e),e
|
||||||
(this.__wrapped__,arguments);return this.__chain__&&(e=new s(e),e.__chain__=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):M?"object"==typeof module&&module&&module.exports==M?(module.exports=s)._=s:M._=s:e._=s})(this);
|
.__chain__=n),e}}),vn(["concat","join","slice"],function(e){var t=_[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new s(e),e.__chain__=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):M?"object"==typeof module&&module&&module.exports==M?(module.exports=s)._=s:M._=s:e._=s})(this);
|
||||||
67
lodash.underscore.min.js
vendored
67
lodash.underscore.min.js
vendored
@@ -1,35 +1,36 @@
|
|||||||
/*!
|
/*!
|
||||||
Lo-Dash 0.8.0 lodash.com/license
|
Lo-Dash 0.8.1 lodash.com/license
|
||||||
Underscore.js 1.4.0 underscorejs.org/LICENSE
|
Underscore.js 1.4.1 underscorejs.org/LICENSE
|
||||||
*/
|
*/
|
||||||
;(function(e,t){function s(e,t,r){var s,t=T(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],t(s,r,e))return n}else for(r in e)if(st.call(e,r)&&(s=e[r],t(s,r,e)))return n;return i}function o(e,t,n,r){var s,o,u=n,a=3>arguments.length,t=T(t,r),f=e.length;s=-1;if(f===+f)for(a&&(u=e[++s]);++s<f;)o=e[s],u=t(u,o,s,e);else for(s in e)st.call(e,s)&&(o=e[s],u=a?(a=i,o):t(u,o,s,e));return u}function u(e,t){var n,r,i,s=e.length;n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]=r[t];else for(n in i=[],e)st
|
;(function(e,t){function s(e,t,r){var s;if(!e)return i;var t=x(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],t(s,r,e))return n}else for(r in e)if(it.call(e,r)&&(s=e[r],t(s,r,e)))return n;return i}function o(e,t,n,r){var s,o,u=n;if(!e)return u;var a=3>arguments.length,t=x(t,r),f=e.length;s=-1;if(f===+f)for(a&&(u=e[++s]);++s<f;)o=e[s],u=t(u,o,s,e);else for(s in e)it.call(e,s)&&(o=e[s],u=a?(a=i,o):t(u,o,s,e));return u}function u(e,t){var n,r,i;if(!e)return i;var s=e.length;n=-1;if(s===+s)for(
|
||||||
.call(e,n)&&(r=e[n],i.push(r[t]));return i}function a(e,t,n){var r,i,t=T(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]=t(r,n,e);else for(n in i=[],e)st.call(e,n)&&(r=e[n],i.push(t(r,n,e)));return i}function f(e,t,n){var r,t=T(t,n),i=e.length,n=-1;if(i===+i)for(;++n<i;)r=e[n],t(r,n,e);else for(n in e)st.call(e,n)&&(r=e[n],t(r,n,e));return e}function l(e,t,n){var r,t=T(t,n),i=e.length,n=-1;if(i===+i){for(;++n<i;)if(r=e[n],t(r,n,e))return r}else for(n in e)if(st.call(e,n)&&(r=e[n]
|
i=Array(s);++n<s;)r=e[n],i[n]=r[t];else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push(r[t]));return i}function a(e,t,n){var r,i;if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]=t(r,n,e);else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push(t(r,n,e)));return i}function f(e,t,n){var r;if(!e)return e;var t=x(t,n),i=e.length,n=-1;if(i===+i)for(;++n<i;)r=e[n],t(r,n,e);else for(n in e)it.call(e,n)&&(r=e[n],t(r,n,e));return e}function l(e,t,n){var r;if(e){var t=x(t,n),i=
|
||||||
,t(r,n,e)))return r}function c(e,t,n){var r,i=[],t=T(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],t(r,n,e)&&i.push(r);else for(n in e)st.call(e,n)&&(r=e[n],t(r,n,e)&&i.push(r));return i}function h(e,t,r){var s,t=T(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],!t(s,r,e))return i}else for(r in e)if(st.call(e,r)&&(s=e[r],!t(s,r,e)))return i;return n}function p(e,t){var r,s,o=e.length;r=-1;if(o===+o){if(ft.call(e)==Tt)return-1<e.indexOf(t);for(;++r<o;)if(s=e[r],s===t)return n}else for(r in
|
e.length,n=-1;if(i===+i){for(;++n<i;)if(r=e[n],t(r,n,e))return r}else for(n in e)if(it.call(e,n)&&(r=e[n],t(r,n,e)))return r}}function c(e,t,n){var r,i=[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],t(r,n,e)&&i.push(r);else for(n in e)it.call(e,n)&&(r=e[n],t(r,n,e)&&i.push(r));return i}function h(e,t,r){var s;if(!e)return n;var t=x(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],!t(s,r,e))return i}else for(r in e)if(it.call(e,r)&&(s=e[r],!t(s,r,e)))return i;return n
|
||||||
e)if(st.call(e,r)&&(s=e[r],s===t))return n;return i}function d(e){var t,n,r=[];for(t in e)st.call(e,t)&&(n=e[t],r.push(n));return r}function v(e){var t,n,r=[];for(t in e)n=e[t],A(n)&&r.push(t);return r.sort(),r}function m(e,t,n){var r,t=T(t,n);for(r in e)n=e[r],t(n,r,e);return e}function g(e){for(var t,n,r=e,i=1,s=arguments.length;i<s;i++)if(r=arguments[i])for(t in r)n=r[t],e[t]=n;return e}function y(e){var t,n=[];if(!e||!Lt[typeof e])throw TypeError();for(t in e)st.call(e,t)&&n.push(t);return n}
|
}function p(e,t){var r,s;if(!e)return i;var o=e.length;r=-1;if(o===+o){if(ut.call(e)==St)return-1<e.indexOf(t);for(;++r<o;)if(s=e[r],s===t)return n}else for(r in e)if(it.call(e,r)&&(s=e[r],s===t))return n;return i}function d(e){var t,n,r=[];if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r.push(n));return r}function v(e){var t,n,r=[];if(!e)return r;for(t in e)n=e[t],L(n)&&r.push(t);return r.sort(),r}function m(e,t,n){var r;if(!e)return e;t=x(t,n);for(r in e)n=e[r],t(n,r,e);return e}function g(e){
|
||||||
function b(e){var t,n,r={};for(t in e)st.call(e,t)&&(n=e[t],r[n]=t);return r}function w(e){if(e&&e.__wrapped__)return e;if(!(this instanceof w))return new w(e);this.__wrapped__=e}function E(e,t){return function(n){return-1<H(e,n,t||0)}}function S(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function x(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(at.call(i)):n),this instanceof r?(k.prototype=e.prototype,s=new
|
var t,n,r=e;if(!e)return e;for(var i=1,s=arguments.length;i<s;i++)if(r=arguments[i])for(t in r)n=r[t],e[t]=n;return e}function y(e){var t,n=[];if(!e)return n;for(t in e)it.call(e,t)&&n.push(t);return n}function b(e){var t,n,r={};if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r[n]=t);return r}function w(e){if(e&&e.__wrapped__)return e;if(!(this instanceof w))return new w(e);this.__wrapped__=e}function E(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<
|
||||||
k,(i=e.apply(s,i))&&Lt[typeof i]?i:s):e.apply(s,i)}return r}function T(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:R}function N(e){return"\\"+At[e]}function C(e){return Mt[e]}function k(){}function L(e){return _t[e]}function A(e){return"function"==typeof e}function O(e){var t=i;if(!e||"object"!=typeof e||isArguments(e))return t;var n=e.constructor;return!A(n)||n instanceof n?(m(e,function(e,n){t=n}),t===i||st.call(e,t)):t}function M(
|
i?-1:1}function S(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(ot.call(i)):n),this instanceof r?(C.prototype=e.prototype,s=new C,(i=e.apply(s,i))&&Ct[typeof i]?i:s):e.apply(s,i)}return r}function x(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:q}function T(e){return"\\"+kt[e]}function N(e){return At[e]}function C(){}function k(e){return Ot[e]}function L(e){return"function"==typeof e}function A(e){var t=
|
||||||
e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Lt[typeof e]||Lt[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=ft.call(e);if(u!=ft.call(t))return i;switch(u){case bt:case wt:return+e==+t;case Et:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case xt:case Tt:return e==t+""}var a=Ot(e);if(!a&&u!=St)return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var f=n,u=0;s.push(e),o.push(t);if(a){u=e.length;if(f=u==t.length)for(;u--&&(f=M(e[u],t[u],s,o)););return f
|
i;if(!e||"object"!=typeof e||isArguments(e))return t;var n=e.constructor;return!L(n)||n instanceof n?(m(e,function(e,n){t=n}),t===i||it.call(e,t)):t}function O(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Ct[typeof e]||Ct[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=ut.call(e);if(u!=ut.call(t))return i;switch(u){case gt:case yt:return+e==+t;case bt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Et:case St:return e==t+""}var a=Lt(e);if(!a&&u!=wt)return i;s||(s=[]),o||
|
||||||
}a=e.constructor,f=t.constructor;if(a!=f&&(!A(a)||!(a instanceof a&&A(f)&&f instanceof f)))return i;for(var l in e)if(st.call(e,l)&&(u++,!st.call(t,l)||!M(e[l],t[l],s,o)))return i;for(l in t)if(st.call(t,l)&&!(u--))return i;return n}function _(e,t,n,r){var s=e.length,o=3>arguments.length;if(s!==+s)var u=Dt(e),s=u.length;return f(e,function(a,f,l){f=u?u[--s]:--s,n=o?(o=i,e[f]):t.call(r,n,e[f],f,l)}),n}function D(e,t,n){return t==r||n?e[0]:at.call(e,0,t)}function P(e,t){for(var n,r=-1,i=e.length,s=
|
(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var f=n,u=0;s.push(e),o.push(t);if(a){u=e.length;if(f=u==t.length)for(;u--&&(f=O(e[u],t[u],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!L(a)||!(a instanceof a&&L(f)&&f instanceof f)))return i;for(var l in e)if(it.call(e,l)&&(u++,!it.call(t,l)||!O(e[l],t[l],s,o)))return i;for(l in t)if(it.call(t,l)&&!(u--))return i;return n}function M(e,t,n,r){var s=e?e.length:0,o=3>arguments.length;if(s!==+s)var u=Mt(e),s=u.length;return f(e,function(
|
||||||
[];++r<i;)n=e[r],Ot(n)?ot.apply(s,t?n:P(n)):s.push(n);return s}function H(e,t,n){var r=-1,i=e.length;if(n){if("number"!=typeof n)return r=F(e,t),e[r]===t?r:-1;r=(0>n?mt(0,i+n):n)-1}for(;++r<i;)if(e[r]===t)return r;return-1}function B(e,t,n){for(var r=-Infinity,i=-1,s=e?e.length:0,o=r,t=T(t,n);++i<s;)n=t(e[i],i,e),n>r&&(r=n,o=e[i]);return o}function j(e,t,n){return at.call(e,t==r||n?1:t)}function F(e,t,n,r){for(var i=0,s=e.length,n=T(n,r),t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function I
|
a,f,l){f=u?u[--s]:--s,n=o?(o=i,e[f]):t.call(r,n,e[f],f,l)}),n}function _(e,t,n){if(e)return t==r||n?e[0]:ot.call(e,0,t)}function D(e,t){for(var n,r=-1,i=e?e.length:0,s=[];++r<i;)n=e[r],Lt(n)?st.apply(s,t?n:D(n)):s.push(n);return s}function P(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?dt(0,i+n):n||0)-1;else if(n)return r=j(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function H(e,t,n){for(var r=-Infinity,i=-1,s=e?e.length:0,o=r,t=x(t,n);++i<s;)n=t(e[i],i,e),n>r&&(r=
|
||||||
(e,t,n,r){var s=-1,o=e.length,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=T(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>H(a,r))a.push(r),u.push(e[s]);return u}function q(e,t){return kt||lt&&2<arguments.length?lt.call.apply(lt,arguments):x(e,t,at.call(arguments,2))}function R(e){return e}function U(e){f(v(e),function(t){var r=w[t]=e[t];w.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&ot.apply(e,arguments),e=r.apply(w,e),this.__chain__&&(e=new w(e),e.__chain__=
|
n,o=e[i]);return o}function B(e,t,n){return e?ot.call(e,t==r||n?1:t):[]}function j(e,t,n,r){for(var i=0,s=e?e.length:i,n=x(n,r),t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function F(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=x(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>P(a,r))a.push(r),u.push(e[s]);return u}function I(e,t){return Nt||at&&2<arguments.length?at.call.apply(at,arguments):S(e,t,ot.call(arguments,2))}function q(e){return e}function R
|
||||||
n),e}})}var n=!0,r=null,i=!1,z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),W=Array.prototype,X=Object.prototype,V=0,$=e._,J=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,K=/&(?:amp|lt|gt|quot|#x27);/g,Q=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,Y=/(__e\(.*?\)|\b__t\))\+'';/g,Z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,et=RegExp("^"+(X.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g
|
(e){f(v(e),function(t){var r=w[t]=e[t];w.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&st.apply(e,arguments),e=r.apply(w,e),this.__chain__&&(e=new w(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,U="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),z=Array.prototype,W=Object.prototype,X=0,V=e._,$=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,J=/&(?:amp|lt|gt|quot|#x27);/g,K=/\b__p\+='';/g
|
||||||
,".+?")+"$"),tt=/($^)/,nt=/[&<>"']/g,rt=/['\n\r\t\u2028\u2029\\]/g,it=W.concat,st=X.hasOwnProperty,ot=W.push,ut=X.propertyIsEnumerable,at=W.slice,ft=X.toString,lt=et.test(lt=at.bind)&<,ct=Math.floor,ht=et.test(ht=Object.getPrototypeOf)&&ht,pt=et.test(pt=Array.isArray)&&pt,dt=e.isFinite,vt=et.test(vt=Object.keys)&&vt,mt=Math.max,gt=Math.min,yt=Math.random,bt="[object Boolean]",wt="[object Date]",Et="[object Number]",St="[object Object]",xt="[object RegExp]",Tt="[object String]",Nt=e.clearTimeout
|
,Q=/\b(__p\+=)''\+/g,G=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,Z=RegExp("^"+(W.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),et=/($^)/,tt=/[&<>"']/g,nt=/['\n\r\t\u2028\u2029\\]/g,rt=z.concat,it=W.hasOwnProperty,st=z.push,ot=z.slice,ut=W.toString,at=Z.test(at=ot.bind)&&at,ft=Math.floor,lt=Z.test(lt=Object.getPrototypeOf)&<,ct=Z.test(ct=Array.isArray)&&ct,ht=e.isFinite,pt=Z.test(pt=Object.keys)&&pt,dt=Math.max,vt=Math
|
||||||
,Ct=e.setTimeout,kt=lt&&/\n|Opera/.test(lt+ft.call(e.opera)),Lt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},At={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};w.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},w.isArguments=function(e){return"[object Arguments]"==ft.call(e)},w.isArguments(arguments)||(w.isArguments=function(e){return!!e&&!!st.call(e,"callee")});var Ot=
|
.min,mt=Math.random,gt="[object Boolean]",yt="[object Date]",bt="[object Number]",wt="[object Object]",Et="[object RegExp]",St="[object String]",xt=e.clearTimeout,Tt=e.setTimeout,Nt=at&&/\n|Opera/.test(at+ut.call(e.opera)),Ct={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},kt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};w.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""
|
||||||
pt||function(e){return"[object Array]"==ft.call(e)};A(/x/)&&(A=function(e){return"[object Function]"==ft.call(e)});var X=ht?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=ht(t))&&ht(n);return n?e==n||ht(e)==n&&!isArguments(e):O(e)}:O,Mt={"&":"&","<":"<",">":">",'"':""","'":"'"},_t=b(Mt),Dt=vt?function(e){return"function"==typeof e&&ut.call(e,"prototype")?y(e):vt(e)}:y;w.VERSION="0.8.0",w.after=function(e,t){return 1>e?t():function(){if(1>--
|
},w.isArguments=function(e){return"[object Arguments]"==ut.call(e)},w.isArguments(arguments)||(w.isArguments=function(e){return e?it.call(e,"callee"):i});var Lt=ct||function(e){return"[object Array]"==ut.call(e)};L(/x/)&&(L=function(e){return"[object Function]"==ut.call(e)});var W=lt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=lt(t))&<(n);return n?e==n||lt(e)==n&&!isArguments(e):A(e)}:A,At={"&":"&","<":"<",">":">",'"':""","'":"'"
|
||||||
e)return t.apply(this,arguments)}},w.bind=q,w.bindAll=function(e){var t,n=e,r=e,i=arguments,s=i.length;if(1<s){for(t=1;t<s;t++)r[i[t]]=q(r[i[t]],r);return r}for(t in n)A(r[t])&&(r[t]=q(r[t],r));return r},w.chain=function(e){return e=new w(e),e.__chain__=n,e},w.clone=function(e){return e&&Lt[typeof e]?Ot(e)?at.call(e):g({},e):e},w.compact=function(e){for(var t=-1,n=e.length,r=[];++t<n;)e[t]&&r.push(e[t]);return r},w.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length
|
},Ot=b(At),Mt=pt?function(e){return e&&Ct[typeof e]?pt(e):[]}:y;w.VERSION="0.8.1",w.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},w.bind=I,w.bindAll=function(e){var t,n,r=e,i=e;if(!e)return i;n=arguments;var s=n.length;if(1<s){for(t=1;t<s;t++)i[n[t]]=I(i[n[t]],i);return i}for(t in r)n=r[t],L(n)&&(i[t]=I(n,i));return i},w.chain=function(e){return e=new w(e),e.__chain__=n,e},w.clone=function(e){return e&&Ct[typeof e]?Lt(e)?ot.call(e):g({},e):e},w.compact=function(
|
||||||
;n--;)t=[e[n].apply(this,t)];return t[0]}},w.contains=p,w.countBy=function(e,t,n){var r,i={},t=T(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],r=t(r,n,e),st.call(i,r)?i[r]++:i[r]=1;else for(n in e)st.call(e,n)&&(r=e[n],r=t(r,n,e),st.call(i,r)?i[r]++:i[r]=1);return i},w.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,Nt(a),a=Ct(i,t),r&&(o=e.apply(u,s)),o}},w.defaults=function(e){for(var t,n,i=e,s=1,o=arguments.length
|
e){for(var t=-1,n=e?e.length:0,r=[];++t<n;)e[t]&&r.push(e[t]);return r},w.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},w.contains=p,w.countBy=function(e,t,n){var r,i={};if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],r=t(r,n,e),it.call(i,r)?i[r]++:i[r]=1;else for(n in e)it.call(e,n)&&(r=e[n],r=t(r,n,e),it.call(i,r)?i[r]++:i[r]=1);return i},w.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply
|
||||||
;s<o;s++)if(i=arguments[s])for(t in i)n=i[t],e[t]==r&&(e[t]=n);return e},w.defer=function(e){var n=at.call(arguments,1);return Ct(function(){return e.apply(t,n)},1)},w.delay=function(e,n){var r=at.call(arguments,2);return Ct(function(){return e.apply(t,r)},n)},w.difference=function(e){for(var t=-1,n=e.length,r=it.apply(W,arguments),r=E(r,n),i=[];++t<n;)r(e[t])||i.push(e[t]);return i},w.escape=function(e){return e==r?"":(e+"").replace(nt,C)},w.every=h,w.extend=g,w.filter=c,w.find=l,w.first=D,w.flatten=
|
(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,xt(a),a=Tt(i,t),r&&(o=e.apply(u,s)),o}},w.defaults=function(e){var t,n,i=e;if(!e)return e;for(var s=1,o=arguments.length;s<o;s++)if(i=arguments[s])for(t in i)n=i[t],e[t]==r&&(e[t]=n);return e},w.defer=function(e){var n=ot.call(arguments,1);return Tt(function(){return e.apply(t,n)},1)},w.delay=function(e,n){var r=ot.call(arguments,2);return Tt(function(){return e.apply(t,r)},n)},w.difference=function(e){for(var t=-1,n=e.length
|
||||||
P,w.forEach=f,w.forIn=m,w.forOwn=function(e,t,n){var r,t=T(t,n);for(r in e)st.call(e,r)&&(n=e[r],t(n,r,e));return e},w.functions=v,w.groupBy=function(e,t,n){var r,i={},t=T(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;){r=e[n];var o=t(r,n,e);(st.call(i,o)?i[o]:i[o]=[]).push(r)}else for(n in e)st.call(e,n)&&(r=e[n],o=t(r,n,e),(st.call(i,o)?i[o]:i[o]=[]).push(r));return i},w.has=function(e,t){return st.call(e,t)},w.identity=R,w.indexOf=H,w.initial=function(e,t,n){return at.call(e,0,-(t==r||n?1:t))},w.intersection=
|
,r=rt.apply(z,arguments),i=[];++t<n;){var s=e[t];0>P(r,s,n)&&i.push(s)}return i},w.escape=function(e){return e==r?"":(e+"").replace(tt,N)},w.every=h,w.extend=g,w.filter=c,w.find=l,w.first=_,w.flatten=D,w.forEach=f,w.forIn=m,w.forOwn=function(e,t,n){var r;if(!e)return e;t=x(t,n);for(r in e)it.call(e,r)&&(n=e[r],t(n,r,e));return e},w.functions=v,w.groupBy=function(e,t,n){var r,i={};if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;){r=e[n];var o=t(r,n,e);(it.call(i,o)?i[o]:i[o]=[]).push
|
||||||
function(e){var t,n=arguments.length,r=[],i=-1,s=e.length,o=[];e:for(;++i<s;)if(t=e[i],0>H(o,t)){for(var u=1;u<n;u++)if(!(r[u]||(r[u]=E(arguments[u])))(t))continue e;o.push(t)}return o},w.invert=b,w.invoke=function(e,t){var n,r,i=e,s,o=at.call(arguments,2),u="function"==typeof t,a=i.length;n=-1;if(a===+a)for(s=Array(a);++n<a;)r=i[n],s[n]=(u?t:r[t]).apply(r,o);else for(n in s=[],i)st.call(i,n)&&(r=i[n],s.push((u?t:r[t]).apply(r,o)));return s},w.isArray=Ot,w.isBoolean=function(e){return e===n||e===
|
(r)}else for(n in e)it.call(e,n)&&(r=e[n],o=t(r,n,e),(it.call(i,o)?i[o]:i[o]=[]).push(r));return i},w.has=function(e,t){return e?it.call(e,t):i},w.identity=q,w.indexOf=P,w.initial=function(e,t,n){return e?ot.call(e,0,-(t==r||n?1:t)):[]},w.intersection=function(e){var t=arguments.length,n=-1,r=e.length,i=[];e:for(;++n<r;){var s=e[n];if(0>P(i,s)){for(var o=1;o<t;o++)if(0>P(arguments[o],s))continue e;i.push(s)}}return i},w.invert=b,w.invoke=function(e,t){var n,r,i=e,s;if(!e)return s;var o=ot.call(arguments
|
||||||
i||ft.call(e)==bt},w.isDate=function(e){return ft.call(e)==wt},w.isElement=function(e){return e?1===e.nodeType:i},w.isEmpty=function(e){var t;if(!e)return n;var r=ft.call(e),s=e.length;if(Ot(e)||r==Tt||r==St&&s===+s&&A(e.splice))return!s;for(t in e)if(st.call(e,t))return i;return n},w.isEqual=M,w.isFinite=function(e){return dt(e)&&ft.call(e)==Et},w.isFunction=A,w.isNaN=function(e){return ft.call(e)==Et&&e!=+e},w.isNull=function(e){return e===r},w.isNumber=function(e){return ft.call(e)==Et},w.isObject=
|
,2),u="function"==typeof t,a=i.length;n=-1;if(a===+a)for(s=Array(a);++n<a;)r=i[n],s[n]=(u?t:r[t]).apply(r,o);else for(n in s=[],i)it.call(i,n)&&(r=i[n],s.push((u?t:r[t]).apply(r,o)));return s},w.isArray=Lt,w.isBoolean=function(e){return e===n||e===i||ut.call(e)==gt},w.isDate=function(e){return ut.call(e)==yt},w.isElement=function(e){return e?1===e.nodeType:i},w.isEmpty=function(e){var t;if(!e)return n;var r=ut.call(e),s=e.length;if(Lt(e)||r==St||r==wt&&s===+s&&L(e.splice))return!s;for(t in e)if(it
|
||||||
function(e){return e?Lt[typeof e]:i},w.isPlainObject=X,w.isRegExp=function(e){return ft.call(e)==xt},w.isString=function(e){return ft.call(e)==Tt},w.isUndefined=function(e){return e===t},w.keys=Dt,w.last=function(e,t,n){var i=e.length;return t==r||n?e[i-1]:at.call(e,-t||i)},w.lastIndexOf=function(e,t,n){var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?mt(0,r+n):gt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},w.map=a,w.max=B,w.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this
|
.call(e,t))return i;return n},w.isEqual=O,w.isFinite=function(e){return ht(e)&&ut.call(e)==bt},w.isFunction=L,w.isNaN=function(e){return ut.call(e)==bt&&e!=+e},w.isNull=function(e){return e===r},w.isNumber=function(e){return ut.call(e)==bt},w.isObject=function(e){return e?Ct[typeof e]:i},w.isPlainObject=W,w.isRegExp=function(e){return ut.call(e)==Et},w.isString=function(e){return ut.call(e)==St},w.isUndefined=function(e){return e===t},w.keys=Mt,w.last=function(e,t,n){if(e){var i=e.length;return t==
|
||||||
,arguments):arguments[0];return st.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},w.min=function(e,t,n){for(var r=Infinity,i=-1,s=e?e.length:0,o=r,t=T(t,n);++i<s;)n=t(e[i],i,e),n<r&&(r=n,o=e[i]);return o},w.mixin=U,w.noConflict=function(){return e._=$,this},w.object=function(e,t){for(var n=-1,r=e.length,i={};++n<r;)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},w.omit=function(e,t,n){var r,i,s=e,o={},u="function"==typeof t;if(u)t=T(t,n);else var a=it.apply(W,arguments);for(r in s)if(i=s[r],u?!t(i,r,e
|
r||n?e[i-1]:ot.call(e,-t||i)}},w.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?dt(0,r+n):vt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},w.map=a,w.max=H,w.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return it.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},w.min=function(e,t,n){for(var r=Infinity,i=-1,s=e?e.length:0,o=r,t=x(t,n);++i<s;)n=t(e[i],i,e),n<r&&(r=n,o=e[i]);return o},w.mixin=R,w.noConflict=function(){return e
|
||||||
):0>H(a,r))o[r]=i;return o},w.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},w.pairs=function(e){var t,n,r=[];for(t in e)st.call(e,t)&&(n=e[t],r.push([t,n]));return r},w.pick=function(e,t,n){var r,i,s=e,o={};if("function"!=typeof t){var s=it.apply(W,arguments),u=s.length;for(r=1;r<u;r++)i=s[r],i in e&&(o[i]=e[i])}else for(r in t=T(t,n),s)i=s[r],t(i,r,e)&&(o[r]=i);return o},w.pluck=u,w.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e
|
._=V,this},w.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},w.omit=function(e,t,n){var r,i,s=e,o={};if(!e)return o;var u="function"==typeof t;if(u)t=x(t,n);else var a=rt.apply(z,arguments);for(r in s)if(i=s[r],u?!t(i,r,e):0>P(a,r))o[r]=i;return o},w.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},w.pairs=function(e){var t,n,r=[];if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r.push([t,n]));return r
|
||||||
,e=0),e+ct(yt()*((+t||0)-e+1))},w.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=mt(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},w.reduce=o,w.reduceRight=_,w.reject=function(e,t,n){var r,i=[],t=T(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],!t(r,n,e)&&i.push(r);else for(n in e)st.call(e,n)&&(r=e[n],!t(r,n,e)&&i.push(r));return i},w.rest=j,w.result=function(e,t){var n=e?e[t]:r;return A(n)?e[t]():n},w.shuffle=function(e){for(var t,n=-1,r=e.length,i=Array(
|
},w.pick=function(e,t,n){var r,i,s=e,o={};if(!e)return o;if("function"!=typeof t){var s=rt.apply(z,arguments),u=s.length;for(r=1;r<u;r++)i=s[r],i in e&&(o[i]=e[i])}else for(r in t=x(t,n),s)i=s[r],t(i,r,e)&&(o[r]=i);return o},w.pluck=u,w.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+ft(mt()*((+t||0)-e+1))},w.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=dt(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},w.reduce=o,w.reduceRight=M,w.reject=
|
||||||
r);++n<r;)t=ct(yt()*(n+1)),i[n]=i[t],i[t]=e[n];return i},w.size=function(e){var t=e?e.length:0;return t===+t?t:Dt(e).length},w.some=s,w.sortBy=function(e,t,n){var r,i,t=T(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]={a:t(r,n,e),b:n,c:r};else for(n in i=[],e)st.call(e,n)&&(r=e[n],i.push({a:t(r,n,e),b:n,c:r}));i.sort(S);for(s=i.length;s--;)i[s]=i[s].c;return i},w.sortedIndex=F,w.tap=function(e,t){return t(e),e},w.template=function(e,t,n){n||(n={});var r,i,s=0,o=w.templateSettings
|
function(e,t,n){var r,i=[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],!t(r,n,e)&&i.push(r);else for(n in e)it.call(e,n)&&(r=e[n],!t(r,n,e)&&i.push(r));return i},w.rest=B,w.result=function(e,t){var n=e?e[t]:r;return L(n)?e[t]():n},w.shuffle=function(e){for(var t=-1,n=e?e.length:0,r=Array(n);++t<n;){var i=ft(mt()*(t+1));r[t]=r[i],r[i]=e[t]}return r},w.size=function(e){var t=e?e.length:0;return t===+t?t:Mt(e).length},w.some=s,w.sortBy=function(e,t,n){var r,i;if(!e)return i
|
||||||
,u="__p += '",a=n.variable||o.variable,f=a;e.replace(RegExp((n.escape||o.escape||tt).source+"|"+(n.interpolate||o.interpolate||tt).source+"|"+(n.evaluate||o.evaluate||tt).source+"|$","g"),function(t,n,i,o,a){u+=e.slice(s,a).replace(rt,N),u+=n?"'+__e("+n+")+'":o?"';"+o+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=o||J.test(n||i)),s=a+t.length}),u+="';",f||(a="obj",r?u="with("+a+"){"+u+"}":(n=RegExp("(\\(\\s*)"+a+"\\."+a+"\\b","g"),u=u.replace(Z,"$&"+a+".").replace(n,"$1__d"))),u=(r?u.replace
|
;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]={a:t(r,n,e),b:n,c:r};else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push({a:t(r,n,e),b:n,c:r}));i.sort(E);for(s=i.length;s--;)i[s]=i[s].c;return i},w.sortedIndex=j,w.tap=function(e,t){return t(e),e},w.template=function(e,t,n){e+="",n||(n={});var r,i,s=0,o=w.templateSettings,u="__p += '",a=n.variable||o.variable,f=a;e.replace(RegExp((n.escape||o.escape||et).source+"|"+(n.interpolate||o.interpolate||et).source+"|"+(n.evaluate||
|
||||||
(Q,""):u).replace(G,"$1").replace(Y,"$1;"),u="function("+a+"){"+(f?"":a+"||("+a+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+a+"."+a+"||"+a)+";")+u+"return __p}";try{i=Function("_","return "+u)(w)}catch(l){throw l.source=u,l}return t?i(t):(i.source=u,i)},w.throttle=function(e,t){function n(){a=new Date,u=r,s=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=
|
o.evaluate||et).source+"|$","g"),function(t,n,i,o,a){u+=e.slice(s,a).replace(nt,T),u+=n?"'+__e("+n+")+'":o?"';"+o+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=o||$.test(n||i)),s=a+t.length}),u+="';",f||(a="obj",r?u="with("+a+"){"+u+"}":(n=RegExp("(\\(\\s*)"+a+"\\."+a+"\\b","g"),u=u.replace(Y,"$&"+a+".").replace(n,"$1__d"))),u=(r?u.replace(K,""):u).replace(Q,"$1").replace(G,"$1;"),u="function("+a+"){"+(f?"":a+"||("+a+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"
|
||||||
r,s=e.apply(o,i)):u||(u=Ct(n,f)),s}},w.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},w.toArray=function(e){var t=e?e.length:0;return t===+t?"string"==typeof e?e.split(""):at.call(e):d(e)},w.unescape=function(e){return e==r?"":(e+"").replace(K,L)},w.union=function(){for(var e=-1,t=it.apply(W,arguments),n=t.length,r=[];++e<n;)0>H(r,t[e])&&r.push(t[e]);return r},w.uniq=I,w.uniqueId=function(e){var t=V++;return e?e+t:t},w.values=d,w.where=function(e,t){var r,
|
:(f?"":",__d="+a+"."+a+"||"+a)+";")+u+"return __p}";try{i=Function("_","return "+u)(w)}catch(l){throw l.source=u,l}return t?i(t):(i.source=u,i)},w.throttle=function(e,t){function n(){a=new Date,u=r,s=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=Tt(n,f)),s}},w.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},w.toArray=function(e){if(!e)return[];var t=e.length;return t===+t?"string"==typeof
|
||||||
i,s=[],o=[];m(t,function(e,t){o.push(t)});var u=o.length,a=e.length;r=-1;if(a===+a)for(;++r<a;){i=e[r];var f;f=n;for(var l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}else for(r in e)if(st.call(e,r)){i=e[r],f=n;for(l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}return s},w.without=function(e){for(var t=-1,n=e.length,r=E(arguments,1),i=[];++t<n;)r(e[t])||i.push(e[t]);return i},w.wrap=function(e,t){return function(){var n=[e];return arguments.length&&ot.apply(n,arguments),t.apply(this,n)}},w
|
e?e.split(""):ot.call(e):d(e)},w.unescape=function(e){return e==r?"":(e+"").replace(J,k)},w.union=function(){for(var e=-1,t=rt.apply(z,arguments),n=t.length,r=[];++e<n;)0>P(r,t[e])&&r.push(t[e]);return r},w.uniq=F,w.uniqueId=function(e){var t=X++;return e?e+t:t},w.values=d,w.where=function(e,t){var r,i,s=[];if(!e)return s;var o=[];m(t,function(e,t){o.push(t)});var u=o.length,a=e.length;r=-1;if(a===+a)for(;++r<a;){i=e[r];var f;f=n;for(var l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}else for(
|
||||||
.zip=function(e){for(var t=-1,n=B(u(arguments,"length")),r=Array(n);++t<n;)r[t]=u(arguments,t);return r},w.all=h,w.any=s,w.collect=a,w.detect=l,w.drop=j,w.each=f,w.foldl=o,w.foldr=_,w.head=D,w.include=p,w.inject=o,w.methods=v,w.select=c,w.tail=j,w.take=D,w.unique=I,U(w),w.prototype.chain=function(){return this.__chain__=n,this},w.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(e){var t=W[e];w.prototype[e]=function(){var e=this
|
r in e)if(it.call(e,r)){i=e[r],f=n;for(l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}return s},w.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>P(arguments,i,1)&&r.push(i)}return r},w.wrap=function(e,t){return function(){var n=[e];return arguments.length&&st.apply(n,arguments),t.apply(this,n)}},w.zip=function(e){for(var t=-1,n=e?H(u(arguments,"length")):0,r=Array(n);++t<n;)r[t]=u(arguments,t);return r},w.all=h,w.any=s,w.collect=a,w.detect=l,w.drop=B,w.each=f,w.foldl=o,w
|
||||||
.__wrapped__;return t.apply(e,arguments),this.__chain__&&(e=new w(e),e.__chain__=n),e}}),f(["concat","join","slice"],function(e){var t=W[e];w.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new w(e),e.__chain__=n),e}}),z?"object"==typeof module&&module&&module.exports==z?(module.exports=w)._=w:z._=w:e._=w})(this);
|
.foldr=M,w.head=_,w.include=p,w.inject=o,w.methods=v,w.select=c,w.tail=B,w.take=_,w.unique=F,R(w),w.prototype.chain=function(){return this.__chain__=n,this},w.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(e){var t=z[e];w.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),this.__chain__&&(e=new w(e),e.__chain__=n),e}}),f(["concat","join","slice"],function(e){var t=z[e];w.prototype[e]=function(){var e=t
|
||||||
|
.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new w(e),e.__chain__=n),e}}),U?"object"==typeof module&&module&&module.exports==U?(module.exports=w)._=w:U._=w:e._=w})(this);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
"version": "0.8.0",
|
"version": "0.8.1",
|
||||||
"description": "A drop-in replacement for Underscore.js delivering performance, bug fixes, and additional features.",
|
"description": "A drop-in replacement for Underscore.js delivering performance, bug fixes, and additional features.",
|
||||||
"homepage": "http://lodash.com",
|
"homepage": "http://lodash.com",
|
||||||
"main": "./lodash",
|
"main": "./lodash",
|
||||||
|
|||||||
@@ -633,6 +633,24 @@
|
|||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
asyncTest('`lodash underscore plus=clone`', function() {
|
||||||
|
var start = _.after(2, _.once(QUnit.start));
|
||||||
|
|
||||||
|
build(['-s', 'underscore', 'plus=clone'], function(source, filePath) {
|
||||||
|
var array = [{ 'value': 1 }],
|
||||||
|
basename = path.basename(filePath, '.js'),
|
||||||
|
context = createContext();
|
||||||
|
|
||||||
|
vm.runInContext(source, context);
|
||||||
|
var lodash = context._,
|
||||||
|
clone = lodash.clone(array, true);
|
||||||
|
|
||||||
|
deepEqual(array, clone, basename);
|
||||||
|
notEqual(array, clone, basename);
|
||||||
|
start();
|
||||||
|
});
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
69
test/test.js
69
test/test.js
@@ -395,7 +395,7 @@
|
|||||||
} else {
|
} else {
|
||||||
func(object, { 'a': 1 });
|
func(object, { 'a': 1 });
|
||||||
}
|
}
|
||||||
} catch(e) {console.log(e);
|
} catch(e) {
|
||||||
pass = false;
|
pass = false;
|
||||||
}
|
}
|
||||||
ok(pass);
|
ok(pass);
|
||||||
@@ -646,6 +646,15 @@
|
|||||||
var array = [1, 2, 3];
|
var array = [1, 2, 3];
|
||||||
deepEqual(_.initial(array, 0), []);
|
deepEqual(_.initial(array, 0), []);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should allow a falsey `array` argument', function() {
|
||||||
|
_.each(falsey, function(index, value) {
|
||||||
|
try {
|
||||||
|
var actual = index ? _.initial(value) : _.initial();
|
||||||
|
} catch(e) { }
|
||||||
|
deepEqual(actual, []);
|
||||||
|
})
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -1291,6 +1300,21 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.rest');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
test('should allow a falsey `array` argument', function() {
|
||||||
|
_.each(falsey, function(index, value) {
|
||||||
|
try {
|
||||||
|
var actual = index ? _.rest(value) : _.rest();
|
||||||
|
} catch(e) { }
|
||||||
|
deepEqual(actual, []);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
QUnit.module('lodash.size');
|
QUnit.module('lodash.size');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
@@ -1702,11 +1726,48 @@
|
|||||||
QUnit.module('lodash methods');
|
QUnit.module('lodash methods');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
test('should allow falsey arguments', function() {
|
||||||
|
var funcs = _.without.apply(_, [_.functions(_)].concat([
|
||||||
|
'_',
|
||||||
|
'_iteratorTemplate',
|
||||||
|
'_shimKeys',
|
||||||
|
'after',
|
||||||
|
'bind',
|
||||||
|
'bindAll',
|
||||||
|
'compose',
|
||||||
|
'debounce',
|
||||||
|
'defer',
|
||||||
|
'delay',
|
||||||
|
'functions',
|
||||||
|
'memoize',
|
||||||
|
'once',
|
||||||
|
'partial',
|
||||||
|
'tap',
|
||||||
|
'throttle',
|
||||||
|
'wrap'
|
||||||
|
]));
|
||||||
|
|
||||||
|
_.each(funcs, function(methodName) {
|
||||||
|
var func = _[methodName],
|
||||||
|
pass = true;
|
||||||
|
|
||||||
|
_.each(falsey, function(value, index) {
|
||||||
|
try {
|
||||||
|
index ? func(value) : func();
|
||||||
|
} catch(e) {
|
||||||
|
pass = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ok(pass, '_.' + methodName + ' allows falsey arguments');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test('should handle `null` `thisArg` arguments', function() {
|
test('should handle `null` `thisArg` arguments', function() {
|
||||||
var thisArg,
|
var thisArg,
|
||||||
array = ['a'],
|
array = ['a'],
|
||||||
callback = function() { thisArg = this; },
|
callback = function() { thisArg = this; },
|
||||||
useStrict = (function() { return this; }).call(null) === null;
|
expected = (function() { return this; }).call(null);
|
||||||
|
|
||||||
var funcs = [
|
var funcs = [
|
||||||
'countBy',
|
'countBy',
|
||||||
@@ -1748,10 +1809,10 @@
|
|||||||
func(array, callback, null);
|
func(array, callback, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useStrict) {
|
if (expected === null) {
|
||||||
deepEqual(thisArg, null, message);
|
deepEqual(thisArg, null, message);
|
||||||
} else {
|
} else {
|
||||||
equal(thisArg, window, message);
|
equal(thisArg, expected, message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
121
vendor/backbone/backbone.js
vendored
121
vendor/backbone/backbone.js
vendored
@@ -183,22 +183,22 @@
|
|||||||
// is automatically generated and assigned for you.
|
// is automatically generated and assigned for you.
|
||||||
var Model = Backbone.Model = function(attributes, options) {
|
var Model = Backbone.Model = function(attributes, options) {
|
||||||
var defaults;
|
var defaults;
|
||||||
attributes || (attributes = {});
|
var attrs = attributes || {};
|
||||||
if (options && options.collection) this.collection = options.collection;
|
if (options && options.collection) this.collection = options.collection;
|
||||||
if (options && options.parse) attributes = this.parse(attributes);
|
if (options && options.parse) attributes = this.parse(attributes);
|
||||||
if (defaults = _.result(this, 'defaults')) {
|
if (defaults = _.result(this, 'defaults')) {
|
||||||
attributes = _.extend({}, defaults, attributes);
|
attrs = _.extend({}, defaults, attrs);
|
||||||
}
|
}
|
||||||
this.attributes = {};
|
this.attributes = {};
|
||||||
this._escapedAttributes = {};
|
this._escapedAttributes = {};
|
||||||
this.cid = _.uniqueId('c');
|
this.cid = _.uniqueId('c');
|
||||||
this.changed = {};
|
this.changed = {};
|
||||||
this._silent = {};
|
this._changes = {};
|
||||||
this._pending = {};
|
this._pending = {};
|
||||||
this.set(attributes, {silent: true});
|
this.set(attrs, {silent: true});
|
||||||
// Reset change tracking.
|
// Reset change tracking.
|
||||||
this.changed = {};
|
this.changed = {};
|
||||||
this._silent = {};
|
this._changes = {};
|
||||||
this._pending = {};
|
this._pending = {};
|
||||||
this._previousAttributes = _.clone(this.attributes);
|
this._previousAttributes = _.clone(this.attributes);
|
||||||
this.initialize.apply(this, arguments);
|
this.initialize.apply(this, arguments);
|
||||||
@@ -210,14 +210,18 @@
|
|||||||
// A hash of attributes whose current and previous value differ.
|
// A hash of attributes whose current and previous value differ.
|
||||||
changed: null,
|
changed: null,
|
||||||
|
|
||||||
// A hash of attributes that have silently changed since the last time
|
// A hash of attributes that have changed since the last time `change`
|
||||||
// `change` was called. Will become pending attributes on the next call.
|
// was called.
|
||||||
_silent: null,
|
_changes: null,
|
||||||
|
|
||||||
// A hash of attributes that have changed since the last `'change'` event
|
// A hash of attributes that have changed since the last `change` event
|
||||||
// began.
|
// began.
|
||||||
_pending: null,
|
_pending: null,
|
||||||
|
|
||||||
|
// A hash of attributes with the current model state to determine if
|
||||||
|
// a `change` should be recorded within a nested `change` block.
|
||||||
|
_changing : null,
|
||||||
|
|
||||||
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
||||||
// CouchDB users may want to set this to `"_id"`.
|
// CouchDB users may want to set this to `"_id"`.
|
||||||
idAttribute: 'id',
|
idAttribute: 'id',
|
||||||
@@ -257,23 +261,22 @@
|
|||||||
|
|
||||||
// Set a hash of model attributes on the object, firing `"change"` unless
|
// Set a hash of model attributes on the object, firing `"change"` unless
|
||||||
// you choose to silence it.
|
// you choose to silence it.
|
||||||
set: function(key, value, options) {
|
set: function(attrs, options) {
|
||||||
var attrs, attr, val;
|
var attr, key, val;
|
||||||
|
if (attrs == null) return this;
|
||||||
|
|
||||||
// Handle both `"key", value` and `{key: value}` -style arguments.
|
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||||
if (_.isObject(key) || key == null) {
|
if (!_.isObject(attrs)) {
|
||||||
attrs = key;
|
key = attrs;
|
||||||
options = value;
|
(attrs = {})[key] = options;
|
||||||
} else {
|
options = arguments[2];
|
||||||
attrs = {};
|
|
||||||
attrs[key] = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract attributes and options.
|
// Extract attributes and options.
|
||||||
options || (options = {});
|
var silent = options && options.silent;
|
||||||
if (!attrs) return this;
|
var unset = options && options.unset;
|
||||||
if (attrs instanceof Model) attrs = attrs.attributes;
|
if (attrs instanceof Model) attrs = attrs.attributes;
|
||||||
if (options.unset) for (attr in attrs) attrs[attr] = void 0;
|
if (unset) for (attr in attrs) attrs[attr] = void 0;
|
||||||
|
|
||||||
// Run validation.
|
// Run validation.
|
||||||
if (!this._validate(attrs, options)) return false;
|
if (!this._validate(attrs, options)) return false;
|
||||||
@@ -281,7 +284,7 @@
|
|||||||
// Check for changes of `id`.
|
// Check for changes of `id`.
|
||||||
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
|
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
|
||||||
|
|
||||||
var changes = options.changes = {};
|
var changing = this._changing;
|
||||||
var now = this.attributes;
|
var now = this.attributes;
|
||||||
var escaped = this._escapedAttributes;
|
var escaped = this._escapedAttributes;
|
||||||
var prev = this._previousAttributes || {};
|
var prev = this._previousAttributes || {};
|
||||||
@@ -291,27 +294,30 @@
|
|||||||
val = attrs[attr];
|
val = attrs[attr];
|
||||||
|
|
||||||
// If the new and current value differ, record the change.
|
// If the new and current value differ, record the change.
|
||||||
if (!_.isEqual(now[attr], val) || (options.unset && _.has(now, attr))) {
|
if (!_.isEqual(now[attr], val) || (unset && _.has(now, attr))) {
|
||||||
delete escaped[attr];
|
delete escaped[attr];
|
||||||
(options.silent ? this._silent : changes)[attr] = true;
|
this._changes[attr] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update or delete the current value.
|
// Update or delete the current value.
|
||||||
options.unset ? delete now[attr] : now[attr] = val;
|
unset ? delete now[attr] : now[attr] = val;
|
||||||
|
|
||||||
// If the new and previous value differ, record the change. If not,
|
// If the new and previous value differ, record the change. If not,
|
||||||
// then remove changes for this attribute.
|
// then remove changes for this attribute.
|
||||||
if (!_.isEqual(prev[attr], val) || (_.has(now, attr) !== _.has(prev, attr))) {
|
if (!_.isEqual(prev[attr], val) || (_.has(now, attr) !== _.has(prev, attr))) {
|
||||||
this.changed[attr] = val;
|
this.changed[attr] = val;
|
||||||
if (!options.silent) this._pending[attr] = true;
|
if (!silent) this._pending[attr] = true;
|
||||||
} else {
|
} else {
|
||||||
delete this.changed[attr];
|
delete this.changed[attr];
|
||||||
delete this._pending[attr];
|
delete this._pending[attr];
|
||||||
|
if (!changing) delete this._changes[attr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changing && _.isEqual(now[attr], changing[attr])) delete this._changes[attr];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fire the `"change"` events.
|
// Fire the `"change"` events.
|
||||||
if (!options.silent) this.change(options);
|
if (!silent) this.change(options);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -346,16 +352,14 @@
|
|||||||
// Set a hash of model attributes, and sync the model to the server.
|
// Set a hash of model attributes, and sync the model to the server.
|
||||||
// If the server returns an attributes hash that differs, the model's
|
// If the server returns an attributes hash that differs, the model's
|
||||||
// state will be `set` again.
|
// state will be `set` again.
|
||||||
save: function(key, value, options) {
|
save: function(attrs, options) {
|
||||||
var attrs, current, done;
|
var key, current, done;
|
||||||
|
|
||||||
// Handle both `("key", value)` and `({key: value})` -style calls.
|
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||||
if (_.isObject(key) || key == null) {
|
if (attrs != null && !_.isObject(attrs)) {
|
||||||
attrs = key;
|
key = attrs;
|
||||||
options = value;
|
(attrs = {})[key] = options;
|
||||||
} else {
|
options = arguments[2];
|
||||||
attrs = {};
|
|
||||||
attrs[key] = value;
|
|
||||||
}
|
}
|
||||||
options = options ? _.clone(options) : {};
|
options = options ? _.clone(options) : {};
|
||||||
|
|
||||||
@@ -372,7 +376,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not persist invalid models.
|
// Do not persist invalid models.
|
||||||
if (!attrs && !this.isValid()) return false;
|
if (!attrs && !this._validate(null, options)) return false;
|
||||||
|
|
||||||
// After a successful server-side save, the client is (optionally)
|
// After a successful server-side save, the client is (optionally)
|
||||||
// updated with the server-side state.
|
// updated with the server-side state.
|
||||||
@@ -455,18 +459,25 @@
|
|||||||
// a `"change:attribute"` event for each changed attribute.
|
// a `"change:attribute"` event for each changed attribute.
|
||||||
// Calling this will cause all objects observing the model to update.
|
// Calling this will cause all objects observing the model to update.
|
||||||
change: function(options) {
|
change: function(options) {
|
||||||
options || (options = {});
|
|
||||||
var changing = this._changing;
|
var changing = this._changing;
|
||||||
this._changing = true;
|
var current = this._changing = {};
|
||||||
|
|
||||||
// Silent changes become pending changes.
|
// Silent changes become pending changes.
|
||||||
for (var attr in this._silent) this._pending[attr] = true;
|
for (var attr in this._changes) this._pending[attr] = true;
|
||||||
|
|
||||||
// Silent changes are triggered.
|
// Trigger 'change:attr' for any new or silent changes.
|
||||||
var changes = _.extend({}, options.changes, this._silent);
|
var changes = this._changes;
|
||||||
this._silent = {};
|
this._changes = {};
|
||||||
|
|
||||||
|
// Set the correct state for this._changing values
|
||||||
|
var triggers = [];
|
||||||
for (var attr in changes) {
|
for (var attr in changes) {
|
||||||
this.trigger('change:' + attr, this, this.get(attr), options);
|
current[attr] = this.get(attr);
|
||||||
|
triggers.push(attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i=0, l=triggers.length; i < l; i++) {
|
||||||
|
this.trigger('change:' + triggers[i], this, current[triggers[i]], options);
|
||||||
}
|
}
|
||||||
if (changing) return this;
|
if (changing) return this;
|
||||||
|
|
||||||
@@ -476,13 +487,13 @@
|
|||||||
this.trigger('change', this, options);
|
this.trigger('change', this, options);
|
||||||
// Pending and silent changes still remain.
|
// Pending and silent changes still remain.
|
||||||
for (var attr in this.changed) {
|
for (var attr in this.changed) {
|
||||||
if (this._pending[attr] || this._silent[attr]) continue;
|
if (this._pending[attr] || this._changes[attr]) continue;
|
||||||
delete this.changed[attr];
|
delete this.changed[attr];
|
||||||
}
|
}
|
||||||
this._previousAttributes = _.clone(this.attributes);
|
this._previousAttributes = _.clone(this.attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._changing = false;
|
this._changing = null;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -532,7 +543,7 @@
|
|||||||
// returning `true` if all is well. If a specific `error` callback has
|
// returning `true` if all is well. If a specific `error` callback has
|
||||||
// been passed, call that instead of firing the general `"error"` event.
|
// been passed, call that instead of firing the general `"error"` event.
|
||||||
_validate: function(attrs, options) {
|
_validate: function(attrs, options) {
|
||||||
if (options.silent || !this.validate) return true;
|
if (options && options.silent || !this.validate) return true;
|
||||||
attrs = _.extend({}, this.attributes, attrs);
|
attrs = _.extend({}, this.attributes, attrs);
|
||||||
var error = this.validate(attrs, options);
|
var error = this.validate(attrs, options);
|
||||||
if (!error) return true;
|
if (!error) return true;
|
||||||
@@ -894,9 +905,10 @@
|
|||||||
|
|
||||||
// Cached regular expressions for matching named param parts and splatted
|
// Cached regular expressions for matching named param parts and splatted
|
||||||
// parts of route strings.
|
// parts of route strings.
|
||||||
|
var optionalParam = /\((.*?)\)/g;
|
||||||
var namedParam = /:\w+/g;
|
var namedParam = /:\w+/g;
|
||||||
var splatParam = /\*\w+/g;
|
var splatParam = /\*\w+/g;
|
||||||
var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
|
var escapeRegExp = /[-{}[\]+?.,\\^$|#\s]/g;
|
||||||
|
|
||||||
// Set up all inheritable **Backbone.Router** properties and methods.
|
// Set up all inheritable **Backbone.Router** properties and methods.
|
||||||
_.extend(Router.prototype, Events, {
|
_.extend(Router.prototype, Events, {
|
||||||
@@ -947,6 +959,7 @@
|
|||||||
// against the current location hash.
|
// against the current location hash.
|
||||||
_routeToRegExp: function(route) {
|
_routeToRegExp: function(route) {
|
||||||
route = route.replace(escapeRegExp, '\\$&')
|
route = route.replace(escapeRegExp, '\\$&')
|
||||||
|
.replace(optionalParam, '(?:$1)?')
|
||||||
.replace(namedParam, '([^\/]+)')
|
.replace(namedParam, '([^\/]+)')
|
||||||
.replace(splatParam, '(.*?)');
|
.replace(splatParam, '(.*?)');
|
||||||
return new RegExp('^' + route + '$');
|
return new RegExp('^' + route + '$');
|
||||||
@@ -1059,7 +1072,7 @@
|
|||||||
// opened by a non-pushState browser.
|
// opened by a non-pushState browser.
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
var loc = this.location;
|
var loc = this.location;
|
||||||
var atRoot = (loc.pathname.replace(/[^/]$/, '$&/') === this.root) && !loc.search;
|
var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
|
||||||
|
|
||||||
// If we've started off with a route from a `pushState`-enabled browser,
|
// If we've started off with a route from a `pushState`-enabled browser,
|
||||||
// but we're currently in a browser that doesn't support it...
|
// but we're currently in a browser that doesn't support it...
|
||||||
@@ -1073,7 +1086,7 @@
|
|||||||
// in a browser where it could be `pushState`-based instead...
|
// in a browser where it could be `pushState`-based instead...
|
||||||
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
|
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
|
||||||
this.fragment = this.getHash().replace(routeStripper, '');
|
this.fragment = this.getHash().replace(routeStripper, '');
|
||||||
this.history.replaceState({}, document.title, this.root + this.fragment);
|
this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.options.silent) return this.loadUrl();
|
if (!this.options.silent) return this.loadUrl();
|
||||||
@@ -1320,7 +1333,7 @@
|
|||||||
if (this.className) attrs['class'] = _.result(this, 'className');
|
if (this.className) attrs['class'] = _.result(this, 'className');
|
||||||
this.setElement(this.make(_.result(this, 'tagName'), attrs), false);
|
this.setElement(this.make(_.result(this, 'tagName'), attrs), false);
|
||||||
} else {
|
} else {
|
||||||
this.setElement(this.el, false);
|
this.setElement(_.result(this, 'el'), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1435,9 +1448,12 @@
|
|||||||
child = function(){ parent.apply(this, arguments); };
|
child = function(){ parent.apply(this, arguments); };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add static properties to the constructor function, if supplied.
|
||||||
|
_.extend(child, parent, staticProps);
|
||||||
|
|
||||||
// Set the prototype chain to inherit from `parent`, without calling
|
// Set the prototype chain to inherit from `parent`, without calling
|
||||||
// `parent`'s constructor function.
|
// `parent`'s constructor function.
|
||||||
function Surrogate(){ this.constructor = child; };
|
var Surrogate = function(){ this.constructor = child; };
|
||||||
Surrogate.prototype = parent.prototype;
|
Surrogate.prototype = parent.prototype;
|
||||||
child.prototype = new Surrogate;
|
child.prototype = new Surrogate;
|
||||||
|
|
||||||
@@ -1445,9 +1461,6 @@
|
|||||||
// if supplied.
|
// if supplied.
|
||||||
if (protoProps) _.extend(child.prototype, protoProps);
|
if (protoProps) _.extend(child.prototype, protoProps);
|
||||||
|
|
||||||
// Add static properties to the constructor function, if supplied.
|
|
||||||
_.extend(child, parent, staticProps);
|
|
||||||
|
|
||||||
// Set a convenience property in case the parent's prototype is needed
|
// Set a convenience property in case the parent's prototype is needed
|
||||||
// later.
|
// later.
|
||||||
child.__super__ = parent.prototype;
|
child.__super__ = parent.prototype;
|
||||||
|
|||||||
66
vendor/backbone/test/model.js
vendored
66
vendor/backbone/test/model.js
vendored
@@ -740,9 +740,9 @@ $(document).ready(function() {
|
|||||||
model.set({b: 2}, {silent: true});
|
model.set({b: 2}, {silent: true});
|
||||||
});
|
});
|
||||||
model.set({b: 0});
|
model.set({b: 0});
|
||||||
deepEqual(changes, [0, 1, 1]);
|
deepEqual(changes, [0, 1]);
|
||||||
model.change();
|
model.change();
|
||||||
deepEqual(changes, [0, 1, 1, 2, 1]);
|
deepEqual(changes, [0, 1, 2, 1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("nested set multiple times", 1, function() {
|
test("nested set multiple times", 1, function() {
|
||||||
@@ -816,4 +816,66 @@ $(document).ready(function() {
|
|||||||
strictEqual(model.save(), false);
|
strictEqual(model.save(), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("#1377 - Save without attrs triggers 'error'.", 1, function() {
|
||||||
|
var Model = Backbone.Model.extend({
|
||||||
|
url: '/test/',
|
||||||
|
sync: function(method, model, options){ options.success(); },
|
||||||
|
validate: function(){ return 'invalid'; }
|
||||||
|
});
|
||||||
|
var model = new Model({id: 1});
|
||||||
|
model.on('error', function(){ ok(true); });
|
||||||
|
model.save();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1545 - `undefined` can be passed to a model constructor without coersion", function() {
|
||||||
|
var Model = Backbone.Model.extend({
|
||||||
|
defaults: { one: 1 },
|
||||||
|
initialize : function(attrs, opts) {
|
||||||
|
equal(attrs, undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var emptyattrs = new Model();
|
||||||
|
var undefinedattrs = new Model(undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncTest("#1478 - Model `save` does not trigger change on unchanged attributes", 0, function() {
|
||||||
|
var Model = Backbone.Model.extend({
|
||||||
|
sync: function(method, model, options) {
|
||||||
|
setTimeout(function(){
|
||||||
|
options.success();
|
||||||
|
start();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new Model({x: true})
|
||||||
|
.on('change:x', function(){ ok(false); })
|
||||||
|
.save(null, {wait: true});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1664 - Changing from one value, silently to another, back to original does not trigger change.", 0, function() {
|
||||||
|
var model = new Backbone.Model({x:1});
|
||||||
|
model.on('change:x', function() { ok(false); });
|
||||||
|
model.set({x:2},{silent:true});
|
||||||
|
model.set({x:3},{silent:true});
|
||||||
|
model.set({x:1});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1664 - multiple silent changes nested inside a change event", 2, function() {
|
||||||
|
var changes = [];
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
model.on('change', function() {
|
||||||
|
model.set({a:'c'}, {silent:true});
|
||||||
|
model.set({b:2}, {silent:true});
|
||||||
|
model.unset('c', {silent:true});
|
||||||
|
model.set({a:'a'}, {silent:true});
|
||||||
|
model.set({b:1}, {silent:true});
|
||||||
|
model.set({c:'item'}, {silent:true});
|
||||||
|
});
|
||||||
|
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
|
||||||
|
model.set({a:'a', b:1, c:'item'});
|
||||||
|
deepEqual(changes, ['a',1,'item']);
|
||||||
|
model.change();
|
||||||
|
deepEqual(changes, ['a',1,'item']);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
32
vendor/backbone/test/router.js
vendored
32
vendor/backbone/test/router.js
vendored
@@ -69,6 +69,7 @@ $(document).ready(function() {
|
|||||||
"contacts": "contacts",
|
"contacts": "contacts",
|
||||||
"contacts/new": "newContact",
|
"contacts/new": "newContact",
|
||||||
"contacts/:id": "loadContact",
|
"contacts/:id": "loadContact",
|
||||||
|
"optional(/:item)": "optionalItem",
|
||||||
"splat/*args/end": "splat",
|
"splat/*args/end": "splat",
|
||||||
"*first/complex-:part/*rest": "complex",
|
"*first/complex-:part/*rest": "complex",
|
||||||
":entity?*args": "query",
|
":entity?*args": "query",
|
||||||
@@ -105,6 +106,10 @@ $(document).ready(function() {
|
|||||||
this.contact = 'load';
|
this.contact = 'load';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
optionalItem: function(arg){
|
||||||
|
this.arg = arg !== undefined ? arg : null;
|
||||||
|
},
|
||||||
|
|
||||||
splat : function(args) {
|
splat : function(args) {
|
||||||
this.args = args;
|
this.args = args;
|
||||||
},
|
},
|
||||||
@@ -199,6 +204,15 @@ $(document).ready(function() {
|
|||||||
equal(router.args, 'long-list/of/splatted_99args');
|
equal(router.args, 'long-list/of/splatted_99args');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("routes (optional)", 2, function() {
|
||||||
|
location.replace('http://example.com#optional');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.arg, null);
|
||||||
|
location.replace('http://example.com#optional/thing');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.arg, 'thing');
|
||||||
|
});
|
||||||
|
|
||||||
test("routes (complex)", 3, function() {
|
test("routes (complex)", 3, function() {
|
||||||
location.replace('http://example.com#one/two/three/complex-part/four/five/six/seven');
|
location.replace('http://example.com#one/two/three/complex-part/four/five/six/seven');
|
||||||
Backbone.history.checkUrl();
|
Backbone.history.checkUrl();
|
||||||
@@ -449,4 +463,22 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("#1695 - hashChange to pushState with search.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root?a=b#x/y');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(){},
|
||||||
|
replaceState: function(state, title, url){
|
||||||
|
strictEqual(url, '/root/x/y?a=b');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
root: 'root',
|
||||||
|
pushState: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
11
vendor/backbone/test/view.js
vendored
11
vendor/backbone/test/view.js
vendored
@@ -312,4 +312,15 @@ $(document).ready(function() {
|
|||||||
view.remove();
|
view.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Provide function for el.", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: function() {
|
||||||
|
return "<p><a></a></p>";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View;
|
||||||
|
ok(view.$el.is('p:has(a)'));
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
4
vendor/underscore/underscore-min.js
vendored
4
vendor/underscore/underscore-min.js
vendored
File diff suppressed because one or more lines are too long
4
vendor/underscore/underscore.js
vendored
4
vendor/underscore/underscore.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
// Underscore.js 1.4.0
|
// Underscore.js 1.4.1
|
||||||
// http://underscorejs.org
|
// http://underscorejs.org
|
||||||
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||||
// Underscore may be freely distributed under the MIT license.
|
// Underscore may be freely distributed under the MIT license.
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Current version.
|
// Current version.
|
||||||
_.VERSION = '1.4.0';
|
_.VERSION = '1.4.1';
|
||||||
|
|
||||||
// Collection Functions
|
// Collection Functions
|
||||||
// --------------------
|
// --------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user