Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bdc4f19d4 |
4
.gitattributes
vendored
@@ -1,5 +1 @@
|
||||
* text=auto
|
||||
*.js text eol=lf
|
||||
*.jst text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.tpl text eol=lf
|
||||
|
||||
6
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
.DS_Store
|
||||
*.custom.*
|
||||
node_modules
|
||||
vendor/closure-compiler
|
||||
vendor/uglifyjs
|
||||
node_modules/
|
||||
vendor/closure-compiler/
|
||||
vendor/uglifyjs/
|
||||
|
||||
14
.jamignore
@@ -1,14 +1,12 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.d.ts
|
||||
*.md
|
||||
*.txt
|
||||
build.js
|
||||
index.js
|
||||
bower.json
|
||||
build
|
||||
doc
|
||||
node_modules
|
||||
perf
|
||||
test
|
||||
vendor
|
||||
build/
|
||||
doc/
|
||||
node_modules/
|
||||
perf/
|
||||
test/
|
||||
vendor/
|
||||
|
||||
42
.npmignore
@@ -1,23 +1,27 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.d.ts
|
||||
*.md
|
||||
bower.json
|
||||
doc
|
||||
node_modules
|
||||
perf
|
||||
test
|
||||
CONTRIBUTING.md
|
||||
doc/*.php
|
||||
node_modules/
|
||||
perf/*.html
|
||||
perf/*-ui.js
|
||||
perf/*.sh
|
||||
test/*.html
|
||||
test/*-ui.js
|
||||
test/*.sh
|
||||
vendor/*.gz
|
||||
vendor/backbone
|
||||
vendor/benchmark.js
|
||||
vendor/closure-compiler
|
||||
vendor/docdown
|
||||
vendor/firebug-lite
|
||||
vendor/jquery
|
||||
vendor/json3
|
||||
vendor/platform.js
|
||||
vendor/qunit
|
||||
vendor/qunit-clib
|
||||
vendor/requirejs
|
||||
vendor/uglifyjs
|
||||
vendor/underscore
|
||||
vendor/backbone/
|
||||
vendor/benchmark.js/*.jar
|
||||
vendor/closure-compiler/
|
||||
vendor/docdown/
|
||||
vendor/firebug-lite/
|
||||
vendor/json3/
|
||||
vendor/jquery/
|
||||
vendor/platform.js/
|
||||
vendor/qunit/qunit/*.css
|
||||
vendor/qunit/qunit/*-1.8.0.js
|
||||
vendor/requirejs/
|
||||
vendor/underscore/*-min.js
|
||||
vendor/uglifyjs/
|
||||
vendor/underscore/test/
|
||||
|
||||
@@ -7,7 +7,7 @@ env:
|
||||
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
|
||||
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m30s"
|
||||
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m40s"
|
||||
git:
|
||||
depth: 1
|
||||
branches:
|
||||
|
||||
71
README.md
@@ -1,28 +1,29 @@
|
||||
# Lo-Dash <sup>v1.2.0</sup>
|
||||
# Lo-Dash <sup>v1.1.1</sup>
|
||||
[](http://travis-ci.org/bestiejs/lodash)
|
||||
|
||||
A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
|
||||
|
||||
## Download
|
||||
|
||||
* Lo-Dash builds (for modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.min.js)
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.min.js)
|
||||
|
||||
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.min.js)
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.compat.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.compat.min.js)
|
||||
|
||||
* Underscore compatibility builds:<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.min.js)
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.min.js)
|
||||
|
||||
* CDN copies of ≤ v1.2.0’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.js),
|
||||
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.min.js),<br>
|
||||
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.js),
|
||||
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.min.js),<br>
|
||||
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.underscore.js), and
|
||||
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.underscore.min.js)
|
||||
* CDN copies of ≤ v1.1.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.js),
|
||||
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.min.js),<br>
|
||||
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.compat.js),
|
||||
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.compat.min.js),<br>
|
||||
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.underscore.js), and
|
||||
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.underscore.min.js)
|
||||
|
||||
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
||||
|
||||
@@ -55,7 +56,6 @@ For more information check out these articles, screencasts, and other videos ove
|
||||
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
|
||||
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
|
||||
* [_.debounce](http://lodash.com/docs#debounce) and [_.throttle](http://lodash.com/docs#throttle) accept an `options` argument for more control
|
||||
* [_.createCallback](http://lodash.com/docs#createCallback) to customize how callback arguments are handled and support callback shorthands in mixins
|
||||
* [_.findIndex](http://lodash.com/docs#findIndex) and [_.findKey](http://lodash.com/docs#findKey) for finding indexes and keys of collections
|
||||
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
|
||||
@@ -68,7 +68,6 @@ For more information check out these articles, screencasts, and other videos ove
|
||||
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
|
||||
* [_.support](http://lodash.com/docs#support) to flag environment features
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
||||
* [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip)
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
|
||||
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
|
||||
@@ -79,7 +78,7 @@ For more information check out these articles, screencasts, and other videos ove
|
||||
|
||||
## Support
|
||||
|
||||
Lo-Dash has been tested in at least Chrome 5~26, Firefox 2~19, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
Lo-Dash has been tested in at least Chrome 5~25, Firefox 2~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.1, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Custom builds
|
||||
|
||||
@@ -89,6 +88,12 @@ To top it off, we handle all method dependency and alias mapping for you.
|
||||
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
|
||||
```bash
|
||||
lodash backbone
|
||||
```
|
||||
|
||||
* CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
|
||||
The `csp` modifier is an alias of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html).
|
||||
```bash
|
||||
lodash csp
|
||||
```
|
||||
|
||||
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
|
||||
@@ -170,7 +175,7 @@ lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
|
||||
lodash moduleId="underscore"
|
||||
```
|
||||
|
||||
All arguments, except `legacy` with `mobile`, `modern`, or `underscore`, may be combined.<br>
|
||||
All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br>
|
||||
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
|
||||
|
||||
The following options are also supported:
|
||||
@@ -247,20 +252,24 @@ require({
|
||||
|
||||
## Release Notes
|
||||
|
||||
### <sup>v1.2.0</sup>
|
||||
### <sup>v1.1.1</sup>
|
||||
|
||||
* Added Bower package support
|
||||
* Added `_.unzip`
|
||||
* Added an `options` argument to `_.debounce` and `_.throttle`
|
||||
* Allowed non-`underscore` builds to include `_.findWhere` and `_.chain`
|
||||
* Ensured *“Arrays”* and *“Objects”* category methods work with `arguments` objects and arrays respectively
|
||||
* Ensured build utility runs on Windows
|
||||
* Ensured `underscore` build versions of *“isType”* methods align with Underscore
|
||||
* Ensured methods avoid issues with the `__proto__` property
|
||||
* Ensured `_.merge` applies a `callback` to nested properties
|
||||
* Ensured `_.merge` passes the correct `callback` arguments when comparing objects
|
||||
* Made Lo-Dash work with Browserify
|
||||
* Removed method compilation from the `modern`
|
||||
* Ensured the `underscore` build version of `_.forEach` accepts a `thisArg` argument
|
||||
* Updated vendor/tar to work with Node v0.10.x
|
||||
|
||||
### <sup>v1.1.0</sup>
|
||||
|
||||
* Added `rhino -require` support
|
||||
* Added `_.createCallback`, `_findIndex`, `_.findKey`, `_.parseInt`, `_.runInContext`, and `_.support`
|
||||
* Added support for `callback` and `thisArg` arguments to `_.flatten`
|
||||
* Added CommonJS/Node support to precompiled templates
|
||||
* Ensured the `exports` object is not a DOM element
|
||||
* Ensured `_.isPlainObject` returns `false` for objects without a `[[Class]]` of “Object”
|
||||
* Made `_.cloneDeep`’s `callback` support more closely follow its documentation
|
||||
* Made the template precompiler create nonexistent directories of `--output` paths
|
||||
* Made `_.object` an alias of `_.zipObject`
|
||||
* Optimized method chaining, object iteration, `_.find`, and `_.pluck` (an average of 18% overall better performance)
|
||||
* Updated `backbone` build Lo-Dash method dependencies
|
||||
|
||||
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||
|
||||
|
||||
20
bower.json
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "1.2.0",
|
||||
"main": "./lodash.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.d.ts",
|
||||
"*.md",
|
||||
"*.txt",
|
||||
"build.js",
|
||||
"index.js",
|
||||
"build",
|
||||
"doc",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
@@ -3,26 +3,30 @@
|
||||
'use strict';
|
||||
|
||||
/** Load Node.js modules */
|
||||
var https = require('https'),
|
||||
var fs = require('fs'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
spawn = require('child_process').spawn,
|
||||
zlib = require('zlib');
|
||||
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js'),
|
||||
mkdirpSync = require('./mkdirp-sync.js'),
|
||||
preprocess = require('./pre-compile.js'),
|
||||
postprocess = require('./post-compile.js'),
|
||||
tar = require('../vendor/tar/tar.js'),
|
||||
util = require('./util.js');
|
||||
tar = require('../vendor/tar/tar.js');
|
||||
|
||||
/** Module shortcuts */
|
||||
var fs = util.fs,
|
||||
path = util.path;
|
||||
/** Add `fs.existsSync` for older versions of Node.js */
|
||||
fs.existsSync || (fs.existsSync = path.existsSync);
|
||||
|
||||
/** Add `path.sep` for older versions of Node.js */
|
||||
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
|
||||
|
||||
/** The Git object ID of `closure-compiler.tar.gz` */
|
||||
var closureId = 'fe7665b9fb2378ffaf9e3985268e20e5c72e35fd';
|
||||
var closureId = 'a95a8007892aa824ce90c6aa3d3abb0489bf0fff';
|
||||
|
||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||
var uglifyId = '3658629b8c7ae2e686f69eadd788ed792a23f4c6';
|
||||
var uglifyId = '41308bd569db41a32d4f08af115875d0342e8bfb';
|
||||
|
||||
/** The path of the directory that is the base of the repository */
|
||||
var basePath = fs.realpathSync(path.join(__dirname, '..'));
|
||||
@@ -43,7 +47,7 @@
|
||||
var mediaType = 'application/vnd.github.v3.raw';
|
||||
|
||||
/** Used to detect the Node.js executable in command-line arguments */
|
||||
var reNode = RegExp('(?:^|' + path.sepEscaped + ')node(?:\\.exe)?$');
|
||||
var reNode = RegExp('(?:^|' + path.sep + ')node(?:\\.exe)?$');
|
||||
|
||||
/** Used to reference parts of the blob href */
|
||||
var location = (function() {
|
||||
@@ -142,7 +146,7 @@
|
||||
if (/-o|--output/.test(value)) {
|
||||
result = options[index + 1];
|
||||
var dirname = path.dirname(result);
|
||||
fs.mkdirpSync(dirname);
|
||||
mkdirpSync(dirname);
|
||||
result = path.join(fs.realpathSync(dirname), path.basename(result));
|
||||
}
|
||||
return result;
|
||||
|
||||
43
build/mkdirp-sync.js
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node.js modules */
|
||||
var fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
/** Add `path.sep` for older versions of Node.js */
|
||||
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Makes the given `dirname` directory, without throwing errors for existing
|
||||
* directories and making parent directories as needed.
|
||||
*
|
||||
* @param {String} dirname The path of the directory.
|
||||
* @param {Number|String} [mode='0777'] The permission mode.
|
||||
*/
|
||||
function mkdirpSync(dirname, mode) {
|
||||
var sep = path.sep;
|
||||
|
||||
// ensure relative paths are prefixed with `./`
|
||||
if (!RegExp('^\\.?' + sep).test(dirname)) {
|
||||
dirname = '.' + sep + dirname;
|
||||
}
|
||||
dirname.split(sep).reduce(function(currPath, segment) {
|
||||
currPath += sep + segment;
|
||||
try {
|
||||
currPath = fs.realpathSync(currPath);
|
||||
} catch(e) {
|
||||
fs.mkdirSync(currPath, mode);
|
||||
}
|
||||
return currPath;
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose
|
||||
module.exports = mkdirpSync;
|
||||
}());
|
||||
@@ -27,8 +27,14 @@
|
||||
// remove copyright header
|
||||
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
|
||||
|
||||
// correct overly aggressive Closure Compiler advanced optimization
|
||||
source = source.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")');
|
||||
// correct overly aggressive Closure Compiler advanced optimizations
|
||||
source = source
|
||||
.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}')
|
||||
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
|
||||
|
||||
source = source.replace(/(\w+\.prototype\s*=\s*)\w+(?=\.prototype;)/, function(match, left) {
|
||||
return left + /\w+(?=\.VERSION)/.exec(source);
|
||||
});
|
||||
|
||||
// flip `typeof` expressions to help optimize Safari and
|
||||
// correct the AMD module definition for AMD build optimizers
|
||||
|
||||
@@ -156,7 +156,6 @@
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'leading',
|
||||
'map',
|
||||
'max',
|
||||
'memoize',
|
||||
@@ -205,19 +204,16 @@
|
||||
'throttle',
|
||||
'times',
|
||||
'toArray',
|
||||
'trailing',
|
||||
'unescape',
|
||||
'unindexedChars',
|
||||
'union',
|
||||
'uniq',
|
||||
'unique',
|
||||
'uniqueId',
|
||||
'unzip',
|
||||
'value',
|
||||
'values',
|
||||
'variable',
|
||||
'where',
|
||||
'window',
|
||||
'without',
|
||||
'wrap',
|
||||
'zip',
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node.js modules */
|
||||
var fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js');
|
||||
|
||||
/** Used to indicate if running in Windows */
|
||||
var isWindows = process.platform == 'win32';
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The path separator.
|
||||
*
|
||||
* @memberOf util.path
|
||||
* @type String
|
||||
*/
|
||||
var sep = path.sep || (isWindows ? '\\' : '/');
|
||||
|
||||
/**
|
||||
* The escaped path separator used for inclusion in RegExp strings.
|
||||
*
|
||||
* @memberOf util.path
|
||||
* @type String
|
||||
*/
|
||||
var sepEscaped = sep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
/** Used to determine if a path is prefixed with a drive letter, dot, or slash */
|
||||
var rePrefixed = RegExp('^(?:' + (isWindows ? '[a-zA-Z]:|' : '') + '\\.?)' + sepEscaped);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Makes the given `dirname` directory, without throwing errors for existing
|
||||
* directories and making parent directories as needed.
|
||||
*
|
||||
* @memberOf util.fs
|
||||
* @param {String} dirname The path of the directory.
|
||||
* @param {Number|String} [mode='0777'] The permission mode.
|
||||
*/
|
||||
function mkdirpSync(dirname, mode) {
|
||||
// ensure relative paths are prefixed with `./`
|
||||
if (!rePrefixed.test(dirname)) {
|
||||
dirname = '.' + sep + dirname;
|
||||
}
|
||||
dirname.split(sep).reduce(function(currPath, segment) {
|
||||
currPath += sep + segment;
|
||||
try {
|
||||
currPath = fs.realpathSync(currPath);
|
||||
} catch(e) {
|
||||
fs.mkdirSync(currPath, mode);
|
||||
}
|
||||
return currPath;
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The utility object.
|
||||
*
|
||||
* @type Object
|
||||
*/
|
||||
var util = {
|
||||
|
||||
/**
|
||||
* The file system object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @type Object
|
||||
*/
|
||||
'fs': _.defaults(_.cloneDeep(fs), {
|
||||
'existsSync': fs.existsSync || path.existsSync,
|
||||
'mkdirpSync': mkdirpSync
|
||||
}),
|
||||
|
||||
/**
|
||||
* The path object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @type Object
|
||||
*/
|
||||
'path': _.defaults(_.cloneDeep(path), {
|
||||
'sep': sep,
|
||||
'sepEscaped': sepEscaped
|
||||
})
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose
|
||||
module.exports = util;
|
||||
}());
|
||||
352
dist/lodash.compat.js
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/>
|
||||
* Lo-Dash 1.1.1 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
|
||||
@@ -18,9 +18,9 @@
|
||||
/** Detect free variable `module` */
|
||||
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
@@ -30,12 +30,6 @@
|
||||
/** Used internally to indicate various things */
|
||||
var indicatorObject = {};
|
||||
|
||||
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
||||
var keyPrefix = +new Date + '';
|
||||
|
||||
/** Used as the size when optimizations are enabled for large arrays */
|
||||
var largeArraySize = 200;
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
@@ -181,7 +175,7 @@
|
||||
toString = objectRef.toString;
|
||||
|
||||
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
||||
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
|
||||
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
||||
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
||||
nativeIsFinite = context.isFinite,
|
||||
nativeIsNaN = context.isNaN,
|
||||
@@ -189,8 +183,7 @@
|
||||
nativeMax = Math.max,
|
||||
nativeMin = Math.min,
|
||||
nativeParseInt = context.parseInt,
|
||||
nativeRandom = Math.random,
|
||||
nativeSlice = arrayRef.slice;
|
||||
nativeRandom = Math.random;
|
||||
|
||||
/** Detect various environments */
|
||||
var isIeOpera = reNative.test(context.attachEvent),
|
||||
@@ -209,7 +202,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a `lodash` object, which wraps the given `value`, to enable method
|
||||
* Creates a `lodash` object, that wraps the given `value`, to enable method
|
||||
* chaining.
|
||||
*
|
||||
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
|
||||
@@ -227,8 +220,8 @@
|
||||
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
||||
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
|
||||
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
|
||||
* `values`, `where`, `without`, `wrap`, and `zip`
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`,
|
||||
* `where`, `without`, `wrap`, and `zip`
|
||||
*
|
||||
* The non-chainable wrapper functions are:
|
||||
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
|
||||
@@ -247,26 +240,6 @@
|
||||
* @category Chaining
|
||||
* @param {Mixed} value The value to wrap in a `lodash` instance.
|
||||
* @returns {Object} Returns a `lodash` instance.
|
||||
* @example
|
||||
*
|
||||
* var wrapped = _([1, 2, 3]);
|
||||
*
|
||||
* // returns an unwrapped value
|
||||
* wrapped.reduce(function(sum, num) {
|
||||
* return sum + num;
|
||||
* });
|
||||
* // => 6
|
||||
*
|
||||
* // returns a wrapped value
|
||||
* var squares = wrapped.map(function(num) {
|
||||
* return num * num;
|
||||
* });
|
||||
*
|
||||
* _.isArray(squares);
|
||||
* // => false
|
||||
*
|
||||
* _.isArray(squares.value());
|
||||
* // => true
|
||||
*/
|
||||
function lodash(value) {
|
||||
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
|
||||
@@ -294,12 +267,12 @@
|
||||
for (prop in arguments) { }
|
||||
|
||||
/**
|
||||
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
|
||||
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type Boolean
|
||||
*/
|
||||
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
|
||||
support.argsObject = arguments.constructor == Object;
|
||||
|
||||
/**
|
||||
* Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
|
||||
@@ -465,7 +438,7 @@
|
||||
* The template used to create iterator functions.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} data The data object used to populate the text.
|
||||
* @param {Obect} data The data object used to populate the text.
|
||||
* @returns {String} Returns the interpolated text.
|
||||
*/
|
||||
var iteratorTemplate = function(obj) {
|
||||
@@ -593,27 +566,31 @@
|
||||
* @private
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Mixed} value The value to search for.
|
||||
* @param {Number} fromIndex The index to search from.
|
||||
* @param {Number} largeSize The length at which an array is considered large.
|
||||
* @returns {Boolean} Returns `true`, if `value` is found, else `false`.
|
||||
*/
|
||||
function cachedContains(array) {
|
||||
function cachedContains(array, fromIndex, largeSize) {
|
||||
var length = array.length,
|
||||
isLarge = length >= largeArraySize;
|
||||
isLarge = (length - fromIndex) >= largeSize;
|
||||
|
||||
if (isLarge) {
|
||||
var cache = {},
|
||||
index = -1;
|
||||
index = fromIndex - 1;
|
||||
|
||||
while (++index < length) {
|
||||
var key = keyPrefix + array[index];
|
||||
(cache[key] || (cache[key] = [])).push(array[index]);
|
||||
// manually coerce `value` to a string because `hasOwnProperty`, in some
|
||||
// older versions of Firefox, coerces objects incorrectly
|
||||
var key = String(array[index]);
|
||||
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
|
||||
}
|
||||
}
|
||||
return function(value) {
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + value;
|
||||
return cache[key] && indexOf(cache[key], value) > -1;
|
||||
var key = String(value);
|
||||
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
|
||||
}
|
||||
return indexOf(array, value) > -1;
|
||||
return indexOf(array, value, fromIndex) > -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -699,7 +676,7 @@
|
||||
}
|
||||
if (partialArgs.length) {
|
||||
args = args.length
|
||||
? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
: partialArgs;
|
||||
}
|
||||
if (this instanceof bound) {
|
||||
@@ -725,7 +702,6 @@
|
||||
* @param {Object} [options1, options2, ...] The compile options object(s).
|
||||
* arrays - A string of code to determine if the iterable is an array or array-like.
|
||||
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
|
||||
* useKeys - A boolean to specify using `_.keys` for own property iteration.
|
||||
* args - A string of comma separated arguments the iteration function will accept.
|
||||
* top - A string of code to execute before the iteration branches.
|
||||
* loop - A string of code to execute in the object loop.
|
||||
@@ -827,7 +803,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* A fallback implementation of `isPlainObject` which checks if a given `value`
|
||||
* A fallback implementation of `isPlainObject` that checks if a given `value`
|
||||
* is an object created by the `Object` constructor, assuming objects created
|
||||
* by the `Object` constructor have no inherited enumerable properties and that
|
||||
* there are no `Object.prototype` extensions.
|
||||
@@ -935,7 +911,29 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` which produces an array of the
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
||||
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
||||
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
|
||||
};
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` that produces an array of the
|
||||
* given object's own enumerable property names.
|
||||
*
|
||||
* @private
|
||||
@@ -1255,7 +1253,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
* a "_.pluck" or "_.where" style callback, respectively.
|
||||
@@ -1263,16 +1261,14 @@
|
||||
* @returns {Mixed} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
|
||||
* // => 'b'
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
function findKey(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
forOwn(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
forOwn(collection, function(value, key, collection) {
|
||||
if (callback(value, key, collection)) {
|
||||
result = key;
|
||||
return false;
|
||||
}
|
||||
@@ -1406,29 +1402,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
function isArray(value) {
|
||||
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
||||
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
||||
return (support.argsObject && value instanceof Array) ||
|
||||
(nativeIsArray ? nativeIsArray(value) : toString.call(value) == arrayClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is a boolean value.
|
||||
*
|
||||
@@ -1563,8 +1536,11 @@
|
||||
function isEqual(a, b, callback, thisArg, stackA, stackB) {
|
||||
// used to indicate that when comparing objects, `a` has at least the properties of `b`
|
||||
var whereIndicator = callback === indicatorObject;
|
||||
if (typeof callback == 'function' && !whereIndicator) {
|
||||
callback = lodash.createCallback(callback, thisArg, 2);
|
||||
if (callback && !whereIndicator) {
|
||||
callback = (typeof thisArg == 'undefined')
|
||||
? callback
|
||||
: lodash.createCallback(callback, thisArg, 2);
|
||||
|
||||
var result = callback(a, b);
|
||||
if (typeof result != 'undefined') {
|
||||
return !!result;
|
||||
@@ -2050,24 +2026,22 @@
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
var isShallow;
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
|
||||
if (callback) {
|
||||
result = callback(value, source);
|
||||
if ((isShallow = typeof result != 'undefined')) {
|
||||
if (typeof result != 'undefined') {
|
||||
value = result;
|
||||
}
|
||||
}
|
||||
if (!isShallow) {
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
}
|
||||
// add `source` and associated `value` to the stack of traversed objects
|
||||
stackA.push(source);
|
||||
stackB.push(value);
|
||||
|
||||
// recursively merge objects and arrays (susceptible to call stack limits)
|
||||
if (!isShallow) {
|
||||
if (!callback) {
|
||||
value = merge(value, source, indicatorObject, callback, stackA, stackB);
|
||||
}
|
||||
}
|
||||
@@ -2122,12 +2096,12 @@
|
||||
if (isFunc) {
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
} else {
|
||||
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1));
|
||||
var props = concat.apply(arrayRef, arguments);
|
||||
}
|
||||
forIn(object, function(value, key, object) {
|
||||
if (isFunc
|
||||
? !callback(value, key, object)
|
||||
: indexOf(props, key) < 0
|
||||
: indexOf(props, key, 1) < 0
|
||||
) {
|
||||
result[key] = value;
|
||||
}
|
||||
@@ -2190,8 +2164,8 @@
|
||||
function pick(object, callback, thisArg) {
|
||||
var result = {};
|
||||
if (typeof callback != 'function') {
|
||||
var index = -1,
|
||||
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
var index = 0,
|
||||
props = concat.apply(arrayRef, arguments),
|
||||
length = isObject(object) ? props.length : 0;
|
||||
|
||||
while (++index < length) {
|
||||
@@ -2261,7 +2235,7 @@
|
||||
*/
|
||||
function at(collection) {
|
||||
var index = -1,
|
||||
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
props = concat.apply(arrayRef, slice(arguments, 1)),
|
||||
length = props.length,
|
||||
result = Array(length);
|
||||
|
||||
@@ -2516,9 +2490,7 @@
|
||||
* @returns {Mixed} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.find([1, 2, 3, 4], function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; });
|
||||
* // => 2
|
||||
*
|
||||
* var food = [
|
||||
@@ -2666,7 +2638,7 @@
|
||||
* // => [['1', '2', '3'], ['4', '5', '6']]
|
||||
*/
|
||||
function invoke(collection, methodName) {
|
||||
var args = nativeSlice.call(arguments, 2),
|
||||
var args = slice(arguments, 2),
|
||||
index = -1,
|
||||
isFunc = typeof methodName == 'function',
|
||||
length = collection ? collection.length : 0,
|
||||
@@ -2896,7 +2868,7 @@
|
||||
var pluck = map;
|
||||
|
||||
/**
|
||||
* Reduces a `collection` to a value which is the accumulated result of running
|
||||
* Reduces a `collection` to a value that is the accumulated result of running
|
||||
* each element in the `collection` through the `callback`, where each successive
|
||||
* `callback` execution consumes the return value of the previous execution.
|
||||
* If `accumulator` is not passed, the first element of the `collection` will be
|
||||
@@ -3303,8 +3275,8 @@
|
||||
function difference(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
contains = cachedContains(flattened),
|
||||
flattened = concat.apply(arrayRef, arguments),
|
||||
contains = cachedContains(flattened, length, 100),
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
@@ -3323,7 +3295,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
* a "_.pluck" or "_.where" style callback, respectively.
|
||||
@@ -3331,18 +3303,16 @@
|
||||
* @returns {Mixed} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.findIndex(['apple', 'banana', 'beet'], function(food) {
|
||||
* return /^b/.test(food);
|
||||
* });
|
||||
* _.findIndex(['apple', 'banana', 'beet'], function(food) { return /^b/.test(food); });
|
||||
* // => 1
|
||||
*/
|
||||
function findIndex(array, callback, thisArg) {
|
||||
function findIndex(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
while (++index < length) {
|
||||
if (callback(array[index], index, array)) {
|
||||
if (callback(collection[index], index, collection)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
@@ -3444,7 +3414,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {Array} array The array to compact.
|
||||
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -3635,7 +3605,7 @@
|
||||
cache = { '0': {} },
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
isLarge = length >= largeArraySize,
|
||||
isLarge = length >= 100,
|
||||
result = [],
|
||||
seen = result;
|
||||
|
||||
@@ -3643,8 +3613,8 @@
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + value;
|
||||
var inited = cache[0][key]
|
||||
var key = String(value);
|
||||
var inited = hasOwnProperty.call(cache[0], key)
|
||||
? !(seen = cache[0][key])
|
||||
: (seen = cache[0][key] = []);
|
||||
}
|
||||
@@ -3654,7 +3624,7 @@
|
||||
}
|
||||
var argsIndex = argsLength;
|
||||
while (--argsIndex) {
|
||||
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex])))(value)) {
|
||||
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
@@ -3915,7 +3885,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Mixed} value The value to evaluate.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -3978,10 +3948,7 @@
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
*/
|
||||
function union(array) {
|
||||
if (!isArray(array)) {
|
||||
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
|
||||
}
|
||||
function union() {
|
||||
return uniq(concat.apply(arrayRef, arguments));
|
||||
}
|
||||
|
||||
@@ -4041,7 +4008,7 @@
|
||||
isSorted = false;
|
||||
}
|
||||
// init value cache for large arrays
|
||||
var isLarge = !isSorted && length >= largeArraySize;
|
||||
var isLarge = !isSorted && length >= 75;
|
||||
if (isLarge) {
|
||||
var cache = {};
|
||||
}
|
||||
@@ -4054,8 +4021,8 @@
|
||||
computed = callback ? callback(value, index, array) : value;
|
||||
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + computed;
|
||||
var inited = cache[key]
|
||||
var key = String(computed);
|
||||
var inited = hasOwnProperty.call(cache, key)
|
||||
? !(seen = cache[key])
|
||||
: (seen = cache[key] = []);
|
||||
}
|
||||
@@ -4072,37 +4039,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.zip`, this method splits groups of elements into arrays
|
||||
* composed of elements from each group at their corresponding indexes.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to process.
|
||||
* @returns {Array} Returns a new array of the composed arrays.
|
||||
* @example
|
||||
*
|
||||
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
|
||||
* // => [['moe', 'larry'], [30, 40], [true, false]];
|
||||
*/
|
||||
function unzip(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
tupleLength = length ? max(pluck(array, 'length')) : 0,
|
||||
result = Array(tupleLength);
|
||||
|
||||
while (++index < length) {
|
||||
var tupleIndex = -1,
|
||||
tuple = array[index];
|
||||
|
||||
while (++tupleIndex < tupleLength) {
|
||||
(result[tupleIndex] || (result[tupleIndex] = Array(length)))[index] = tuple[tupleIndex];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array with all occurrences of the passed values removed using
|
||||
* strict equality for comparisons, i.e. `===`.
|
||||
@@ -4119,7 +4055,18 @@
|
||||
* // => [2, 3, 4]
|
||||
*/
|
||||
function without(array) {
|
||||
return difference(array, nativeSlice.call(arguments, 1));
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
contains = cachedContains(arguments, 1, 30),
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (!contains(value)) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4245,7 +4192,7 @@
|
||||
// (in V8 `Function#bind` is slower except when partially applied)
|
||||
return support.fastBind || (nativeBind && arguments.length > 2)
|
||||
? nativeBind.call.apply(nativeBind, arguments)
|
||||
: createBound(func, thisArg, nativeSlice.call(arguments, 2));
|
||||
: createBound(func, thisArg, slice(arguments, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4272,8 +4219,8 @@
|
||||
* // => alerts 'clicked docs', when the button is clicked
|
||||
*/
|
||||
function bindAll(object) {
|
||||
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
|
||||
index = -1,
|
||||
var funcs = concat.apply(arrayRef, arguments),
|
||||
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),
|
||||
length = funcs.length;
|
||||
|
||||
while (++index < length) {
|
||||
@@ -4318,7 +4265,7 @@
|
||||
* // => 'hi, moe!'
|
||||
*/
|
||||
function bindKey(object, key) {
|
||||
return createBound(object, key, nativeSlice.call(arguments, 2), indicatorObject);
|
||||
return createBound(object, key, slice(arguments, 2), indicatorObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4448,53 +4395,44 @@
|
||||
/**
|
||||
* Creates a function that will delay the execution of `func` until after
|
||||
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
|
||||
* an `options` object to indicate that `func` should be invoked on the leading
|
||||
* and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
|
||||
* function will return the result of the last `func` call.
|
||||
* `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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to debounce.
|
||||
* @param {Number} wait The number of milliseconds to delay.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=false] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @param {Boolean} immediate A flag to indicate execution is on the leading
|
||||
* edge of the timeout.
|
||||
* @returns {Function} Returns the new debounced function.
|
||||
* @example
|
||||
*
|
||||
* var lazyLayout = _.debounce(calculateLayout, 300);
|
||||
* jQuery(window).on('resize', lazyLayout);
|
||||
*/
|
||||
function debounce(func, wait, options) {
|
||||
function debounce(func, wait, immediate) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
timeoutId,
|
||||
trailing = true;
|
||||
timeoutId;
|
||||
|
||||
function delayed() {
|
||||
timeoutId = null;
|
||||
if (trailing) {
|
||||
if (!immediate) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
if (options === true) {
|
||||
var leading = true;
|
||||
trailing = false;
|
||||
} else if (options && objectTypes[typeof options]) {
|
||||
leading = options.leading;
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
}
|
||||
return function() {
|
||||
var isLeading = leading && !timeoutId;
|
||||
var isImmediate = immediate && !timeoutId;
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
|
||||
if (isLeading) {
|
||||
if (isImmediate) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
return result;
|
||||
@@ -4517,7 +4455,7 @@
|
||||
* // returns from the function before `alert` is called
|
||||
*/
|
||||
function defer(func) {
|
||||
var args = nativeSlice.call(arguments, 1);
|
||||
var args = slice(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
// use `setImmediate` if it's available in Node.js
|
||||
@@ -4543,7 +4481,7 @@
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
var args = nativeSlice.call(arguments, 2);
|
||||
var args = slice(arguments, 2);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
||||
}
|
||||
|
||||
@@ -4569,7 +4507,7 @@
|
||||
function memoize(func, resolver) {
|
||||
var cache = {};
|
||||
return function() {
|
||||
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
return hasOwnProperty.call(cache, key)
|
||||
? cache[key]
|
||||
: (cache[key] = func.apply(this, arguments));
|
||||
@@ -4629,7 +4567,7 @@
|
||||
* // => 'hi moe'
|
||||
*/
|
||||
function partial(func) {
|
||||
return createBound(func, nativeSlice.call(arguments, 1));
|
||||
return createBound(func, slice(arguments, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4660,61 +4598,43 @@
|
||||
* // => { '_': _, 'jq': $ }
|
||||
*/
|
||||
function partialRight(func) {
|
||||
return createBound(func, nativeSlice.call(arguments, 1), null, indicatorObject);
|
||||
return createBound(func, slice(arguments, 1), null, indicatorObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that, when executed, will only call the `func` function
|
||||
* at most once per every `wait` milliseconds. If the throttled function is
|
||||
* invoked more than once during the `wait` timeout, `func` will also be called
|
||||
* on the trailing edge of the timeout. Pass an `options` object to indicate
|
||||
* that `func` should be invoked on the leading and/or trailing edge of the
|
||||
* `wait` 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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to throttle.
|
||||
* @param {Number} wait The number of milliseconds to throttle executions to.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @returns {Function} Returns the new throttled function.
|
||||
* @example
|
||||
*
|
||||
* var throttled = _.throttle(updatePosition, 100);
|
||||
* jQuery(window).on('scroll', throttled);
|
||||
*/
|
||||
function throttle(func, wait, options) {
|
||||
function throttle(func, wait) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
timeoutId,
|
||||
lastCalled = 0,
|
||||
leading = true,
|
||||
trailing = true;
|
||||
lastCalled = 0;
|
||||
|
||||
function trailingCall() {
|
||||
lastCalled = new Date;
|
||||
timeoutId = null;
|
||||
|
||||
if (trailing) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
if (options === false) {
|
||||
leading = false;
|
||||
} else if (options && objectTypes[typeof options]) {
|
||||
leading = 'leading' in options ? options.leading : leading;
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
return function() {
|
||||
var now = new Date;
|
||||
if (!timeoutId && !leading) {
|
||||
lastCalled = now;
|
||||
}
|
||||
var remaining = wait - (now - lastCalled);
|
||||
var now = new Date,
|
||||
remaining = wait - (now - lastCalled);
|
||||
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
|
||||
@@ -4944,6 +4864,9 @@
|
||||
* 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 using precompiled templates, or loading Lo-Dash in a sandbox.
|
||||
*
|
||||
* For more information on precompiling templates see:
|
||||
* http://lodash.com/#custom-builds
|
||||
*
|
||||
@@ -4954,7 +4877,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {String} text The template text.
|
||||
* @param {Object} data The data object used to populate the text.
|
||||
* @param {Obect} data The data object used to populate the text.
|
||||
* @param {Object} options The options object.
|
||||
* escape - The "escape" delimiter regexp.
|
||||
* evaluate - The "evaluate" delimiter regexp.
|
||||
@@ -5154,7 +5077,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.escape`, this method converts the HTML entities
|
||||
* The opposite of `_.escape`, this method converts the HTML entities
|
||||
* `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding characters.
|
||||
*
|
||||
@@ -5307,7 +5230,6 @@
|
||||
lodash.toArray = toArray;
|
||||
lodash.union = union;
|
||||
lodash.uniq = uniq;
|
||||
lodash.unzip = unzip;
|
||||
lodash.values = values;
|
||||
lodash.where = where;
|
||||
lodash.without = without;
|
||||
@@ -5425,7 +5347,7 @@
|
||||
* @memberOf _
|
||||
* @type String
|
||||
*/
|
||||
lodash.VERSION = '1.2.0';
|
||||
lodash.VERSION = '1.1.1';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.toString = wrapperToString;
|
||||
|
||||
82
dist/lodash.compat.min.js
vendored
@@ -1,46 +1,46 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license
|
||||
* Lo-Dash 1.1.1 (Custom Build) lodash.com/license
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!Z(n)&&Qt.call(n,"__wrapped__")?n:new U(n)}function F(n){var t=n.length,e=t>=l;if(e)for(var r={},u=-1;++u<t;){var a=f+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=f+t;return r[u]&&-1<_t(r[u],t)}return-1<_t(n,t)}}function R(n){return n.charCodeAt(0)}function T(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function D(n,t,e,r){function u(){var r=arguments,l=o?this:t;
|
||||
return a||(n=t[i]),e.length&&(r=r.length?(r=le.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(V.prototype=n.prototype,l=new V,V.prototype=null,r=n.apply(l,r),et(r)?r:l):n.apply(l,r)}var a=tt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Dt;t=n}return u}function z(){for(var n,t={g:C,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!de},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=$t,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ve.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ve.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ve.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ve.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ve.enumPrototypes&&(r+="}"),r+="}";
|
||||
else if(r+="for(i in m){",(ve.enumPrototypes||t.i)&&(r+="if(",ve.enumPrototypes&&(r+="!(v&&i=='prototype')"),ve.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ve.enumPrototypes||t.i)&&(r+="}"),r+="}",ve.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ve.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Qt,Q,Z,ut,de,a,$)
|
||||
}function L(n){return"\\"+q[n]}function K(n){return _e[n]}function M(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function U(n){this.__wrapped__=n}function V(){}function G(n){var t=!1;if(!n||Zt.call(n)!=A||!ve.argsClass&&Q(n))return t;var e=n.constructor;return(tt(e)?e instanceof e:ve.nodeClass||!M(n))?ve.ownLast?(ke(n,function(n,e,r){return t=Qt.call(r,e),!1}),!0===t):(ke(n,function(n,e){t=e}),!1===t||Qt.call(n,t)):t}function H(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);
|
||||
var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function J(n){return we[n]}function Q(n){return Zt.call(n)==j}function W(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=et(f)){var l=Zt.call(f);if(!N[l]||!ve.nodeClass&&M(f))return f;var c=Z(f)}if(!u||!t)return u?c?H(f):Ce({},f):f;switch(u=se[l],l){case x:case O:return new u(+f);case S:case P:return new u(f);
|
||||
case I:return u(f.source,h.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return f=c?u(f.length):{},c&&(Qt.call(n,"index")&&(f.index=n.index),Qt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(c?pt:xe)(n,function(n,u){f[u]=W(n,t,r,e,o,i)}),f}function X(n){var t=[];return ke(n,function(n,e){tt(n)&&t.push(e)}),t.sort()}function Y(n){for(var t=-1,e=de(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function Z(n){return ve.argsObject&&n instanceof It||(te?te(n):Zt.call(n)==k)
|
||||
}function nt(n,t,e,r,u,o){var f=e===i;if(typeof e=="function"&&!f){e=a.createCallback(e,r,2);var l=e(n,t);if(typeof l!="undefined")return!!l}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Zt.call(n),c=Zt.call(t),p==j&&(p=A),c==j&&(c=A),p!=c)return!1;switch(p){case x:case O:return+n==+t;case S:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case I:case P:return n==Tt(t)}if(c=p==k,!c){if(Qt.call(n,"__wrapped__")||Qt.call(t,"__wrapped__"))return nt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);
|
||||
if(p!=A||!ve.nodeClass&&(M(n)||M(t)))return!1;var p=!ve.argsObject&&Q(n)?Ft:n.constructor,s=!ve.argsObject&&Q(t)?Ft:t.constructor;if(p!=s&&(!tt(p)||!(p instanceof p&&tt(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,l=!0;if(u.push(n),o.push(t),c){if(p=n.length,v=t.length,l=v==n.length,!l&&!f)return l;for(;v--;)if(c=p,s=t[v],f)for(;c--&&!(l=nt(n[c],s,e,r,u,o)););else if(!(l=nt(n[v],s,e,r,u,o)))break;return l}return ke(t,function(t,a,i){return Qt.call(i,a)?(v++,l=Qt.call(n,a)&&nt(n[a],t,e,r,u,o)):void 0
|
||||
}),l&&!f&&ke(n,function(n,t,e){return Qt.call(e,t)?l=-1<--v:void 0}),l}function tt(n){return typeof n=="function"}function et(n){return n?$[typeof n]:!1}function rt(n){return typeof n=="number"||Zt.call(n)==S}function ut(n){return typeof n=="string"||Zt.call(n)==P}function at(n,t,e){var r=arguments,u=0,o=2;if(!et(n))return n;if(e===i)var f=r[3],l=r[4],c=r[5];else l=[],c=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);
|
||||
for(;++u<o;)(Z(r[u])?pt:xe)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=Z(t))||Oe(t))){for(a=l.length;a--;)if(r=l[a]==t){o=c[a];break}if(!r){var p;f&&(a=f(o,t),p=typeof a!="undefined")&&(o=a),p||(o=u?Z(o)?o:[]:Oe(o)?o:{}),l.push(t),c.push(o),p||(o=at(o,t,i,f,l,c))}}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function ot(n){for(var t=-1,e=de(n),r=e.length,u=It(r);++t<r;)u[t]=n[e[t]];return u}function it(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?ae(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):_t(n,t,e)):be(n,function(n){return++r<e?void 0:!(a=n===t)
|
||||
}),a}function ft(n,t,e){var r=!0;if(t=a.createCallback(t,e),Z(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else be(n,function(n,e,u){return r=!!t(n,e,u)});return r}function lt(n,t,e){var r=[];if(t=a.createCallback(t,e),Z(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else be(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ct(n,t,e){if(t=a.createCallback(t,e),!Z(n)){var r;return be(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
||||
if(t(o,e,n))return o}}function pt(n,t,e){if(t&&typeof e=="undefined"&&Z(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else be(n,t,e);return n}function st(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);if(t=a.createCallback(t,e),Z(n))for(;++r<u;)o[r]=t(n[r],r,n);else be(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function vt(n,t,e){var r=-1/0,u=r;if(!t&&Z(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&ut(n)?R:a.createCallback(t,e),be(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)
|
||||
});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),Z(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else be(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function ht(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=de(n),o=f.length;else ve.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function yt(n,t,e){var r;if(t=a.createCallback(t,e),Z(n)){e=-1;
|
||||
for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else be(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function mt(n){for(var t=-1,e=n?n.length:0,r=Gt.apply(zt,le.call(arguments,1)),r=F(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return H(n,0,oe(ae(0,r),u))}}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),Z(r)?Wt.apply(i,t?r:bt(r)):i.push(r);
|
||||
return i}function _t(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?ae(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function wt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:ae(0,t);return H(n,r)}function Ct(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):Et,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function jt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],c=i;
|
||||
typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var p=!t&&o>=l;if(p)var s={};for(null!=e&&(c=[],e=a.createCallback(e,r));++u<o;){r=n[u];var v=e?e(r,u,n):r;if(p)var g=f+v,g=s[g]?!(c=s[g]):c=s[g]=[];(t?!u||c[c.length-1]!==v:g||0>_t(c,v))&&((e||p)&&c.push(v),i.push(r))}return i}function kt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function xt(n,t){return ve.fastBind||ne&&2<arguments.length?ne.call.apply(ne,arguments):D(n,t,le.call(arguments,2))}function Ot(n){var t=le.call(arguments,1);
|
||||
return Yt(function(){n.apply(e,t)},1)}function Et(n){return n}function St(n){pt(X(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Wt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new U(t)}})}function At(){return this.__wrapped__}r=r?B.defaults(n.Object(),r,B.pick(n,w)):n;var It=r.Array,Pt=r.Boolean,Nt=r.Date,$t=r.Function,qt=r.Math,Bt=r.Number,Ft=r.Object,Rt=r.RegExp,Tt=r.String,Dt=r.TypeError,zt=It(),Lt=Ft(),Kt=r._,Mt=Rt("^"+Tt(Lt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ut=qt.ceil,Vt=r.clearTimeout,Gt=zt.concat,Ht=qt.floor,Jt=Mt.test(Jt=Ft.getPrototypeOf)&&Jt,Qt=Lt.hasOwnProperty,Wt=zt.push,Xt=r.setImmediate,Yt=r.setTimeout,Zt=Lt.toString,ne=Mt.test(ne=Zt.bind)&&ne,te=Mt.test(te=It.isArray)&&te,ee=r.isFinite,re=r.isNaN,ue=Mt.test(ue=Ft.keys)&&ue,ae=qt.max,oe=qt.min,ie=r.parseInt,fe=qt.random,le=zt.slice,ce=Mt.test(r.attachEvent),pe=ne&&!/\n|true/.test(ne+ce),se={};
|
||||
se[k]=It,se[x]=Pt,se[O]=Nt,se[A]=Ft,se[S]=Bt,se[I]=Rt,se[P]=Tt;var ve=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ve.argsObject=arguments.constructor==Ft&&!(arguments instanceof It),ve.argsClass=Q(arguments),ve.enumPrototypes=n.propertyIsEnumerable("prototype"),ve.fastBind=ne&&!pe,ve.ownLast="x"!=e[0],ve.nonEnumArgs=0!=r,ve.nonEnumShadows=!/valueOf/.test(e),ve.spliceObjects=(zt.splice.call(t,0,1),!t[0]),ve.unindexedChars="xx"!="x"[0]+Ft("x")[0];
|
||||
try{ve.nodeClass=!(Zt.call(document)==A&&!({toString:0}+""))}catch(u){ve.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var ge={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},he={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},ye={h:"if(!r[typeof m])return u;"+he.h,b:!1};
|
||||
U.prototype=a.prototype,ve.argsClass||(Q=function(n){return n?Qt.call(n,"callee"):!1});var me=z({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),de=ue?function(n){return et(n)?ve.enumPrototypes&&typeof n=="function"||ve.nonEnumArgs&&n.length&&Q(n)?me(n):ue(n):[]}:me,be=z(he),_e={"&":"&","<":"<",">":">",'"':""","'":"'"},we=Y(_e),Ce=z(ge,{h:ge.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),je=z(ge),ke=z(he,ye,{i:!1}),xe=z(he,ye);
|
||||
tt(/x/)&&(tt=function(n){return n instanceof $t||Zt.call(n)==E});var Oe=Jt?function(n){if(!n||Zt.call(n)!=A||!ve.argsClass&&Q(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Jt(t))&&Jt(e);return e?n==e||Jt(n)==e:G(n)}:G;pe&&u&&typeof Xt=="function"&&(Ot=xt(Xt,r));var Ee=8==ie("08")?ie:function(n,t){return ie(ut(n)?n.replace(m,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=Ce,a.at=function(n){var t=-1,e=Gt.apply(zt,le.call(arguments,1)),r=e.length,u=It(r);
|
||||
for(ve.unindexedChars&&ut(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=xt,a.bindAll=function(n){for(var t=1<arguments.length?Gt.apply(zt,le.call(arguments,1)):X(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=xt(n[u],n)}return n},a.bindKey=function(n,t){return D(n,t,le.call(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||
return t[0]}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),Qt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return Et;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=de(n);return function(t){for(var e=u.length,r=!1;e--&&(r=nt(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
|
||||
}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,f&&(a=n.apply(o,u))}var u,a,o,i,f=!0;if(!0===e)var l=!0,f=!1;else e&&$[typeof e]&&(l=e.leading,f="trailing"in e?e.trailing:f);return function(){var e=l&&!i;return u=arguments,o=this,Vt(i),i=Yt(r,t),e&&(a=n.apply(o,u)),a}},a.defaults=je,a.defer=Ot,a.delay=function(n,t){var r=le.call(arguments,2);return Yt(function(){n.apply(e,r)},t)},a.difference=mt,a.filter=lt,a.flatten=bt,a.forEach=pt,a.forIn=ke,a.forOwn=xe,a.functions=X,a.groupBy=function(n,t,e){var r={};
|
||||
return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),(Qt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return H(n,0,oe(ae(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],c=i;n:for(;++u<a;){var p=n[u];if(o)var s=f+p,s=r[0][s]?!(c=r[0][s]):c=r[0][s]=[];if(s||0>_t(c,p)){o&&c.push(p);
|
||||
for(var v=e;--v;)if(!(r[v]||(r[v]=F(t[v])))(p))continue n;i.push(p)}}return i},a.invert=Y,a.invoke=function(n,t){var e=le.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=de,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=f+(t?t.apply(this,arguments):arguments[0]);return Qt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r;
|
||||
if(!t&&Z(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&ut(n)?R:a.createCallback(t,e),be(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Gt.apply(zt,le.call(arguments,1));return ke(n,function(n,e,a){(r?!t(n,e,a):0>_t(o,e))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=de(n),r=e.length,u=It(r);++t<r;){var a=e[t];
|
||||
u[t]=[a,n[a]]}return u},a.partial=function(n){return D(n,le.call(arguments,1))},a.partialRight=function(n){return D(n,le.call(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=Gt.apply(zt,le.call(arguments,1)),i=et(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),ke(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=st,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=ae(0,Ut((t-n)/e));for(var u=It(t);++r<t;)u[r]=n,n+=e;
|
||||
return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),lt(n,function(n,e,r){return!t(n,e,r)})},a.rest=wt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=It(typeof e=="number"?e:0);return pt(n,function(n){var e=Ht(fe()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);for(t=a.createCallback(t,e),pt(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(T);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t,e){function r(){f=new Nt,i=null,c&&(a=n.apply(o,u))
|
||||
}var u,a,o,i,f=0,l=!0,c=!0;return!1===e?l=!1:e&&$[typeof e]&&(l="leading"in e?e.leading:l,c="trailing"in e?e.trailing:c),function(){var e=new Nt;!i&&!l&&(f=e);var c=t-(e-f);return u=arguments,o=this,0<c?i||(i=Yt(r,c)):(Vt(i),i=null,f=e,a=n.apply(o,u)),a}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=It(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ve.unindexedChars&&ut(n)?n.split(""):H(n):ot(n)},a.union=function(n){return Z(n)||(arguments[0]=n?le.call(n):zt),jt(Gt.apply(zt,arguments))
|
||||
},a.uniq=jt,a.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?vt(st(n,"length")):0,u=It(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=It(e)))[t]=o[a];return u},a.values=ot,a.where=lt,a.without=function(n){return mt(n,le.call(arguments,1))},a.wrap=function(n,t){return function(){var e=[n];return Wt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?vt(st(arguments,"length")):0,r=It(e);++t<e;)r[t]=st(arguments,t);return r},a.zipObject=kt,a.collect=st,a.drop=wt,a.each=pt,a.extend=Ce,a.methods=X,a.object=kt,a.select=lt,a.tail=wt,a.unique=jt,St(a),a.clone=W,a.cloneDeep=function(n,t,e){return W(n,!0,t,e)
|
||||
},a.contains=it,a.escape=function(n){return null==n?"":Tt(n).replace(b,K)},a.every=ft,a.find=ct,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),xe(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Qt.call(n,t):!1},a.identity=Et,a.indexOf=_t,a.isArguments=Q,a.isArray=Z,a.isBoolean=function(n){return!0===n||!1===n||Zt.call(n)==x},a.isDate=function(n){return n instanceof Nt||Zt.call(n)==O
|
||||
},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var e=Zt.call(n),r=n.length;return e==k||e==P||(ve.argsClass?e==j:Q(n))||e==A&&typeof r=="number"&&tt(n.splice)?!r:(xe(n,function(){return t=!1}),t)},a.isEqual=nt,a.isFinite=function(n){return ee(n)&&!re(parseFloat(n))},a.isFunction=tt,a.isNaN=function(n){return rt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=rt,a.isObject=et,a.isPlainObject=Oe,a.isRegExp=function(n){return n instanceof Rt||Zt.call(n)==I
|
||||
},a.isString=ut,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ae(0,r+e):oe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=St,a.noConflict=function(){return r._=Kt,this},a.parseInt=Ee,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Ht(fe()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=ht,a.result=function(n,t){var r=n?n[t]:e;return tt(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;
|
||||
return typeof t=="number"?t:de(n).length},a.some=yt,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=je({},r,u);var o,i=je({},r.imports,u.imports),u=de(i),i=ot(i),f=0,l=r.interpolate||d,v="__p+='",l=Rt((r.escape||d).source+"|"+l.source+"|"+(l===y?g:d).source+"|"+(r.evaluate||d).source+"|$","g");n.replace(l,function(t,e,r,u,a,i){return r||(r=u),v+=n.slice(f,i).replace(_,L),e&&(v+="'+__e("+e+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),r&&(v+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t
|
||||
}),v+="';\n",l=r=r.variable,l||(r="obj",v="with("+r+"){"+v+"}"),v=(o?v.replace(c,""):v).replace(p,"$1").replace(s,"$1;"),v="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var h=$t(u,"return "+v).apply(e,i)}catch(m){throw m.source=v,m}return t?h(t):(h.source=v,h)},a.unescape=function(n){return null==n?"":Tt(n).replace(v,J)},a.uniqueId=function(n){var t=++o;return Tt(null==n?"":n)+t
|
||||
},a.all=ft,a.any=yt,a.detect=ct,a.foldl=gt,a.foldr=ht,a.include=it,a.inject=gt,xe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Wt.apply(t,arguments),n.apply(a,t)})}),a.first=dt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return H(n,ae(0,u-r))}},a.take=dt,a.head=dt,xe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
|
||||
return null==t||e&&typeof t!="function"?r:new U(r)})}),a.VERSION="1.2.0",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,be(["join","pop","shift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),be(["push","reverse","sort","unshift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),be(["concat","slice","splice"],function(n){var t=zt[n];a.prototype[n]=function(){return new U(t.apply(this.__wrapped__,arguments))
|
||||
}}),ve.spliceObjects||be(["pop","shift","splice"],function(n){var t=zt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new U(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},f=+new Date+"",l=200,c=/\b__p\+='';/g,p=/\b(__p\+=)''\+/g,s=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,h=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=/^0+(?=.$)/,d=/($^)/,b=/[&<>"']/g,_=/['\n\r\t\u2028\u2029\\]/g,w="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),C="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),j="[object Arguments]",k="[object Array]",x="[object Boolean]",O="[object Date]",E="[object Function]",S="[object Number]",A="[object Object]",I="[object RegExp]",P="[object String]",N={};
|
||||
N[E]=!1,N[j]=N[k]=N[x]=N[O]=N[S]=N[A]=N[I]=N[P]=!0;var $={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},q={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=B,define(function(){return B})):r&&!r.nodeType?u?(u.exports=B)._=B:r._=B:n._=B})(this);
|
||||
;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!fe(n)&&Vt.call(n,"__wrapped__")?n:new K(n)}function q(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=qt(n[e]);(Vt.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=qt(e);return Vt.call(a,r)&&-1<yt(a[r],e)}return-1<yt(n,e,t)}}function B(n){return n.charCodeAt(0)}function F(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
|
||||
}return e<r?-1:1}function R(n,t,e,r){function u(){var r=arguments,c=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=V(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(M.prototype=n.prototype,c=new M,M.prototype=null,r=n.apply(c,r),Z(r)?r:c):n.apply(c,r)}var a=Y(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Bt;t=n}return u}function T(){for(var n,t={g:_,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!le},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=At,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ie.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ie.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ie.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ie.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ie.enumPrototypes&&(r+="}"),r+="}";
|
||||
else if(r+="for(i in m){",(ie.enumPrototypes||t.i)&&(r+="if(",ie.enumPrototypes&&(r+="!(v&&i=='prototype')"),ie.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ie.enumPrototypes||t.i)&&(r+="}"),r+="}",ie.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ie.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Vt,H,fe,tt,le,a,P)
|
||||
}function D(n){return"\\"+N[n]}function z(n){return se[n]}function L(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function K(n){this.__wrapped__=n}function M(){}function U(n){var t=!1;if(!n||Qt.call(n)!=E||!ie.argsClass&&H(n))return t;var e=n.constructor;return(Y(e)?e instanceof e:ie.nodeClass||!L(n))?ie.ownLast?(ye(n,function(n,e,r){return t=Vt.call(r,e),!1}),!0===t):(ye(n,function(n,e){t=e}),!1===t||Vt.call(n,t)):t}function V(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);
|
||||
var r=-1;e=e-t||0;for(var u=Ot(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function G(n){return ve[n]}function H(n){return Qt.call(n)==C}function J(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=Z(f)){var c=Qt.call(f);if(!I[c]||!ie.nodeClass&&L(f))return f;var l=fe(f)}if(!u||!t)return u?l?V(f):ge({},f):f;switch(u=oe[c],c){case j:case k:return new u(+f);case O:case A:return new u(f);
|
||||
case S:return u(f.source,v.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(Vt.call(n,"index")&&(f.index=n.index),Vt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?ft:me)(n,function(n,u){f[u]=J(n,t,r,e,o,i)}),f}function Q(n){var t=[];return ye(n,function(n,e){Y(n)&&t.push(e)}),t.sort()}function W(n){for(var t=-1,e=le(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function X(n,t,e,r,u,o){var f=e===i;if(e&&!f){e=typeof r=="undefined"?e:a.createCallback(e,r,2);
|
||||
var c=e(n,t);if(typeof c!="undefined")return!!c}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Qt.call(n),l=Qt.call(t),p==C&&(p=E),l==C&&(l=E),p!=l)return!1;switch(p){case j:case k:return+n==+t;case O:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case S:case A:return n==qt(t)}if(l=p==w,!l){if(Vt.call(n,"__wrapped__")||Vt.call(t,"__wrapped__"))return X(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);
|
||||
if(p!=E||!ie.nodeClass&&(L(n)||L(t)))return!1;var p=!ie.argsObject&&H(n)?Nt:n.constructor,s=!ie.argsObject&&H(t)?Nt:t.constructor;if(p!=s&&(!Y(p)||!(p instanceof p&&Y(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,c=!0;if(u.push(n),o.push(t),l){if(p=n.length,v=t.length,c=v==n.length,!c&&!f)return c;for(;v--;)if(l=p,s=t[v],f)for(;l--&&!(c=X(n[l],s,e,r,u,o)););else if(!(c=X(n[v],s,e,r,u,o)))break;return c}return ye(t,function(t,a,i){return Vt.call(i,a)?(v++,c=Vt.call(n,a)&&X(n[a],t,e,r,u,o)):void 0
|
||||
}),c&&!f&&ye(n,function(n,t,e){return Vt.call(e,t)?c=-1<--v:void 0}),c}function Y(n){return typeof n=="function"}function Z(n){return n?P[typeof n]:!1}function nt(n){return typeof n=="number"||Qt.call(n)==O}function tt(n){return typeof n=="string"||Qt.call(n)==A}function et(n,t,e){var r=arguments,u=0,o=2;if(!Z(n))return n;if(e===i)var f=r[3],c=r[4],l=r[5];else c=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);
|
||||
for(;++u<o;)(fe(r[u])?ft:me)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=fe(t))||de(t))){for(a=c.length;a--;)if(r=c[a]==t){o=l[a];break}r||(o=u?fe(o)?o:[]:de(o)?o:{},f&&(a=f(o,t),typeof a!="undefined"&&(o=a)),c.push(t),l.push(o),f||(o=et(o,t,i,f,c,l)))}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function rt(n){for(var t=-1,e=le(n),r=e.length,u=Ot(r);++t<r;)u[t]=n[e[t]];return u}function ut(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?te(0,u+e):e)||0,typeof u=="number"?a=-1<(tt(n)?n.indexOf(t,e):yt(n,t,e)):pe(n,function(n){return++r<e?void 0:!(a=n===t)
|
||||
}),a}function at(n,t,e){var r=!0;if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else pe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function ot(n,t,e){var r=[];if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else pe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function it(n,t,e){if(t=a.createCallback(t,e),!fe(n)){var r;return pe(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
||||
if(t(o,e,n))return o}}function ft(n,t,e){if(t&&typeof e=="undefined"&&fe(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else pe(n,t,e);return n}function ct(n,t,e){var r=-1,u=n?n.length:0,o=Ot(typeof u=="number"?u:0);if(t=a.createCallback(t,e),fe(n))for(;++r<u;)o[r]=t(n[r],r,n);else pe(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function lt(n,t,e){var r=-1/0,u=r;if(!t&&fe(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&tt(n)?B:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)
|
||||
});return u}function pt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),fe(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else pe(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function st(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=le(n),o=f.length;else ie.unindexedChars&&tt(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),ft(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function vt(n,t,e){var r;
|
||||
if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else pe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function gt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return V(n,0,ee(te(0,r),u))}}function ht(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),fe(r)?Gt.apply(i,t?r:ht(r)):i.push(r);
|
||||
return i}function yt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?te(0,u+e):e||0)-1;else if(e)return r=dt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function mt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:te(0,t);return V(n,r)}function dt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):jt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],f=i;
|
||||
typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(null!=e&&(f=[],e=a.createCallback(e,r));++u<o;){r=n[u];var p=e?e(r,u,n):r;if(c)var s=qt(p),s=Vt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>yt(f,p))&&((e||c)&&f.push(p),i.push(r))}return i}function _t(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function Ct(n,t){return ie.fastBind||Wt&&2<arguments.length?Wt.call.apply(Wt,arguments):R(n,t,V(arguments,2))}function wt(n){var t=V(arguments,1);
|
||||
return Jt(function(){n.apply(e,t)},1)}function jt(n){return n}function kt(n){ft(Q(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Gt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new K(t)}})}function xt(){return this.__wrapped__}r=r?$.defaults(n.Object(),r,$.pick(n,b)):n;var Ot=r.Array,Et=r.Boolean,St=r.Date,At=r.Function,It=r.Math,Pt=r.Number,Nt=r.Object,$t=r.RegExp,qt=r.String,Bt=r.TypeError,Ft=Ot(),Rt=Nt(),Tt=r._,Dt=$t("^"+qt(Rt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),zt=It.ceil,Lt=r.clearTimeout,Kt=Ft.concat,Mt=It.floor,Ut=Dt.test(Ut=Nt.getPrototypeOf)&&Ut,Vt=Rt.hasOwnProperty,Gt=Ft.push,Ht=r.setImmediate,Jt=r.setTimeout,Qt=Rt.toString,Wt=Dt.test(Wt=V.bind)&&Wt,Xt=Dt.test(Xt=Ot.isArray)&&Xt,Yt=r.isFinite,Zt=r.isNaN,ne=Dt.test(ne=Nt.keys)&&ne,te=It.max,ee=It.min,re=r.parseInt,ue=It.random,It=Dt.test(r.attachEvent),ae=Wt&&!/\n|true/.test(Wt+It),oe={};
|
||||
oe[w]=Ot,oe[j]=Et,oe[k]=St,oe[E]=Nt,oe[O]=Pt,oe[S]=$t,oe[A]=qt;var ie=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ie.argsObject=arguments.constructor==Nt,ie.argsClass=H(arguments),ie.enumPrototypes=n.propertyIsEnumerable("prototype"),ie.fastBind=Wt&&!ae,ie.ownLast="x"!=e[0],ie.nonEnumArgs=0!=r,ie.nonEnumShadows=!/valueOf/.test(e),ie.spliceObjects=(Ft.splice.call(t,0,1),!t[0]),ie.unindexedChars="xx"!="x"[0]+Nt("x")[0];
|
||||
try{ie.nodeClass=!(Qt.call(document)==E&&!({toString:0}+""))}catch(u){ie.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}},Et={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},Pt={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},It={h:"if(!r[typeof m])return u;"+Pt.h,b:!1},K.prototype=a.prototype,ie.argsClass||(H=function(n){return n?Vt.call(n,"callee"):!1
|
||||
});var fe=Xt||function(n){return ie.argsObject&&n instanceof Ot||Qt.call(n)==w},ce=T({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),le=ne?function(n){return Z(n)?ie.enumPrototypes&&typeof n=="function"||ie.nonEnumArgs&&n.length&&H(n)?ce(n):ne(n):[]}:ce,pe=T(Pt),se={"&":"&","<":"<",">":">",'"':""","'":"'"},ve=W(se),ge=T(Et,{h:Et.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),he=T(Et),ye=T(Pt,It,{i:!1}),me=T(Pt,It);
|
||||
Y(/x/)&&(Y=function(n){return n instanceof At||Qt.call(n)==x});var de=Ut?function(n){if(!n||Qt.call(n)!=E||!ie.argsClass&&H(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Ut(t))&&Ut(e);return e?n==e||Ut(n)==e:U(n)}:U;return ae&&u&&typeof Ht=="function"&&(wt=Ct(Ht,r)),Ht=8==re("08")?re:function(n,t){return re(tt(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=ge,a.at=function(n){var t=-1,e=Kt.apply(Ft,V(arguments,1)),r=e.length,u=Ot(r);
|
||||
for(ie.unindexedChars&&tt(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=Ct,a.bindAll=function(n){for(var t=Kt.apply(Ft,arguments),e=1<t.length?0:(t=Q(n),-1),r=t.length;++e<r;){var u=t[e];n[u]=Ct(n[u],n)}return n},a.bindKey=function(n,t){return R(n,t,V(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]
|
||||
}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),ft(n,function(n,e,u){e=qt(t(n,e,u)),Vt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return jt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=le(n);return function(t){for(var e=u.length,r=!1;e--&&(r=X(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
|
||||
}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=e&&!i;return u=arguments,o=this,Lt(i),i=Jt(r,t),f&&(a=n.apply(o,u)),a}},a.defaults=he,a.defer=wt,a.delay=function(n,t){var r=V(arguments,2);return Jt(function(){n.apply(e,r)},t)},a.difference=function(n){for(var t=-1,e=n?n.length:0,r=Kt.apply(Ft,arguments),r=q(r,e,100),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.filter=ot,a.flatten=ht,a.forEach=ft,a.forIn=ye,a.forOwn=me,a.functions=Q,a.groupBy=function(n,t,e){var r={};
|
||||
return t=a.createCallback(t,e),ft(n,function(n,e,u){e=qt(t(n,e,u)),(Vt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return V(n,0,ee(te(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=100<=a,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=qt(c),l=Vt.call(r[0],l)?!(f=r[0][l]):f=r[0][l]=[];
|
||||
if(l||0>yt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=q(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=W,a.invoke=function(n,t){var e=V(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Ot(typeof a=="number"?a:0);return ft(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=le,a.map=ct,a.max=lt,a.memoize=function(n,t){var e={};return function(){var r=qt(t?t.apply(this,arguments):arguments[0]);return Vt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=et,a.min=function(n,t,e){var r=1/0,u=r;
|
||||
if(!t&&fe(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&tt(n)?B:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Kt.apply(Ft,arguments);return ye(n,function(n,e,a){(r?!t(n,e,a):0>yt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=le(n),r=e.length,u=Ot(r);++t<r;){var a=e[t];
|
||||
u[t]=[a,n[a]]}return u},a.partial=function(n){return R(n,V(arguments,1))},a.partialRight=function(n){return R(n,V(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=0,o=Kt.apply(Ft,arguments),i=Z(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),ye(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=ct,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=te(0,zt((t-n)/e));for(var u=Ot(t);++r<t;)u[r]=n,n+=e;
|
||||
return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),ot(n,function(n,e,r){return!t(n,e,r)})},a.rest=mt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=Ot(typeof e=="number"?e:0);return ft(n,function(n){var e=Mt(ue()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Ot(typeof u=="number"?u:0);for(t=a.createCallback(t,e),ft(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(F);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t){function e(){i=new St,o=null,u=n.apply(a,r)
|
||||
}var r,u,a,o,i=0;return function(){var f=new St,c=t-(f-i);return r=arguments,a=this,0<c?o||(o=Jt(e,c)):(Lt(o),o=null,i=f,u=n.apply(a,r)),u}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ot(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ie.unindexedChars&&tt(n)?n.split(""):V(n):rt(n)},a.union=function(){return bt(Kt.apply(Ft,arguments))},a.uniq=bt,a.values=rt,a.where=ot,a.without=function(n){for(var t=-1,e=n?n.length:0,r=q(arguments,1,30),u=[];++t<e;){var a=n[t];
|
||||
r(a)||u.push(a)}return u},a.wrap=function(n,t){return function(){var e=[n];return Gt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?lt(ct(arguments,"length")):0,r=Ot(e);++t<e;)r[t]=ct(arguments,t);return r},a.zipObject=_t,a.collect=ct,a.drop=mt,a.each=ft,a.extend=ge,a.methods=Q,a.object=_t,a.select=ot,a.tail=mt,a.unique=bt,kt(a),a.clone=J,a.cloneDeep=function(n,t,e){return J(n,!0,t,e)},a.contains=ut,a.escape=function(n){return null==n?"":qt(n).replace(m,z)},a.every=at,a.find=it,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;
|
||||
for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),me(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Vt.call(n,t):!1},a.identity=jt,a.indexOf=yt,a.isArguments=H,a.isArray=fe,a.isBoolean=function(n){return!0===n||!1===n||Qt.call(n)==j},a.isDate=function(n){return n instanceof St||Qt.call(n)==k},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;
|
||||
var e=Qt.call(n),r=n.length;return e==w||e==A||(ie.argsClass?e==C:H(n))||e==E&&typeof r=="number"&&Y(n.splice)?!r:(me(n,function(){return t=!1}),t)},a.isEqual=X,a.isFinite=function(n){return Yt(n)&&!Zt(parseFloat(n))},a.isFunction=Y,a.isNaN=function(n){return nt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=nt,a.isObject=Z,a.isPlainObject=de,a.isRegExp=function(n){return n instanceof $t||Qt.call(n)==S},a.isString=tt,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;
|
||||
for(typeof e=="number"&&(r=(0>e?te(0,r+e):ee(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=kt,a.noConflict=function(){return r._=Tt,this},a.parseInt=Ht,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Mt(ue()*((+t||0)-n+1))},a.reduce=pt,a.reduceRight=st,a.result=function(n,t){var r=n?n[t]:e;return Y(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:le(n).length},a.some=vt,a.sortedIndex=dt,a.template=function(n,t,r){var u=a.templateSettings;
|
||||
n||(n=""),r=he({},r,u);var o,i=he({},r.imports,u.imports),u=le(i),i=rt(i),p=0,v=r.interpolate||y,h="__p+='",v=$t((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(d,D),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}";
|
||||
try{var m=At(u,"return "+h).apply(e,i)}catch(b){throw b.source=h,b}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":qt(n).replace(p,G)},a.uniqueId=function(n){var t=++o;return qt(null==n?"":n)+t},a.all=at,a.any=vt,a.detect=it,a.foldl=pt,a.foldr=st,a.include=ut,a.inject=pt,me(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Gt.apply(t,arguments),n.apply(a,t)})}),a.first=gt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;
|
||||
for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return V(n,te(0,u-r))}},a.take=gt,a.head=gt,me(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new K(r)})}),a.VERSION="1.1.1",a.prototype.toString=function(){return qt(this.__wrapped__)},a.prototype.value=xt,a.prototype.valueOf=xt,pe(["join","pop","shift"],function(n){var t=Ft[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||
}}),pe(["push","reverse","sort","unshift"],function(n){var t=Ft[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),pe(["concat","slice","splice"],function(n){var t=Ft[n];a.prototype[n]=function(){return new K(t.apply(this.__wrapped__,arguments))}}),ie.spliceObjects||pe(["pop","shift","splice"],function(n){var t=Ft[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new K(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;
|
||||
a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,d=/['\n\r\t\u2028\u2029\\]/g,b="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),C="[object Arguments]",w="[object Array]",j="[object Boolean]",k="[object Date]",x="[object Function]",O="[object Number]",E="[object Object]",S="[object RegExp]",A="[object String]",I={};
|
||||
I[x]=!1,I[C]=I[w]=I[j]=I[k]=I[O]=I[E]=I[S]=I[A]=!0;var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},N={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=$,define(function(){return $})):r&&!r.nodeType?u?(u.exports=$)._=$:r._=$:n._=$})(this);
|
||||
603
dist/lodash.js
vendored
76
dist/lodash.min.js
vendored
@@ -1,44 +1,42 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license
|
||||
* Lo-Dash 1.1.1 (Custom Build) lodash.com/license
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n){function t(o){function f(n){if(!n||ue.call(n)!=S)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Zt(t))&&Zt(e);return e?n==e||Zt(n)==e:X(n)}function q(n,t,e){if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(var r=-1,u=F[typeof n]?me(n):[],o=u.length;++r<o&&(e=u[r],!(t(n[e],e,n)===a)););return n}function D(n,t,e){var r;if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(r in n)if(t(n[r],r,n)===a)break;return n}function z(n,t,e){var r,u=n,a=u;
|
||||
if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&F[typeof u]){var c=u.length;if(r=-1,rt(u))for(;++r<c;)"undefined"==typeof a[r]&&(a[r]=u[r]);else for(var l=-1,p=F[typeof u]?me(u):[],c=p.length;++l<c;)r=p[l],"undefined"==typeof a[r]&&(a[r]=u[r])}return a}function P(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var c=M.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(c=o[--f]);
|
||||
for(;++i<f;)if((u=o[i])&&F[typeof u]){var l=u.length;if(r=-1,rt(u))for(;++r<l;)a[r]=c?c(a[r],u[r]):u[r];else for(var p=-1,s=F[typeof u]?me(u):[],l=s.length;++p<l;)r=s[p],a[r]=c?c(a[r],u[r]):u[r]}return a}function K(n){var t,e=[];if(!n||!F[typeof n])return e;for(t in n)ne.call(n,t)&&e.push(t);return e}function M(n){return n&&typeof n=="object"&&!rt(n)&&ne.call(n,"__wrapped__")?n:new Q(n)}function U(n){var t=n.length,e=t>=s;if(e)for(var r={},u=-1;++u<t;){var a=p+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=p+t;
|
||||
return r[u]&&-1<xt(r[u],t)}return-1<xt(n,t)}}function V(n){return n.charCodeAt(0)}function G(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function H(n,t,e,r){function a(){var r=arguments,l=i?this:t;return o||(n=t[f]),e.length&&(r=r.length?(r=ge.call(r),c?r.concat(e):e.concat(r)):e),this instanceof a?(W.prototype=n.prototype,l=new W,W.prototype=u,r=n.apply(l,r),ot(r)?r:l):n.apply(l,r)}var o=at(n),i=!e,f=t;if(i){var c=r;
|
||||
e=t}else if(!o){if(!r)throw new Vt;t=n}return a}function J(n){return"\\"+R[n]}function L(n){return be[n]}function Q(n){this.__wrapped__=n}function W(){}function X(n){var t=a;if(!n||ue.call(n)!=S)return t;var e=n.constructor;return(at(e)?e instanceof e:he.nodeClass||!isNode(n))?(D(n,function(n,e){t=e}),t===a||ne.call(n,t)):t}function Y(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Rt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Z(n){return de[n]}function nt(n,t,r,u,o,i){var f=n;
|
||||
if(typeof t=="function"&&(u=r,r=t,t=a),typeof r=="function"){if(r=typeof u=="undefined"?r:M.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=ot(f)){var c=ue.call(f);if(!B[c])return f;var l=rt(f)}if(!u||!t)return u?l?Y(f):P({},f):f;switch(u=ye[c],c){case N:case E:return new u(+f);case I:case $:return new u(f);case A:return u(f.source,b.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(ne.call(n,"index")&&(f.index=n.index),ne.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?yt:q)(n,function(n,u){f[u]=nt(n,t,r,e,o,i)
|
||||
}),f}function tt(n){var t=[];return D(n,function(n,e){at(n)&&t.push(e)}),t.sort()}function et(n){for(var t=-1,e=me(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function rt(n){return n instanceof Rt||oe(n)}function ut(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=M.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a;
|
||||
if(n==u||t==u)return n===t;if(v=ue.call(n),s=ue.call(t),v==x&&(v=S),s==x&&(s=S),v!=s)return a;switch(v){case N:case E:return+n==+t;case I:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case A:case $:return n==Ut(t)}if(s=v==O,!s){if(ne.call(n,"__wrapped__")||ne.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=S)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!at(v)||!(v instanceof v&&at(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t;
|
||||
var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ut(n[s],g,e,o,i,f)););else if(!(p=ut(n[y],g,e,o,i,f)))break;return p}return D(t,function(t,r,u){return ne.call(u,r)?(y++,p=ne.call(n,r)&&ut(n[r],t,e,o,i,f)):void 0}),p&&!c&&D(n,function(n,t,e){return ne.call(e,t)?p=-1<--y:void 0}),p}function at(n){return typeof n=="function"}function ot(n){return n?F[typeof n]:a}function it(n){return typeof n=="number"||ue.call(n)==I}function ft(n){return typeof n=="string"||ue.call(n)==$
|
||||
}function ct(n,t,e){var r=arguments,u=0,a=2;if(!ot(n))return n;if(e===l)var o=r[3],i=r[4],c=r[5];else i=[],c=[],typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=M.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a]);for(;++u<a;)(rt(r[u])?yt:q)(r[u],function(t,e){var r,u,a=t,p=n[e];if(t&&((u=rt(t))||f(t))){for(a=i.length;a--;)if(r=i[a]==t){p=c[a];break}if(!r){var s;o&&(a=o(p,t),s=typeof a!="undefined")&&(p=a),s||(p=u?rt(p)?p:[]:f(p)?p:{}),i.push(t),c.push(p),s||(p=ct(p,t,l,o,i,c))
|
||||
}}else o&&(a=o(p,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(p=a);n[e]=p});return n}function lt(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u}function pt(n,t,e){var r=-1,u=n?n.length:0,o=a;return e=(0>e?le(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):q(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function st(n,t,e){var u=r;t=M.createCallback(t,e),e=-1;var a=n?n.length:0;if(typeof a=="number")for(;++e<a&&(u=!!t(n[e],e,n)););else q(n,function(n,e,r){return u=!!t(n,e,r)
|
||||
});return u}function vt(n,t,e){var r=[];t=M.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else q(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function gt(n,t,e){t=M.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return q(n,function(n,e,r){return t(n,e,r)?(u=n,a):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function yt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:M.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==a;);else q(n,t);
|
||||
return n}function ht(n,t,e){var r=-1,u=n?n.length:0;if(t=M.createCallback(t,e),typeof u=="number")for(var a=Rt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],q(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function mt(n,t,e){var r=-1/0,u=r;if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o>u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function bt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Rt(r);++e<r;)u[e]=n[e][t];return u||ht(n,t)
|
||||
}function dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=M.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else q(n,function(n,r,o){e=u?(u=a,n):t(e,n,r,o)});return e}function _t(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=me(n),u=i.length;return t=M.createCallback(t,r,4),yt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function kt(n,t,e){var r;t=M.createCallback(t,e),e=-1;var u=n?n.length:0;
|
||||
if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else q(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function wt(n){for(var t=-1,e=n?n.length:0,r=Xt.apply(Gt,ge.call(arguments,1)),r=U(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function Ct(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=-1;for(t=M.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[0];return Y(n,0,pe(le(0,r),a))}}function jt(n,t,e,r){var o=-1,i=n?n.length:0,f=[];for(typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a),e!=u&&(e=M.createCallback(e,r));++o<i;)r=n[o],e&&(r=e(r,o,n)),rt(r)?te.apply(f,t?r:jt(r)):f.push(r);
|
||||
return f}function xt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?le(0,u+e):e||0)-1;else if(e)return r=Nt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function Ot(n,t,e){if(typeof t!="number"&&t!=u){var r=0,a=-1,o=n?n.length:0;for(t=M.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=t==u||e?1:le(0,t);return Y(n,r)}function Nt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?M.createCallback(e,r,1):$t,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Et(n,t,e,r){var o=-1,i=n?n.length:0,f=[],c=f;
|
||||
typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a);var l=!t&&i>=s;if(l)var v={};for(e!=u&&(c=[],e=M.createCallback(e,r));++o<i;){r=n[o];var g=e?e(r,o,n):r;if(l)var y=p+g,y=v[y]?!(c=v[y]):c=v[y]=[];(t?!o||c[c.length-1]!==g:y||0>xt(c,g))&&((e||l)&&c.push(g),f.push(r))}return f}function It(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function St(n,t){return he.fastBind||ae&&2<arguments.length?ae.call.apply(ae,arguments):H(n,t,ge.call(arguments,2))}function At(n){var t=ge.call(arguments,1);
|
||||
return re(function(){n.apply(e,t)},1)}function $t(n){return n}function Bt(n){yt(tt(n),function(t){var e=M[t]=n[t];M.prototype[t]=function(){var n=this.__wrapped__,t=[n];return te.apply(t,arguments),t=e.apply(M,t),n&&typeof n=="object"&&n==t?this:new Q(t)}})}function Ft(){return this.__wrapped__}o=o?T.defaults(n.Object(),o,T.pick(n,j)):n;var Rt=o.Array,Tt=o.Boolean,qt=o.Date,Dt=o.Function,zt=o.Math,Pt=o.Number,Kt=o.Object,Mt=o.RegExp,Ut=o.String,Vt=o.TypeError,Gt=Rt(),Ht=Kt(),Jt=o._,Lt=Mt("^"+Ut(Ht.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Qt=zt.ceil,Wt=o.clearTimeout,Xt=Gt.concat,Yt=zt.floor,Zt=Lt.test(Zt=Kt.getPrototypeOf)&&Zt,ne=Ht.hasOwnProperty,te=Gt.push,ee=o.setImmediate,re=o.setTimeout,ue=Ht.toString,ae=Lt.test(ae=ue.bind)&&ae,oe=Lt.test(oe=Rt.isArray)&&oe,ie=o.isFinite,fe=o.isNaN,ce=Lt.test(ce=Kt.keys)&&ce,le=zt.max,pe=zt.min,se=o.parseInt,ve=zt.random,ge=Gt.slice,zt=Lt.test(o.attachEvent),zt=ae&&!/\n|true/.test(ae+zt),ye={};
|
||||
ye[O]=Rt,ye[N]=Tt,ye[E]=qt,ye[S]=Kt,ye[I]=Pt,ye[A]=Mt,ye[$]=Ut;var he=M.support={};he.fastBind=ae&&!zt,M.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:M}},Q.prototype=M.prototype;var me=ce?function(n){return ot(n)?ce(n):[]}:K,be={"&":"&","<":"<",">":">",'"':""","'":"'"},de=et(be);return zt&&i&&typeof ee=="function"&&(At=St(ee,o)),Tt=8==se("08")?se:function(n,t){return se(ft(n)?n.replace(_,""):n,t||0)},M.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||
}},M.assign=P,M.at=function(n){for(var t=-1,e=Xt.apply(Gt,ge.call(arguments,1)),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u},M.bind=St,M.bindAll=function(n){for(var t=1<arguments.length?Xt.apply(Gt,ge.call(arguments,1)):tt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=St(n[u],n)}return n},M.bindKey=function(n,t){return H(n,t,ge.call(arguments,2),l)},M.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},M.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||
return t[0]}},M.countBy=function(n,t,e){var r={};return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),ne.call(r,e)?r[e]++:r[e]=1}),r},M.createCallback=function(n,t,e){if(n==u)return $t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=me(n);return function(t){for(var e=o.length,r=a;e--&&(r=ut(t[o[e]],n[o[e]],l)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
|
||||
}:function(e,r,u){return n.call(t,e,r,u)}:n},M.debounce=function(n,t,e){function o(){l=u,p&&(f=n.apply(c,i))}var i,f,c,l,p=r;if(e===r)var s=r,p=a;else e&&F[typeof e]&&(s=e.leading,p="trailing"in e?e.trailing:p);return function(){var e=s&&!l;return i=arguments,c=this,Wt(l),l=re(o,t),e&&(f=n.apply(c,i)),f}},M.defaults=z,M.defer=At,M.delay=function(n,t){var r=ge.call(arguments,2);return re(function(){n.apply(e,r)},t)},M.difference=wt,M.filter=vt,M.flatten=jt,M.forEach=yt,M.forIn=D,M.forOwn=q,M.functions=tt,M.groupBy=function(n,t,e){var r={};
|
||||
return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),(ne.call(r,e)?r[e]:r[e]=[]).push(n)}),r},M.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Y(n,0,pe(le(0,a-r),a))},M.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>xt(f,c)){o&&f.push(c);
|
||||
for(var v=e;--v;)if(!(r[v]||(r[v]=U(t[v])))(c))continue n;i.push(c)}}return i},M.invert=et,M.invoke=function(n,t){var e=ge.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Rt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},M.keys=me,M.map=ht,M.max=mt,M.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);return ne.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},M.merge=ct,M.min=function(n,t,e){var r=1/0,u=r;
|
||||
if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},M.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=M.createCallback(t,e);else var a=Xt.apply(Gt,ge.call(arguments,1));return D(n,function(n,e,o){(r?!t(n,e,o):0>xt(a,e))&&(u[e]=n)}),u},M.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},M.pairs=function(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;){var a=e[t];
|
||||
u[t]=[a,n[a]]}return u},M.partial=function(n){return H(n,ge.call(arguments,1))},M.partialRight=function(n){return H(n,ge.call(arguments,1),u,l)},M.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Xt.apply(Gt,ge.call(arguments,1)),o=ot(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=M.createCallback(t,e),D(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},M.pluck=bt,M.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=le(0,Qt((t-n)/e));for(var a=Rt(t);++r<t;)a[r]=n,n+=e;
|
||||
return a},M.reject=function(n,t,e){return t=M.createCallback(t,e),vt(n,function(n,e,r){return!t(n,e,r)})},M.rest=Ot,M.shuffle=function(n){var t=-1,e=n?n.length:0,r=Rt(typeof e=="number"?e:0);return yt(n,function(n){var e=Yt(ve()*(++t+1));r[t]=r[e],r[e]=n}),r},M.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Rt(typeof u=="number"?u:0);for(t=M.createCallback(t,e),yt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(G);u--;)a[u]=a[u].c;return a},M.tap=function(n,t){return t(n),n},M.throttle=function(n,t,e){function o(){p=new qt,l=u,v&&(f=n.apply(c,i))
|
||||
}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&F[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new qt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=re(o,r)):(Wt(l),l=u,p=e,f=n.apply(c,i)),f}},M.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Rt(n);for(t=M.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},M.toArray=function(n){return n&&typeof n.length=="number"?Y(n):lt(n)},M.union=function(n){return rt(n)||(arguments[0]=n?ge.call(n):Gt),Et(Xt.apply(Gt,arguments))
|
||||
},M.uniq=Et,M.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?mt(bt(n,"length")):0,u=Rt(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=Rt(e)))[t]=o[a];return u},M.values=lt,M.where=vt,M.without=function(n){return wt(n,ge.call(arguments,1))},M.wrap=function(n,t){return function(){var e=[n];return te.apply(e,arguments),t.apply(this,e)}},M.zip=function(n){for(var t=-1,e=n?mt(bt(arguments,"length")):0,r=Rt(e);++t<e;)r[t]=bt(arguments,t);return r},M.zipObject=It,M.collect=ht,M.drop=Ot,M.each=yt,M.extend=P,M.methods=tt,M.object=It,M.select=vt,M.tail=Ot,M.unique=Et,Bt(M),M.clone=nt,M.cloneDeep=function(n,t,e){return nt(n,r,t,e)
|
||||
},M.contains=pt,M.escape=function(n){return n==u?"":Ut(n).replace(w,L)},M.every=st,M.find=gt,M.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=M.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},M.findKey=function(n,t,e){var r;return t=M.createCallback(t,e),q(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},M.has=function(n,t){return n?ne.call(n,t):a},M.identity=$t,M.indexOf=xt,M.isArguments=function(n){return ue.call(n)==x},M.isArray=rt,M.isBoolean=function(n){return n===r||n===a||ue.call(n)==N
|
||||
},M.isDate=function(n){return n instanceof qt||ue.call(n)==E},M.isElement=function(n){return n?1===n.nodeType:a},M.isEmpty=function(n){var t=r;if(!n)return t;var e=ue.call(n),u=n.length;return e==O||e==$||e==x||e==S&&typeof u=="number"&&at(n.splice)?!u:(q(n,function(){return t=a}),t)},M.isEqual=ut,M.isFinite=function(n){return ie(n)&&!fe(parseFloat(n))},M.isFunction=at,M.isNaN=function(n){return it(n)&&n!=+n},M.isNull=function(n){return n===u},M.isNumber=it,M.isObject=ot,M.isPlainObject=f,M.isRegExp=function(n){return n instanceof Mt||ue.call(n)==A
|
||||
},M.isString=ft,M.isUndefined=function(n){return typeof n=="undefined"},M.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?le(0,r+e):pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},M.mixin=Bt,M.noConflict=function(){return o._=Jt,this},M.parseInt=Tt,M.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Yt(ve()*((+t||0)-n+1))},M.reduce=dt,M.reduceRight=_t,M.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},M.runInContext=t,M.size=function(n){var t=n?n.length:0;
|
||||
return typeof t=="number"?t:me(n).length},M.some=kt,M.sortedIndex=Nt,M.template=function(n,t,u){var a=M.templateSettings;n||(n=""),u=z({},u,a);var o,i=z({},u.imports,a.imports),a=me(i),i=lt(i),f=0,c=u.interpolate||k,l="__p+='",c=Mt((u.escape||k).source+"|"+c.source+"|"+(c===d?m:k).source+"|"+(u.evaluate||k).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,J),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t
|
||||
}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var p=Dt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},M.unescape=function(n){return n==u?"":Ut(n).replace(h,Z)},M.uniqueId=function(n){var t=++c;return Ut(n==u?"":n)+t
|
||||
},M.all=st,M.any=kt,M.detect=gt,M.foldl=dt,M.foldr=_t,M.include=pt,M.inject=dt,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(){var t=[this.__wrapped__];return te.apply(t,arguments),n.apply(M,t)})}),M.first=Ct,M.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Y(n,le(0,a-r))}},M.take=Ct,M.head=Ct,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
|
||||
return t==u||e&&typeof t!="function"?r:new Q(r)})}),M.VERSION="1.2.0",M.prototype.toString=function(){return Ut(this.__wrapped__)},M.prototype.value=Ft,M.prototype.valueOf=Ft,yt(["join","pop","shift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),yt(["push","reverse","sort","unshift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Gt[n];M.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments))
|
||||
}}),M}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=/^0+(?=.$)/,k=/($^)/,w=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,j="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),x="[object Arguments]",O="[object Array]",N="[object Boolean]",E="[object Date]",I="[object Number]",S="[object Object]",A="[object RegExp]",$="[object String]",B={"[object Function]":a};
|
||||
B[x]=B[O]=B[N]=B[E]=B[I]=B[S]=B[A]=B[$]=r;var F={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},R={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},T=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=T,define(function(){return T})):o&&!o.nodeType?i?(i.exports=T)._=T:o._=T:n._=T})(this);
|
||||
;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!ae(n)&&Ut.call(n,"__wrapped__")?n:new z(n)}function $(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=$t(n[e]);(Ut.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=$t(e);return Ut.call(a,r)&&-1<gt(a[r],e)}return-1<gt(n,e,t)}}function q(n){return n.charCodeAt(0)}function B(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
|
||||
}return e<r?-1:1}function F(n,t,e,r){function u(){var r=arguments,c=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=M(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(P.prototype=n.prototype,c=new P,P.prototype=null,r=n.apply(c,r),W(r)?r:c):n.apply(c,r)}var a=Q(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new qt;t=n}return u}function R(){for(var n,t={b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!oe},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];return n=t.a,t.d=/^[^,]+/.exec(n)[0],e=Nt,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b&&(r+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.f+"}}else{"),t.i&&t.j?r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];"+t.f+"}":(r+="for(i in m){",t.i&&(r+="if(",t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",t.i&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Ut,V,ae,Y,oe,a,I)
|
||||
}function T(n){return"\\"+S[n]}function D(n){return ie[n]}function z(n){this.__wrapped__=n}function P(){}function K(n){var t=!1;if(!n||Jt.call(n)!=x)return t;var e=n.constructor;return(Q(e)?e instanceof e:ue.nodeClass||!isNode(n))?(pe(n,function(n,e){t=e}),!1===t||Ut.call(n,t)):t}function M(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Ct(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function U(n){return fe[n]}function V(n){return Jt.call(n)==_}function G(n,t,r,u,o,i){var f=n;
|
||||
if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=W(f)){var c=Jt.call(f);if(!E[c])return f;var l=ae(f)}if(!u||!t)return u?l?M(f):ce({},f):f;switch(u=re[c],c){case w:case j:return new u(+f);case C:case N:return new u(f);case O:return u(f.source,v.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(Ut.call(n,"index")&&(f.index=n.index),Ut.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?at:se)(n,function(n,u){f[u]=G(n,t,r,e,o,i)
|
||||
}),f}function H(n){var t=[];return pe(n,function(n,e){Q(n)&&t.push(e)}),t.sort()}function J(n){for(var t=-1,e=oe(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function L(n,t,e,r,u,o){var f=e===i;if(e&&!f){e=typeof r=="undefined"?e:a.createCallback(e,r,2);var c=e(n,t);if(typeof c!="undefined")return!!c}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Jt.call(n),l=Jt.call(t),p==_&&(p=x),l==_&&(l=x),p!=l)return!1;
|
||||
switch(p){case w:case j:return+n==+t;case C:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case O:case N:return n==$t(t)}if(l=p==k,!l){if(Ut.call(n,"__wrapped__")||Ut.call(t,"__wrapped__"))return L(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(p!=x)return!1;var p=n.constructor,s=t.constructor;if(p!=s&&(!Q(p)||!(p instanceof p&&Q(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,c=!0;if(u.push(n),o.push(t),l){if(p=n.length,v=t.length,c=v==n.length,!c&&!f)return c;
|
||||
for(;v--;)if(l=p,s=t[v],f)for(;l--&&!(c=L(n[l],s,e,r,u,o)););else if(!(c=L(n[v],s,e,r,u,o)))break;return c}return pe(t,function(t,a,i){return Ut.call(i,a)?(v++,c=Ut.call(n,a)&&L(n[a],t,e,r,u,o)):void 0}),c&&!f&&pe(n,function(n,t,e){return Ut.call(e,t)?c=-1<--v:void 0}),c}function Q(n){return typeof n=="function"}function W(n){return n?I[typeof n]:!1}function X(n){return typeof n=="number"||Jt.call(n)==C}function Y(n){return typeof n=="string"||Jt.call(n)==N}function Z(n,t,e){var r=arguments,u=0,o=2;
|
||||
if(!W(n))return n;if(e===i)var f=r[3],c=r[4],l=r[5];else c=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);for(;++u<o;)(ae(r[u])?at:se)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=ae(t))||ve(t))){for(a=c.length;a--;)if(r=c[a]==t){o=l[a];break}r||(o=u?ae(o)?o:[]:ve(o)?o:{},f&&(a=f(o,t),typeof a!="undefined"&&(o=a)),c.push(t),l.push(o),f||(o=Z(o,t,i,f,c,l)))}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);
|
||||
n[e]=o});return n}function nt(n){for(var t=-1,e=oe(n),r=e.length,u=Ct(r);++t<r;)u[t]=n[e[t]];return u}function tt(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?Zt(0,u+e):e)||0,typeof u=="number"?a=-1<(Y(n)?n.indexOf(t,e):gt(n,t,e)):se(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function et(n,t,e){var r=!0;t=a.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else se(n,function(n,e,u){return r=!!t(n,e,u)});return r}function rt(n,t,e){var r=[];
|
||||
t=a.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else se(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ut(n,t,e){t=a.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return se(n,function(n,e,r){return t(n,e,r)?(u=n,!1):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function at(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:a.createCallback(t,e),typeof u=="number")for(;++r<u&&!1!==t(n[r],r,n););else se(n,t);
|
||||
return n}function ot(n,t,e){var r=-1,u=n?n.length:0;if(t=a.createCallback(t,e),typeof u=="number")for(var o=Ct(u);++r<u;)o[r]=t(n[r],r,n);else o=[],se(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function it(n,t,e){var r=-1/0,u=r;if(!t&&ae(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&Y(n)?q:a.createCallback(t,e),at(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function ft(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Ct(r);++e<r;)u[e]=n[e][t];return u||ot(n,t)
|
||||
}function ct(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=a.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else se(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function lt(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=oe(n),u=i.length;return t=a.createCallback(t,r,4),at(n,function(r,a,f){a=i?i[--u]:--u,e=o?(o=!1,n[a]):t(e,n[a],a,f)}),e}function pt(n,t,e){var r;t=a.createCallback(t,e),e=-1;var u=n?n.length:0;
|
||||
if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else se(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function st(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return M(n,0,ne(Zt(0,r),u))}}function vt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),ae(r)?Vt.apply(i,t?r:vt(r)):i.push(r);
|
||||
return i}function gt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?Zt(0,u+e):e||0)-1;else if(e)return r=yt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function ht(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Zt(0,t);return M(n,r)}function yt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):kt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function mt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],f=i;
|
||||
typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(null!=e&&(f=[],e=a.createCallback(e,r));++u<o;){r=n[u];var p=e?e(r,u,n):r;if(c)var s=$t(p),s=Ut.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>gt(f,p))&&((e||c)&&f.push(p),i.push(r))}return i}function bt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function dt(n,t){return ue.fastBind||Lt&&2<arguments.length?Lt.call.apply(Lt,arguments):F(n,t,M(arguments,2))}function _t(n){var t=M(arguments,1);
|
||||
return Ht(function(){n.apply(e,t)},1)}function kt(n){return n}function wt(n){at(H(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Vt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new z(t)}})}function jt(){return this.__wrapped__}r=r?A.defaults(n.Object(),r,A.pick(n,d)):n;var Ct=r.Array,xt=r.Boolean,Ot=r.Date,Nt=r.Function,Et=r.Math,It=r.Number,St=r.Object,At=r.RegExp,$t=r.String,qt=r.TypeError,Bt=Ct(),Ft=St(),Rt=r._,Tt=At("^"+$t(Ft.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Dt=Et.ceil,zt=r.clearTimeout,Pt=Bt.concat,Kt=Et.floor,Mt=Tt.test(Mt=St.getPrototypeOf)&&Mt,Ut=Ft.hasOwnProperty,Vt=Bt.push,Gt=r.setImmediate,Ht=r.setTimeout,Jt=Ft.toString,Lt=Tt.test(Lt=M.bind)&&Lt,Qt=Tt.test(Qt=Ct.isArray)&&Qt,Wt=r.isFinite,Xt=r.isNaN,Yt=Tt.test(Yt=St.keys)&&Yt,Zt=Et.max,ne=Et.min,te=r.parseInt,ee=Et.random,Et=Tt.test(r.attachEvent),Et=Lt&&!/\n|true/.test(Lt+Et),re={};
|
||||
re[k]=Ct,re[w]=xt,re[j]=Ot,re[x]=St,re[C]=It,re[O]=At,re[N]=$t;var ue=a.support={};ue.fastBind=Lt&&!Et,a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}},xt={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},It={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:!1,f:"if(d(m[i],i,e)===false)return u"},St={h:"if(!r[typeof m])return u;"+It.h,b:!1},z.prototype=a.prototype;
|
||||
var ae=Qt||function(n){return n instanceof Ct||Jt.call(n)==k},Qt=R({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),oe=Yt?function(n){return W(n)?Yt(n):[]}:Qt,ie={"&":"&","<":"<",">":">",'"':""","'":"'"},fe=J(ie),ce=R(xt,{h:xt.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),le=R(xt),pe=R(It,St,{i:!1}),se=R(It,St),ve=function(n){if(!n||Jt.call(n)!=x)return!1;
|
||||
var t=n.valueOf,e=typeof t=="function"&&(e=Mt(t))&&Mt(e);return e?n==e||Mt(n)==e:K(n)};return Et&&u&&typeof Gt=="function"&&(_t=dt(Gt,r)),Gt=8==te("08")?te:function(n,t){return te(Y(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=ce,a.at=function(n){for(var t=-1,e=Pt.apply(Bt,M(arguments,1)),r=e.length,u=Ct(r);++t<r;)u[t]=n[e[t]];return u},a.bind=dt,a.bindAll=function(n){for(var t=Pt.apply(Bt,arguments),e=1<t.length?0:(t=H(n),-1),r=t.length;++e<r;){var u=t[e];
|
||||
n[u]=dt(n[u],n)}return n},a.bindKey=function(n,t){return F(n,t,M(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),at(n,function(n,e,u){e=$t(t(n,e,u)),Ut.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return kt;var r=typeof n;
|
||||
if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=oe(n);return function(t){for(var e=u.length,r=!1;e--&&(r=L(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=e&&!i;return u=arguments,o=this,zt(i),i=Ht(r,t),f&&(a=n.apply(o,u)),a
|
||||
}},a.defaults=le,a.defer=_t,a.delay=function(n,t){var r=M(arguments,2);return Ht(function(){n.apply(e,r)},t)},a.difference=function(n){for(var t=-1,e=n?n.length:0,r=Pt.apply(Bt,arguments),r=$(r,e,100),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.filter=rt,a.flatten=vt,a.forEach=at,a.forIn=pe,a.forOwn=se,a.functions=H,a.groupBy=function(n,t,e){var r={};return t=a.createCallback(t,e),at(n,function(n,e,u){e=$t(t(n,e,u)),(Ut.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];
|
||||
var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return M(n,0,ne(Zt(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=100<=a,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=$t(c),l=Ut.call(r[0],l)?!(f=r[0][l]):f=r[0][l]=[];if(l||0>gt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=$(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=J,a.invoke=function(n,t){var e=M(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Ct(typeof a=="number"?a:0);
|
||||
return at(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=oe,a.map=ot,a.max=it,a.memoize=function(n,t){var e={};return function(){var r=$t(t?t.apply(this,arguments):arguments[0]);return Ut.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=Z,a.min=function(n,t,e){var r=1/0,u=r;if(!t&&ae(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&Y(n)?q:a.createCallback(t,e),at(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};
|
||||
if(r)t=a.createCallback(t,e);else var o=Pt.apply(Bt,arguments);return pe(n,function(n,e,a){(r?!t(n,e,a):0>gt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=oe(n),r=e.length,u=Ct(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},a.partial=function(n){return F(n,M(arguments,1))},a.partialRight=function(n){return F(n,M(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=0,o=Pt.apply(Bt,arguments),i=W(n)?o.length:0;++u<i;){var f=o[u];
|
||||
f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),pe(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=ft,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=Zt(0,Dt((t-n)/e));for(var u=Ct(t);++r<t;)u[r]=n,n+=e;return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),rt(n,function(n,e,r){return!t(n,e,r)})},a.rest=ht,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=Ct(typeof e=="number"?e:0);return at(n,function(n){var e=Kt(ee()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Ct(typeof u=="number"?u:0);
|
||||
for(t=a.createCallback(t,e),at(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(B);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t){function e(){i=new Ot,o=null,u=n.apply(a,r)}var r,u,a,o,i=0;return function(){var f=new Ot,c=t-(f-i);return r=arguments,a=this,0<c?o||(o=Ht(e,c)):(zt(o),o=null,i=f,u=n.apply(a,r)),u}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ct(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?M(n):nt(n)
|
||||
},a.union=function(){return mt(Pt.apply(Bt,arguments))},a.uniq=mt,a.values=nt,a.where=rt,a.without=function(n){for(var t=-1,e=n?n.length:0,r=$(arguments,1,30),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.wrap=function(n,t){return function(){var e=[n];return Vt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?it(ft(arguments,"length")):0,r=Ct(e);++t<e;)r[t]=ft(arguments,t);return r},a.zipObject=bt,a.collect=ot,a.drop=ht,a.each=at,a.extend=ce,a.methods=H,a.object=bt,a.select=rt,a.tail=ht,a.unique=mt,wt(a),a.clone=G,a.cloneDeep=function(n,t,e){return G(n,!0,t,e)
|
||||
},a.contains=tt,a.escape=function(n){return null==n?"":$t(n).replace(m,D)},a.every=et,a.find=ut,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),se(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Ut.call(n,t):!1},a.identity=kt,a.indexOf=gt,a.isArguments=V,a.isArray=ae,a.isBoolean=function(n){return!0===n||!1===n||Jt.call(n)==w},a.isDate=function(n){return n instanceof Ot||Jt.call(n)==j
|
||||
},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var e=Jt.call(n),r=n.length;return e==k||e==N||e==_||e==x&&typeof r=="number"&&Q(n.splice)?!r:(se(n,function(){return t=!1}),t)},a.isEqual=L,a.isFinite=function(n){return Wt(n)&&!Xt(parseFloat(n))},a.isFunction=Q,a.isNaN=function(n){return X(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=X,a.isObject=W,a.isPlainObject=ve,a.isRegExp=function(n){return n instanceof At||Jt.call(n)==O},a.isString=Y,a.isUndefined=function(n){return typeof n=="undefined"
|
||||
},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Zt(0,r+e):ne(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=wt,a.noConflict=function(){return r._=Rt,this},a.parseInt=Gt,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Kt(ee()*((+t||0)-n+1))},a.reduce=ct,a.reduceRight=lt,a.result=function(n,t){var r=n?n[t]:e;return Q(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:oe(n).length
|
||||
},a.some=pt,a.sortedIndex=yt,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=le({},r,u);var o,i=le({},r.imports,u.imports),u=oe(i),i=nt(i),p=0,v=r.interpolate||y,h="__p+='",v=At((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(b,T),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}";
|
||||
try{var m=Nt(u,"return "+h).apply(e,i)}catch(d){throw d.source=h,d}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":$t(n).replace(p,U)},a.uniqueId=function(n){var t=++o;return $t(null==n?"":n)+t},a.all=et,a.any=pt,a.detect=ut,a.foldl=ct,a.foldr=lt,a.include=tt,a.inject=ct,se(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Vt.apply(t,arguments),n.apply(a,t)})}),a.first=st,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;
|
||||
for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return M(n,Zt(0,u-r))}},a.take=st,a.head=st,se(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new z(r)})}),a.VERSION="1.1.1",a.prototype.toString=function(){return $t(this.__wrapped__)},a.prototype.value=jt,a.prototype.valueOf=jt,at(["join","pop","shift"],function(n){var t=Bt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||
}}),at(["push","reverse","sort","unshift"],function(n){var t=Bt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),at(["concat","slice","splice"],function(n){var t=Bt[n];a.prototype[n]=function(){return new z(t.apply(this.__wrapped__,arguments))}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,b=/['\n\r\t\u2028\u2029\\]/g,d="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="[object Arguments]",k="[object Array]",w="[object Boolean]",j="[object Date]",C="[object Number]",x="[object Object]",O="[object RegExp]",N="[object String]",E={"[object Function]":!1};
|
||||
E[_]=E[k]=E[w]=E[j]=E[C]=E[x]=E[O]=E[N]=!0;var I={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},S={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},A=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=A,define(function(){return A})):r&&!r.nodeType?u?(u.exports=A)._=A:r._=A:n._=A})(this);
|
||||
279
dist/lodash.underscore.js
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/>
|
||||
* Lo-Dash 1.1.1 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
|
||||
@@ -18,9 +18,9 @@
|
||||
/** Detect free variable `module` */
|
||||
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
@@ -30,12 +30,6 @@
|
||||
/** Used internally to indicate various things */
|
||||
var indicatorObject = {};
|
||||
|
||||
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
||||
var keyPrefix = +new Date + '';
|
||||
|
||||
/** Used as the size when optimizations are enabled for large arrays */
|
||||
var largeArraySize = 200;
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
@@ -124,18 +118,18 @@
|
||||
hasOwnProperty = objectRef.hasOwnProperty,
|
||||
push = arrayRef.push,
|
||||
setTimeout = window.setTimeout,
|
||||
slice = arrayRef.slice,
|
||||
toString = objectRef.toString;
|
||||
|
||||
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
||||
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
|
||||
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
||||
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
||||
nativeIsFinite = window.isFinite,
|
||||
nativeIsNaN = window.isNaN,
|
||||
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
|
||||
nativeMax = Math.max,
|
||||
nativeMin = Math.min,
|
||||
nativeRandom = Math.random,
|
||||
nativeSlice = arrayRef.slice;
|
||||
nativeRandom = Math.random;
|
||||
|
||||
/** Detect various environments */
|
||||
var isIeOpera = reNative.test(window.attachEvent),
|
||||
@@ -144,7 +138,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a `lodash` object, which wraps the given `value`, to enable method
|
||||
* Creates a `lodash` object, that wraps the given `value`, to enable method
|
||||
* chaining.
|
||||
*
|
||||
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
|
||||
@@ -162,8 +156,8 @@
|
||||
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
||||
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
|
||||
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
|
||||
* `values`, `where`, `without`, `wrap`, and `zip`
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`,
|
||||
* `where`, `without`, `wrap`, and `zip`
|
||||
*
|
||||
* The non-chainable wrapper functions are:
|
||||
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
|
||||
@@ -182,26 +176,6 @@
|
||||
* @category Chaining
|
||||
* @param {Mixed} value The value to wrap in a `lodash` instance.
|
||||
* @returns {Object} Returns a `lodash` instance.
|
||||
* @example
|
||||
*
|
||||
* var wrapped = _([1, 2, 3]);
|
||||
*
|
||||
* // returns an unwrapped value
|
||||
* wrapped.reduce(function(sum, num) {
|
||||
* return sum + num;
|
||||
* });
|
||||
* // => 6
|
||||
*
|
||||
* // returns a wrapped value
|
||||
* var squares = wrapped.map(function(num) {
|
||||
* return num * num;
|
||||
* });
|
||||
*
|
||||
* _.isArray(squares);
|
||||
* // => false
|
||||
*
|
||||
* _.isArray(squares.value());
|
||||
* // => true
|
||||
*/
|
||||
function lodash(value) {
|
||||
return (value instanceof lodash)
|
||||
@@ -222,12 +196,12 @@
|
||||
var object = { '0': 1, 'length': 1 };
|
||||
|
||||
/**
|
||||
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
|
||||
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type Boolean
|
||||
*/
|
||||
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
|
||||
support.argsObject = arguments.constructor == Object;
|
||||
|
||||
/**
|
||||
* Detect if `Function#bind` exists and is inferred to be fast (all but V8).
|
||||
@@ -380,7 +354,7 @@
|
||||
}
|
||||
if (partialArgs.length) {
|
||||
args = args.length
|
||||
? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
? (args = slice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
: partialArgs;
|
||||
}
|
||||
if (this instanceof bound) {
|
||||
@@ -484,7 +458,29 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` which produces an array of the
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
||||
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
||||
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
|
||||
};
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` that produces an array of the
|
||||
* given object's own enumerable property names.
|
||||
*
|
||||
* @private
|
||||
@@ -635,7 +631,7 @@
|
||||
*/
|
||||
function clone(value) {
|
||||
return isObject(value)
|
||||
? (isArray(value) ? nativeSlice.call(value) : assign({}, value))
|
||||
? (isArray(value) ? slice.call(value) : assign({}, value))
|
||||
: value;
|
||||
}
|
||||
|
||||
@@ -820,26 +816,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
return toString.call(value) == arrayClass;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if `value` is a boolean value.
|
||||
*
|
||||
@@ -871,7 +847,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function isDate(value) {
|
||||
return toString.call(value) == dateClass;
|
||||
return value instanceof Date || toString.call(value) == dateClass;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1116,7 +1092,7 @@
|
||||
// fallback for older versions of Chrome and Safari
|
||||
if (isFunction(/x/)) {
|
||||
isFunction = function(value) {
|
||||
return toString.call(value) == funcClass;
|
||||
return value instanceof Function || toString.call(value) == funcClass;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1230,7 +1206,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function isRegExp(value) {
|
||||
return toString.call(value) == regexpClass;
|
||||
return value instanceof RegExp || toString.call(value) == regexpClass;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1294,11 +1270,11 @@
|
||||
* // => { 'name': 'moe' }
|
||||
*/
|
||||
function omit(object) {
|
||||
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
var props = concat.apply(arrayRef, arguments),
|
||||
result = {};
|
||||
|
||||
forIn(object, function(value, key) {
|
||||
if (indexOf(props, key) < 0) {
|
||||
if (indexOf(props, key, 1) < 0) {
|
||||
result[key] = value;
|
||||
}
|
||||
});
|
||||
@@ -1358,8 +1334,8 @@
|
||||
* // => { 'name': 'moe' }
|
||||
*/
|
||||
function pick(object) {
|
||||
var index = -1,
|
||||
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
var index = 0,
|
||||
props = concat.apply(arrayRef, arguments),
|
||||
length = props.length,
|
||||
result = {};
|
||||
|
||||
@@ -1633,9 +1609,7 @@
|
||||
* @returns {Mixed} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.find([1, 2, 3, 4], function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; });
|
||||
* // => 2
|
||||
*
|
||||
* var food = [
|
||||
@@ -1677,29 +1651,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Examines each element in a `collection`, returning the first that
|
||||
* has the given `properties`. When checking `properties`, this method
|
||||
* performs a deep comparison between values to determine if they are
|
||||
* equivalent to each other.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
* @returns {Mixed} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* var food = [
|
||||
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
* { 'name': 'banana', 'organic': true, 'type': 'fruit' },
|
||||
* { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
||||
* ];
|
||||
*
|
||||
* _.findWhere(food, { 'type': 'vegetable' });
|
||||
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
|
||||
*/
|
||||
function findWhere(object, properties) {
|
||||
return where(object, properties, true);
|
||||
}
|
||||
@@ -1810,7 +1761,7 @@
|
||||
* // => [['1', '2', '3'], ['4', '5', '6']]
|
||||
*/
|
||||
function invoke(collection, methodName) {
|
||||
var args = nativeSlice.call(arguments, 2),
|
||||
var args = slice.call(arguments, 2),
|
||||
index = -1,
|
||||
isFunc = typeof methodName == 'function',
|
||||
length = collection ? collection.length : 0,
|
||||
@@ -2048,7 +1999,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces a `collection` to a value which is the accumulated result of running
|
||||
* Reduces a `collection` to a value that is the accumulated result of running
|
||||
* each element in the `collection` through the `callback`, where each successive
|
||||
* `callback` execution consumes the return value of the previous execution.
|
||||
* If `accumulator` is not passed, the first element of the `collection` will be
|
||||
@@ -2373,7 +2324,7 @@
|
||||
*/
|
||||
function toArray(collection) {
|
||||
if (isArray(collection)) {
|
||||
return nativeSlice.call(collection);
|
||||
return slice.call(collection);
|
||||
}
|
||||
if (collection && typeof collection.length == 'number') {
|
||||
return map(collection);
|
||||
@@ -2459,12 +2410,12 @@
|
||||
function difference(array) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
flattened = concat.apply(arrayRef, arguments),
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (indexOf(flattened, value) < 0) {
|
||||
if (indexOf(flattened, value, length) < 0) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
@@ -2545,7 +2496,7 @@
|
||||
return array[0];
|
||||
}
|
||||
}
|
||||
return nativeSlice.call(array, 0, nativeMin(nativeMax(0, n), length));
|
||||
return slice.call(array, 0, nativeMin(nativeMax(0, n), length));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2566,7 +2517,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {Array} array The array to compact.
|
||||
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -2720,7 +2671,7 @@
|
||||
} else {
|
||||
n = (callback == null || thisArg) ? 1 : callback || n;
|
||||
}
|
||||
return nativeSlice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
|
||||
return slice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2835,7 +2786,7 @@
|
||||
return array[length - 1];
|
||||
}
|
||||
}
|
||||
return nativeSlice.call(array, nativeMax(0, length - n));
|
||||
return slice.call(array, nativeMax(0, length - n));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2992,7 +2943,7 @@
|
||||
} else {
|
||||
n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);
|
||||
}
|
||||
return nativeSlice.call(array, n);
|
||||
return slice.call(array, n);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3012,7 +2963,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Mixed} value The value to evaluate.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -3075,10 +3026,7 @@
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
*/
|
||||
function union(array) {
|
||||
if (!isArray(array)) {
|
||||
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
|
||||
}
|
||||
function union() {
|
||||
return uniq(concat.apply(arrayRef, arguments));
|
||||
}
|
||||
|
||||
@@ -3173,7 +3121,17 @@
|
||||
* // => [2, 3, 4]
|
||||
*/
|
||||
function without(array) {
|
||||
return difference(array, nativeSlice.call(arguments, 1));
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3299,7 +3257,7 @@
|
||||
// (in V8 `Function#bind` is slower except when partially applied)
|
||||
return support.fastBind || (nativeBind && arguments.length > 2)
|
||||
? nativeBind.call.apply(nativeBind, arguments)
|
||||
: createBound(func, thisArg, nativeSlice.call(arguments, 2));
|
||||
: createBound(func, thisArg, slice.call(arguments, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3326,8 +3284,8 @@
|
||||
* // => alerts 'clicked docs', when the button is clicked
|
||||
*/
|
||||
function bindAll(object) {
|
||||
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
|
||||
index = -1,
|
||||
var funcs = concat.apply(arrayRef, arguments),
|
||||
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),
|
||||
length = funcs.length;
|
||||
|
||||
while (++index < length) {
|
||||
@@ -3464,18 +3422,17 @@
|
||||
/**
|
||||
* Creates a function that will delay the execution of `func` until after
|
||||
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
|
||||
* an `options` object to indicate that `func` should be invoked on the leading
|
||||
* and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
|
||||
* function will return the result of the last `func` call.
|
||||
* `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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to debounce.
|
||||
* @param {Number} wait The number of milliseconds to delay.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=false] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @param {Boolean} immediate A flag to indicate execution is on the leading
|
||||
* edge of the timeout.
|
||||
* @returns {Function} Returns the new debounced function.
|
||||
* @example
|
||||
*
|
||||
@@ -3525,7 +3482,7 @@
|
||||
* // returns from the function before `alert` is called
|
||||
*/
|
||||
function defer(func) {
|
||||
var args = nativeSlice.call(arguments, 1);
|
||||
var args = slice.call(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
|
||||
@@ -3547,7 +3504,7 @@
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
var args = nativeSlice.call(arguments, 2);
|
||||
var args = slice.call(arguments, 2);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
||||
}
|
||||
|
||||
@@ -3573,7 +3530,7 @@
|
||||
function memoize(func, resolver) {
|
||||
var cache = {};
|
||||
return function() {
|
||||
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
return hasOwnProperty.call(cache, key)
|
||||
? cache[key]
|
||||
: (cache[key] = func.apply(this, arguments));
|
||||
@@ -3633,26 +3590,21 @@
|
||||
* // => 'hi moe'
|
||||
*/
|
||||
function partial(func) {
|
||||
return createBound(func, nativeSlice.call(arguments, 1));
|
||||
return createBound(func, slice.call(arguments, 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. Pass an `options` object to indicate
|
||||
* that `func` should be invoked on the leading and/or trailing edge of the
|
||||
* `wait` 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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to throttle.
|
||||
* @param {Number} wait The number of milliseconds to throttle executions to.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @returns {Function} Returns the new throttled function.
|
||||
* @example
|
||||
*
|
||||
@@ -3884,6 +3836,9 @@
|
||||
* 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 using precompiled templates, or loading Lo-Dash in a sandbox.
|
||||
*
|
||||
* For more information on precompiling templates see:
|
||||
* http://lodash.com/#custom-builds
|
||||
*
|
||||
@@ -3894,7 +3849,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {String} text The template text.
|
||||
* @param {Object} data The data object used to populate the text.
|
||||
* @param {Obect} data The data object used to populate the text.
|
||||
* @param {Object} options The options object.
|
||||
* escape - The "escape" delimiter regexp.
|
||||
* evaluate - The "evaluate" delimiter regexp.
|
||||
@@ -4043,7 +3998,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.escape`, this method converts the HTML entities
|
||||
* The opposite of `_.escape`, this method converts the HTML entities
|
||||
* `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding characters.
|
||||
*
|
||||
@@ -4325,7 +4280,7 @@
|
||||
* @memberOf _
|
||||
* @type String
|
||||
*/
|
||||
lodash.VERSION = '1.2.0';
|
||||
lodash.VERSION = '1.1.1';
|
||||
|
||||
// add functions to `lodash.prototype`
|
||||
mixin(lodash);
|
||||
@@ -4334,36 +4289,36 @@
|
||||
lodash.prototype.chain = wrapperChain;
|
||||
lodash.prototype.value = wrapperValueOf;
|
||||
|
||||
// add `Array` mutator functions to the wrapper
|
||||
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__;
|
||||
func.apply(value, arguments);
|
||||
// add `Array` mutator functions to the wrapper
|
||||
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__;
|
||||
func.apply(value, arguments);
|
||||
|
||||
// avoid array-like object bugs with `Array#shift` and `Array#splice`
|
||||
// in Firefox < 10 and IE < 9
|
||||
if (!support.spliceObjects && value.length === 0) {
|
||||
delete value[0];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
});
|
||||
// avoid array-like object bugs with `Array#shift` and `Array#splice`
|
||||
// in Firefox < 10 and IE < 9
|
||||
if (!support.spliceObjects && value.length === 0) {
|
||||
delete value[0];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
});
|
||||
|
||||
// add `Array` accessor functions to the wrapper
|
||||
forEach(['concat', 'join', 'slice'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__,
|
||||
result = func.apply(value, arguments);
|
||||
// add `Array` accessor functions to the wrapper
|
||||
forEach(['concat', 'join', 'slice'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__,
|
||||
result = func.apply(value, arguments);
|
||||
|
||||
if (this.__chain__) {
|
||||
result = new lodashWrapper(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
if (this.__chain__) {
|
||||
result = new lodashWrapper(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
58
dist/lodash.underscore.min.js
vendored
@@ -1,34 +1,34 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license
|
||||
* Lo-Dash 1.1.1 (Custom Build) lodash.com/license
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n){function r(n){return n instanceof r?n:new i(n)}function t(n,r){var t=n.b,e=r.b;if(n=n.a,r=r.a,n!==r){if(n>r||typeof n=="undefined")return 1;if(n<r||typeof r=="undefined")return-1}return t<e?-1:1}function e(n,r,t,e){function u(){var e=arguments,c=i?this:r;return o||(n=r[f]),t.length&&(e=e.length?(e=Br.call(e),l?e.concat(t):t.concat(e)):t),this instanceof u?(a.prototype=n.prototype,c=new a,a.prototype=null,e=n.apply(c,e),m(e)?e:c):n.apply(c,e)}var o=y(n),i=!t,f=r;if(i){var l=e;t=r}else if(!o){if(!e)throw new TypeError;
|
||||
r=n}return u}function u(n){return"\\"+lr[n]}function o(n){return Rr[n]}function i(n){this.__wrapped__=n}function a(){}function f(n){return Dr[n]}function l(n){return dr.call(n)==nr}function c(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function p(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)null==n[u]&&(n[u]=e[u])}return n}function s(n){var r=[];return Mr(n,function(n,t){y(n)&&r.push(t)
|
||||
}),r.sort()}function v(n){for(var r=-1,t=Fr(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function g(n){if(!n)return!0;if($r(n)||b(n))return!n.length;for(var r in n)if(mr.call(n,r))return!1;return!0}function h(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return!1;if(null==n||null==t)return n===t;if(i=dr.call(n),o=dr.call(t),i!=o)return!1;switch(i){case tr:case er:return+n==+t;case ur:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;
|
||||
case ir:case ar:return n==t+""}if(o=i==rr,!o){if(n instanceof r||t instanceof r)return h(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=or)return!1;var i=n.constructor,a=t.constructor;if(i!=a&&(!y(i)||!(i instanceof i&&y(a)&&a instanceof a)))return!1}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=!0,l=0;if(e.push(n),u.push(t),o){if(l=t.length,f=l==n.length)for(;l--&&(f=h(n[l],t[l],e,u)););return f}return Mr(t,function(r,t,o){return mr.call(o,t)?(l++,!(f=mr.call(n,t)&&h(n[t],r,e,u))&&K):void 0
|
||||
}),f&&Mr(n,function(n,r,t){return mr.call(t,r)?!(f=-1<--l)&&K:void 0}),f}function y(n){return typeof n=="function"}function m(n){return n?fr[typeof n]:!1}function _(n){return typeof n=="number"||dr.call(n)==ur}function b(n){return typeof n=="string"||dr.call(n)==ar}function d(n){for(var r=-1,t=Fr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function j(n,r){var t=!1;return typeof(n?n.length:0)=="number"?t=-1<T(n,r):Tr(n,function(n){return(t=n===r)&&K}),t}function w(n,r,t){var e=!0;r=P(r,t),t=-1;
|
||||
var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Tr(n,function(n,t,u){return!(e=!!r(n,t,u))&&K});return e}function A(n,r,t){var e=[];r=P(r,t),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Tr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function x(n,r,t){r=P(r,t),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Tr(n,function(n,t,e){return r(n,t,e)?(u=n,K):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o
|
||||
}}function O(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:P(r,t),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==K;);else Tr(n,r)}function E(n,r,t){var e=-1,u=n?n.length:0;if(r=P(r,t),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Tr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function S(n,r,t){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=P(r,t),O(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});else for(;++o<i;)t=n[o],t>u&&(u=t);return u}function N(n,r){var t=-1,e=n?n.length:0;
|
||||
if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||E(n,r)}function B(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=P(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Tr(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function k(n,r,t,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Fr(n),u=i.length;return r=P(r,e,4),O(n,function(e,a,f){a=i?i[--u]:--u,t=o?(o=!1,n[a]):r(t,n[a],a,f)}),t}function q(n,r,t){var e;
|
||||
r=P(r,t),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Tr(n,function(n,t,u){return(e=r(n,t,u))&&K});return!!e}function F(n,r,t){return t&&g(r)?null:(t?x:A)(n,r)}function R(n){for(var r=-1,t=n.length,e=hr.apply(cr,Br.call(arguments,1)),u=[];++r<t;){var o=n[r];0>T(e,o)&&u.push(o)}return u}function D(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&null!=r){var o=-1;for(r=P(r,t);++o<u&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n[0];return Br.call(n,0,Sr(Er(0,e),u))
|
||||
}}function M(n,r){for(var t=-1,e=n?n.length:0,u=[];++t<e;){var o=n[t];$r(o)?_r.apply(u,r?o:M(o)):u.push(o)}return u}function T(n,r,t){var e=-1,u=n?n.length:0;if(typeof t=="number")e=(0>t?Er(0,u+t):t||0)-1;else if(t)return e=I(n,r),n[e]===r?e:-1;for(;++e<u;)if(n[e]===r)return e;return-1}function $(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=P(r,t);++u<o&&r(n[u],u,n);)e++}else e=null==r||t?1:Er(0,r);return Br.call(n,e)}function I(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?P(t,e,1):U,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;
|
||||
return u}function z(n,r,t,e){var u=-1,o=n?n.length:0,i=[],a=i;for(typeof r!="boolean"&&null!=r&&(e=t,t=r,r=!1),null!=t&&(a=[],t=P(t,e));++u<o;){e=n[u];var f=t?t(e,u,n):e;(r?!u||a[a.length-1]!==f:0>T(a,f))&&(t&&a.push(f),i.push(e))}return i}function C(n,r){return qr.fastBind||jr&&2<arguments.length?jr.call.apply(jr,arguments):e(n,r,Br.call(arguments,2))}function P(n,r,t){if(null==n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(r){return r[n]};var u=Fr(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e
|
||||
}}return typeof r!="undefined"?1===t?function(t){return n.call(r,t)}:2===t?function(t,e){return n.call(r,t,e)}:4===t?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function U(n){return n}function V(n){O(s(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return _r.apply(n,arguments),n=e.apply(r,n),this.__chain__&&(n=new i(n),n.__chain__=!0),n}})}var W=typeof exports=="object"&&exports,G=typeof module=="object"&&module&&module.exports==W&&module,H=typeof global=="object"&&global;
|
||||
(H.global===H||H.window===H)&&(n=H);var J=0,K={},L=+new Date+"",Q=/&(?:amp|lt|gt|quot|#39);/g,X=/($^)/,Y=/[&<>"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,nr="[object Arguments]",rr="[object Array]",tr="[object Boolean]",er="[object Date]",ur="[object Number]",or="[object Object]",ir="[object RegExp]",ar="[object String]",fr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lr={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},cr=[],H={},pr=n._,sr=RegExp("^"+(H.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),vr=Math.ceil,gr=n.clearTimeout,hr=cr.concat,yr=Math.floor,mr=H.hasOwnProperty,_r=cr.push,br=n.setTimeout,dr=H.toString,jr=sr.test(jr=dr.bind)&&jr,wr=sr.test(wr=Array.isArray)&&wr,Ar=n.isFinite,xr=n.isNaN,Or=sr.test(Or=Object.keys)&&Or,Er=Math.max,Sr=Math.min,Nr=Math.random,Br=cr.slice,H=sr.test(n.attachEvent),kr=jr&&!/\n|true/.test(jr+H),qr={};
|
||||
(function(){var n={0:1,length:1};qr.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),qr.fastBind=jr&&!kr,qr.spliceObjects=(cr.splice.call(n,0,1),!n[0])})(1),r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},i.prototype=r.prototype,l(arguments)||(l=function(n){return n?mr.call(n,"callee"):!1});var H=function(n){var r,t=[];if(!n||!fr[typeof n])return t;for(r in n)mr.call(n,r)&&t.push(r);return t},Fr=Or?function(n){return m(n)?Or(n):[]
|
||||
}:H,Rr={"&":"&","<":"<",">":">",'"':""","'":"'"},Dr=v(Rr),Mr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(r(n[t],t,n)===K)break;return n},Tr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(mr.call(n,t)&&r(n[t],t,n)===K)break;return n},$r=wr||function(n){return dr.call(n)==rr};y(/x/)&&(y=function(n){return"[object Function]"==dr.call(n)}),r.after=function(n,r){return 1>n?r():function(){return 1>--n?r.apply(this,arguments):void 0}},r.bind=C,r.bindAll=function(n){for(var r=1<arguments.length?hr.apply(cr,Br.call(arguments,1)):s(n),t=-1,e=r.length;++t<e;){var u=r[t];
|
||||
n[u]=C(n[u],n)}return n},r.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},r.countBy=function(n,r,t){var e={};return r=P(r,t),O(n,function(n,t,u){t=r(n,t,u)+"",mr.call(e,t)?e[t]++:e[t]=1}),e},r.debounce=function(n,r,t){function e(){a=null,t||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=t&&!a;return u=arguments,i=this,gr(a),a=br(e,r),f&&(o=n.apply(i,u)),o
|
||||
}},r.defaults=p,r.defer=function(n){var r=Br.call(arguments,1);return br(function(){n.apply(void 0,r)},1)},r.delay=function(n,r){var t=Br.call(arguments,2);return br(function(){n.apply(void 0,t)},r)},r.difference=R,r.filter=A,r.flatten=M,r.forEach=O,r.functions=s,r.groupBy=function(n,r,t){var e={};return r=P(r,t),O(n,function(n,t,u){t=r(n,t,u)+"",(mr.call(e,t)?e[t]:e[t]=[]).push(n)}),e},r.initial=function(n,r,t){if(!n)return[];var e=0,u=n.length;if(typeof r!="number"&&null!=r){var o=u;for(r=P(r,t);o--&&r(n[o],o,n);)e++
|
||||
}else e=null==r||t?1:r||e;return Br.call(n,0,Sr(Er(0,u-e),u))},r.intersection=function(n){var r=arguments,t=r.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>T(o,i)){for(var a=t;--a;)if(0>T(r[a],i))continue n;o.push(i)}}return o},r.invert=v,r.invoke=function(n,r){var t=Br.call(arguments,2),e=-1,u=typeof r=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return O(n,function(n){i[++e]=(u?r:n[r]).apply(n,t)}),i},r.keys=Fr,r.map=E,r.max=S,r.memoize=function(n,r){var t={};return function(){var e=L+(r?r.apply(this,arguments):arguments[0]);
|
||||
return mr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},r.min=function(n,r,t){var e=1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=P(r,t),O(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});else for(;++o<i;)t=n[o],t<u&&(u=t);return u},r.omit=function(n){var r=hr.apply(cr,Br.call(arguments,1)),t={};return Mr(n,function(n,e){0>T(r,e)&&(t[e]=n)}),t},r.once=function(n){var r,t;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},r.pairs=function(n){for(var r=-1,t=Fr(n),e=t.length,u=Array(e);++r<e;){var o=t[r];
|
||||
u[r]=[o,n[o]]}return u},r.partial=function(n){return e(n,Br.call(arguments,1))},r.pick=function(n){for(var r=-1,t=hr.apply(cr,Br.call(arguments,1)),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},r.pluck=N,r.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Er(0,vr((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},r.reject=function(n,r,t){return r=P(r,t),A(n,function(n,t,e){return!r(n,t,e)})},r.rest=$,r.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);
|
||||
return O(n,function(n){var t=yr(Nr()*(++r+1));e[r]=e[t],e[t]=n}),e},r.sortBy=function(n,r,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(r=P(r,e),O(n,function(n,t,e){i[++u]={a:r(n,t,e),b:u,c:n}}),o=i.length,i.sort(t);o--;)i[o]=i[o].c;return i},r.tap=function(n,r){return r(n),n},r.throttle=function(n,r){function t(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,l=r-(f-a);return e=arguments,o=this,0<l?i||(i=br(t,l)):(gr(i),i=null,a=f,u=n.apply(o,e)),u
|
||||
}},r.times=function(n,r,t){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=r.call(t,e);return u},r.toArray=function(n){return $r(n)?Br.call(n):n&&typeof n.length=="number"?E(n):d(n)},r.union=function(n){return $r(n)||(arguments[0]=n?Br.call(n):cr),z(hr.apply(cr,arguments))},r.uniq=z,r.values=d,r.where=F,r.without=function(n){return R(n,Br.call(arguments,1))},r.wrap=function(n,r){return function(){var t=[n];return _r.apply(t,arguments),r.apply(this,t)}},r.zip=function(n){for(var r=-1,t=n?S(N(arguments,"length")):0,e=Array(t);++r<t;)e[r]=N(arguments,r);
|
||||
return e},r.collect=E,r.drop=$,r.each=O,r.extend=c,r.methods=s,r.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var o=n[t];r?u[o]=r[t]:u[o[0]]=o[1]}return u},r.select=A,r.tail=$,r.unique=z,r.clone=function(n){return m(n)?$r(n)?Br.call(n):c({},n):n},r.contains=j,r.escape=function(n){return null==n?"":(n+"").replace(Y,o)},r.every=w,r.find=x,r.findWhere=function(n,r){return F(n,r,!0)},r.has=function(n,r){return n?mr.call(n,r):!1},r.identity=U,r.indexOf=T,r.isArguments=l,r.isArray=$r,r.isBoolean=function(n){return!0===n||!1===n||dr.call(n)==tr
|
||||
},r.isDate=function(n){return dr.call(n)==er},r.isElement=function(n){return n?1===n.nodeType:!1},r.isEmpty=g,r.isEqual=h,r.isFinite=function(n){return Ar(n)&&!xr(parseFloat(n))},r.isFunction=y,r.isNaN=function(n){return _(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=_,r.isObject=m,r.isRegExp=function(n){return dr.call(n)==ir},r.isString=b,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Er(0,e+t):Sr(t,e-1))+1);e--;)if(n[e]===r)return e;
|
||||
return-1},r.mixin=V,r.noConflict=function(){return n._=pr,this},r.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r&&(r=n,n=0),n+yr(Nr()*((+r||0)-n+1))},r.reduce=B,r.reduceRight=k,r.result=function(n,r){var t=n?n[r]:null;return y(t)?n[r]():t},r.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Fr(n).length},r.some=q,r.sortedIndex=I,r.template=function(n,t,e){n||(n=""),e=p({},e,r.templateSettings);var o=0,i="__p+='",a=e.variable;n.replace(RegExp((e.escape||X).source+"|"+(e.interpolate||X).source+"|"+(e.evaluate||X).source+"|$","g"),function(r,t,e,a,f){return i+=n.slice(o,f).replace(Z,u),t&&(i+="'+_['escape']("+t+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+r.length,r
|
||||
}),i+="';\n",a||(a="obj",i="with("+a+"||{}){"+i+"}"),i="function("+a+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(r)}catch(l){throw l.source=i,l}return t?f(t):(f.source=i,f)},r.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},r.uniqueId=function(n){var r=++J+"";return n?n+r:r},r.all=w,r.any=q,r.detect=x,r.foldl=B,r.foldr=k,r.include=j,r.inject=B,r.first=D,r.last=function(n,r,t){if(n){var e=0,u=n.length;
|
||||
if(typeof r!="number"&&null!=r){var o=u;for(r=P(r,t);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n[u-1];return Br.call(n,Er(0,u-e))}},r.take=D,r.head=D,r.chain=function(n){return n=new i(n),n.__chain__=!0,n},r.VERSION="1.2.0",V(r),r.prototype.chain=function(){return this.__chain__=!0,this},r.prototype.value=function(){return this.__wrapped__},O("pop push reverse shift sort splice unshift".split(" "),function(n){var t=cr[n];r.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!qr.spliceObjects&&0===n.length&&delete n[0],this
|
||||
}}),O(["concat","join","slice"],function(n){var t=cr[n];r.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):W&&!W.nodeType?G?(G.exports=r)._=r:W._=r:n._=r})(this);
|
||||
;(function(n){function t(n,t){var r;if(n&&st[typeof n])for(r in n)if(jt.call(n,r)&&t(n[r],r,n)===Z)break}function r(n,t){var r;if(n&&st[typeof n])for(r in n)if(t(n[r],r,n)===Z)break}function e(n){var t,r=[];if(!n||!st[typeof n])return r;for(t in n)jt.call(n,t)&&r.push(t);return r}function u(n){return n instanceof u?n:new c(n)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function i(n,t,r){function e(){var f=arguments,c=o?this:t;
|
||||
return u||(n=t[i]),r.length&&(f=f.length?(f=xt.call(f),a?f.concat(r):r.concat(f)):r),this instanceof e?(l.prototype=n.prototype,c=new l,l.prototype=J,f=n.apply(c,f),d(f)?f:c):n.apply(c,f)}var u=b(n),o=!r,i=t;if(o){var a=void 0;r=t}else if(!u)throw new TypeError;return e}function a(n){return"\\"+vt[n]}function f(n){return It[n]}function c(n){this.__wrapped__=n}function l(){}function p(n){return zt[n]}function s(n){return Ot.call(n)==ut}function v(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];
|
||||
if(e)for(var u in e)n[u]=e[u]}return n}function g(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==J&&(n[u]=e[u])}return n}function h(n){var t=[];return r(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function y(n){for(var t=-1,r=$t(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function m(n){if(!n)return H;if(Tt(n)||w(n))return!n.length;for(var t in n)if(jt.call(n,t))return K;return H}function _(n,t,e,o){if(n===t)return 0!==n||1/n==1/t;
|
||||
var i=typeof n,a=typeof t;if(n===n&&(!n||"function"!=i&&"object"!=i)&&(!t||"function"!=a&&"object"!=a))return K;if(n==J||t==J)return n===t;if(a=Ot.call(n),i=Ot.call(t),a!=i)return K;switch(a){case it:case at:return+n==+t;case ft:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case lt:case pt:return n==t+""}if(i=a==ot,!i){if(n instanceof u||t instanceof u)return _(n.__wrapped__||n,t.__wrapped__||t,e,o);if(a!=ct)return K;var a=n.constructor,f=t.constructor;if(a!=f&&(!b(a)||!(a instanceof a&&b(f)&&f instanceof f)))return K
|
||||
}for(e||(e=[]),o||(o=[]),a=e.length;a--;)if(e[a]==n)return o[a]==t;var c=H,l=0;if(e.push(n),o.push(t),i){if(l=t.length,c=l==n.length)for(;l--&&(c=_(n[l],t[l],e,o)););return c}return r(t,function(t,r,u){return jt.call(u,r)?(l++,!(c=jt.call(n,r)&&_(n[r],t,e,o))&&Z):void 0}),c&&r(n,function(n,t,r){return jt.call(r,t)?!(c=-1<--l)&&Z:void 0}),c}function b(n){return typeof n=="function"}function d(n){return n?st[typeof n]:K}function j(n){return typeof n=="number"||Ot.call(n)==ft}function w(n){return typeof n=="string"||Ot.call(n)==pt
|
||||
}function A(n){for(var t=-1,r=$t(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function x(n,r){var e=K;return typeof(n?n.length:0)=="number"?e=-1<I(n,r):t(n,function(n){return(e=n===r)&&Z}),e}function O(n,r,e){var u=H;r=V(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&Z});return u}function E(n,r,e){var u=[];r=V(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o;){var i=n[e];r(i,e,n)&&u.push(i)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)
|
||||
});return u}function S(n,r,e){r=V(r,e),e=-1;var u=n?n.length:0;if(typeof u!="number"){var o;return t(n,function(n,t,e){return r(n,t,e)?(o=n,Z):void 0}),o}for(;++e<u;){var i=n[e];if(r(i,e,n))return i}}function N(n,r,e){var u=-1,o=n?n.length:0;if(r=r&&typeof e=="undefined"?r:V(r,e),typeof o=="number")for(;++u<o&&r(n[u],u,n)!==Z;);else t(n,r)}function k(n,r,e){var u=-1,o=n?n.length:0;if(r=V(r,e),typeof o=="number")for(var i=Array(o);++u<o;)i[u]=r(n[u],u,n);else i=[],t(n,function(n,t,e){i[++u]=r(n,t,e)
|
||||
});return i}function B(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=V(t,r),N(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function F(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||k(n,t)}function R(n,r,e,u){if(!n)return e;var o=3>arguments.length;r=V(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++i<a;)e=r(e,n[i],i,n);else t(n,function(n,t,u){e=o?(o=K,n):r(e,n,t,u)
|
||||
});return e}function q(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=$t(n),u=i.length;return t=V(t,e,4),N(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=K,n[a]):t(r,n[a],a,f)}),r}function D(n,r,e){var u;r=V(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&Z});return!!u}function M(n,t,r){return r&&m(t)?J:(r?S:E)(n,t)}function T(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=J){var o=-1;
|
||||
for(t=V(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==J||r)return n[0];return xt.call(n,0,Rt(Ft(0,e),u))}}function $(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Tt(o)?wt.apply(u,t?o:$(o)):u.push(o)}return u}function I(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ft(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function z(n,t,r){if(typeof t!="number"&&t!=J){var e=0,u=-1,o=n?n.length:0;for(t=V(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==J||r?1:Ft(0,t);
|
||||
return xt.call(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?V(r,e,1):W,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function P(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;for(typeof t!="boolean"&&t!=J&&(e=r,r=t,t=K),r!=J&&(a=[],r=V(r,e));++u<o;){e=n[u];var f=r?r(e,u,n):e;(t?!u||a[a.length-1]!==f:0>I(a,f))&&(r&&a.push(f),i.push(e))}return i}function U(n,t){return Mt.fastBind||Et&&2<arguments.length?Et.call.apply(Et,arguments):i(n,t,xt.call(arguments,2))}function V(n,t,r){if(n==J)return W;
|
||||
var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=$t(n);return function(t){for(var r=u.length,e=K;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function W(n){return n}function G(n){N(h(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return wt.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new c(n),n.__chain__=H),n
|
||||
}})}var H=!0,J=null,K=!1,L=typeof exports=="object"&&exports,Q=typeof module=="object"&&module&&module.exports==L&&module,X=typeof global=="object"&&global;X.global===X&&(n=X);var Y=0,Z={},nt=/&(?:amp|lt|gt|quot|#39);/g,tt=/($^)/,rt=/[&<>"']/g,et=/['\n\r\t\u2028\u2029\\]/g,ut="[object Arguments]",ot="[object Array]",it="[object Boolean]",at="[object Date]",ft="[object Number]",ct="[object Object]",lt="[object RegExp]",pt="[object String]",st={"boolean":K,"function":H,object:H,number:K,string:K,undefined:K},vt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},gt=[],X={},ht=n._,yt=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),mt=Math.ceil,_t=n.clearTimeout,bt=gt.concat,dt=Math.floor,jt=X.hasOwnProperty,wt=gt.push,At=n.setTimeout,xt=gt.slice,Ot=X.toString,Et=yt.test(Et=xt.bind)&&Et,St=yt.test(St=Array.isArray)&&St,Nt=n.isFinite,kt=n.isNaN,Bt=yt.test(Bt=Object.keys)&&Bt,Ft=Math.max,Rt=Math.min,qt=Math.random,X=yt.test(n.attachEvent),Dt=Et&&!/\n|true/.test(Et+X),Mt={};
|
||||
(function(){var n={0:1,length:1};Mt.argsObject=arguments.constructor==Object,Mt.fastBind=Et&&!Dt,Mt.spliceObjects=(gt.splice.call(n,0,1),!n[0])})(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},c.prototype=u.prototype,s(arguments)||(s=function(n){return n?jt.call(n,"callee"):K});var Tt=St||function(n){return Mt.argsObject&&n instanceof Array||Ot.call(n)==ot},$t=Bt?function(n){return d(n)?Bt(n):[]}:e,It={"&":"&","<":"<",">":">",'"':""","'":"'"},zt=y(It);
|
||||
b(/x/)&&(b=function(n){return n instanceof Function||"[object Function]"==Ot.call(n)}),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},u.bind=U,u.bindAll=function(n){for(var t=bt.apply(gt,arguments),r=1<t.length?0:(t=h(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];
|
||||
return t[0]}},u.countBy=function(n,t,r){var e={};return t=V(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",jt.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=J,r||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,_t(a),a=At(e,t),f&&(o=n.apply(i,u)),o}},u.defaults=g,u.defer=function(n){var t=xt.call(arguments,1);return At(function(){n.apply(void 0,t)},1)},u.delay=function(n,t){var r=xt.call(arguments,2);return At(function(){n.apply(void 0,r)},t)},u.difference=function(n){for(var t=-1,r=n.length,e=bt.apply(gt,arguments),u=[];++t<r;){var o=n[t];
|
||||
0>I(e,o,r)&&u.push(o)}return u},u.filter=E,u.flatten=$,u.forEach=N,u.functions=h,u.groupBy=function(n,t,r){var e={};return t=V(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",(jt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},u.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=J){var o=u;for(t=V(t,r);o--&&t(n[o],o,n);)e++}else e=t==J||r?1:t||e;return xt.call(n,0,Rt(Ft(0,u-e),u))},u.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];
|
||||
if(0>I(o,i)){for(var a=r;--a;)if(0>I(t[a],i))continue n;o.push(i)}}return o},u.invert=y,u.invoke=function(n,t){var r=xt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},u.keys=$t,u.map=k,u.max=B,u.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return jt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},u.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;
|
||||
if(t||typeof i!="number")t=V(t,r),N(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},u.omit=function(n){var t=bt.apply(gt,arguments),e={};return r(n,function(n,r){0>I(t,r,1)&&(e[r]=n)}),e},u.once=function(n){var t,r;return function(){return t?r:(t=H,r=n.apply(this,arguments),n=J,r)}},u.pairs=function(n){for(var t=-1,r=$t(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},u.partial=function(n){return i(n,xt.call(arguments,1))},u.pick=function(n){for(var t=0,r=bt.apply(gt,arguments),e=r.length,u={};++t<e;){var o=r[t];
|
||||
o in n&&(u[o]=n[o])}return u},u.pluck=F,u.range=function(n,t,r){n=+n||0,r=+r||1,t==J&&(t=n,n=0);var e=-1;t=Ft(0,mt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},u.reject=function(n,t,r){return t=V(t,r),E(n,function(n,r,e){return!t(n,r,e)})},u.rest=z,u.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return N(n,function(n){var r=dt(qt()*(++t+1));e[t]=e[r],e[r]=n}),e},u.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=V(t,r),N(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}
|
||||
}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},u.tap=function(n,t){return t(n),n},u.throttle=function(n,t){function r(){a=new Date,i=J,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=At(r,c)):(_t(i),i=J,a=f,u=n.apply(o,e)),u}},u.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);return u},u.toArray=function(n){return Tt(n)?xt.call(n):n&&typeof n.length=="number"?k(n):A(n)},u.union=function(){return P(bt.apply(gt,arguments))
|
||||
},u.uniq=P,u.values=A,u.where=M,u.without=function(n){for(var t=-1,r=n.length,e=[];++t<r;){var u=n[t];0>I(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,t){return function(){var r=[n];return wt.apply(r,arguments),t.apply(this,r)}},u.zip=function(n){for(var t=-1,r=n?B(F(arguments,"length")):0,e=Array(r);++t<r;)e[t]=F(arguments,t);return e},u.collect=k,u.drop=z,u.each=N,u.extend=v,u.methods=h,u.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u
|
||||
},u.select=E,u.tail=z,u.unique=P,u.clone=function(n){return d(n)?Tt(n)?xt.call(n):v({},n):n},u.contains=x,u.escape=function(n){return n==J?"":(n+"").replace(rt,f)},u.every=O,u.find=S,u.findWhere=function(n,t){return M(n,t,H)},u.has=function(n,t){return n?jt.call(n,t):K},u.identity=W,u.indexOf=I,u.isArguments=s,u.isArray=Tt,u.isBoolean=function(n){return n===H||n===K||Ot.call(n)==it},u.isDate=function(n){return n instanceof Date||Ot.call(n)==at},u.isElement=function(n){return n?1===n.nodeType:K},u.isEmpty=m,u.isEqual=_,u.isFinite=function(n){return Nt(n)&&!kt(parseFloat(n))
|
||||
},u.isFunction=b,u.isNaN=function(n){return j(n)&&n!=+n},u.isNull=function(n){return n===J},u.isNumber=j,u.isObject=d,u.isRegExp=function(n){return n instanceof RegExp||Ot.call(n)==lt},u.isString=w,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ft(0,e+r):Rt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=G,u.noConflict=function(){return n._=ht,this},u.random=function(n,t){return n==J&&t==J&&(t=1),n=+n||0,t==J&&(t=n,n=0),n+dt(qt()*((+t||0)-n+1))
|
||||
},u.reduce=R,u.reduceRight=q,u.result=function(n,t){var r=n?n[t]:J;return b(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:$t(n).length},u.some=D,u.sortedIndex=C,u.template=function(n,t,r){n||(n=""),r=g({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||tt).source+"|"+(r.interpolate||tt).source+"|"+(r.evaluate||tt).source+"|$","g"),function(t,r,u,i,f){return o+=n.slice(e,f).replace(et,a),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=f+t.length,t
|
||||
}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var f=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?f(t):(f.source=o,f)},u.unescape=function(n){return n==J?"":(n+"").replace(nt,p)},u.uniqueId=function(n){var t=++Y+"";return n?n+t:t},u.all=O,u.any=D,u.detect=S,u.foldl=R,u.foldr=q,u.include=x,u.inject=R,u.first=T,u.last=function(n,t,r){if(n){var e=0,u=n.length;
|
||||
if(typeof t!="number"&&t!=J){var o=u;for(t=V(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==J||r)return n[u-1];return xt.call(n,Ft(0,u-e))}},u.take=T,u.head=T,u.chain=function(n){return n=new c(n),n.__chain__=H,n},u.VERSION="1.1.1",G(u),u.prototype.chain=function(){return this.__chain__=H,this},u.prototype.value=function(){return this.__wrapped__},N("pop push reverse shift sort splice unshift".split(" "),function(n){var t=gt[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Mt.spliceObjects&&0===n.length&&delete n[0],this
|
||||
}}),N(["concat","join","slice"],function(n){var t=gt[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=H),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=u,define(function(){return u})):L&&!L.nodeType?Q?(Q.exports=u)._=u:L._=u:n._=u})(this);
|
||||
350
doc/README.md
@@ -21,9 +21,9 @@
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <sup>v1.2.0</sup>',
|
||||
'title' => 'Lo-Dash <sup>v1.1.1</sup>',
|
||||
'toc' => 'categories',
|
||||
'url' => 'https://github.com/lodash/lodash/blob/1.2.0/lodash.js'
|
||||
'url' => 'https://github.com/lodash/lodash/blob/1.1.1/lodash.js'
|
||||
));
|
||||
|
||||
// save to a .md file
|
||||
|
||||
352
lodash.js
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.2.0 <http://lodash.com/>
|
||||
* Lo-Dash 1.1.1 <http://lodash.com/>
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
|
||||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
@@ -17,9 +17,9 @@
|
||||
/** Detect free variable `module` */
|
||||
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
@@ -29,12 +29,6 @@
|
||||
/** Used internally to indicate various things */
|
||||
var indicatorObject = {};
|
||||
|
||||
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
||||
var keyPrefix = +new Date + '';
|
||||
|
||||
/** Used as the size when optimizations are enabled for large arrays */
|
||||
var largeArraySize = 200;
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
@@ -180,7 +174,7 @@
|
||||
toString = objectRef.toString;
|
||||
|
||||
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
||||
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
|
||||
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
||||
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
||||
nativeIsFinite = context.isFinite,
|
||||
nativeIsNaN = context.isNaN,
|
||||
@@ -188,8 +182,7 @@
|
||||
nativeMax = Math.max,
|
||||
nativeMin = Math.min,
|
||||
nativeParseInt = context.parseInt,
|
||||
nativeRandom = Math.random,
|
||||
nativeSlice = arrayRef.slice;
|
||||
nativeRandom = Math.random;
|
||||
|
||||
/** Detect various environments */
|
||||
var isIeOpera = reNative.test(context.attachEvent),
|
||||
@@ -208,7 +201,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a `lodash` object, which wraps the given `value`, to enable method
|
||||
* Creates a `lodash` object, that wraps the given `value`, to enable method
|
||||
* chaining.
|
||||
*
|
||||
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
|
||||
@@ -226,8 +219,8 @@
|
||||
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
|
||||
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
|
||||
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
|
||||
* `values`, `where`, `without`, `wrap`, and `zip`
|
||||
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`,
|
||||
* `where`, `without`, `wrap`, and `zip`
|
||||
*
|
||||
* The non-chainable wrapper functions are:
|
||||
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
|
||||
@@ -246,26 +239,6 @@
|
||||
* @category Chaining
|
||||
* @param {Mixed} value The value to wrap in a `lodash` instance.
|
||||
* @returns {Object} Returns a `lodash` instance.
|
||||
* @example
|
||||
*
|
||||
* var wrapped = _([1, 2, 3]);
|
||||
*
|
||||
* // returns an unwrapped value
|
||||
* wrapped.reduce(function(sum, num) {
|
||||
* return sum + num;
|
||||
* });
|
||||
* // => 6
|
||||
*
|
||||
* // returns a wrapped value
|
||||
* var squares = wrapped.map(function(num) {
|
||||
* return num * num;
|
||||
* });
|
||||
*
|
||||
* _.isArray(squares);
|
||||
* // => false
|
||||
*
|
||||
* _.isArray(squares.value());
|
||||
* // => true
|
||||
*/
|
||||
function lodash(value) {
|
||||
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
|
||||
@@ -293,12 +266,12 @@
|
||||
for (prop in arguments) { }
|
||||
|
||||
/**
|
||||
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
|
||||
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type Boolean
|
||||
*/
|
||||
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
|
||||
support.argsObject = arguments.constructor == Object;
|
||||
|
||||
/**
|
||||
* Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
|
||||
@@ -464,7 +437,7 @@
|
||||
* The template used to create iterator functions.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} data The data object used to populate the text.
|
||||
* @param {Obect} data The data object used to populate the text.
|
||||
* @returns {String} Returns the interpolated text.
|
||||
*/
|
||||
var iteratorTemplate = template(
|
||||
@@ -600,27 +573,31 @@
|
||||
* @private
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Mixed} value The value to search for.
|
||||
* @param {Number} fromIndex The index to search from.
|
||||
* @param {Number} largeSize The length at which an array is considered large.
|
||||
* @returns {Boolean} Returns `true`, if `value` is found, else `false`.
|
||||
*/
|
||||
function cachedContains(array) {
|
||||
function cachedContains(array, fromIndex, largeSize) {
|
||||
var length = array.length,
|
||||
isLarge = length >= largeArraySize;
|
||||
isLarge = (length - fromIndex) >= largeSize;
|
||||
|
||||
if (isLarge) {
|
||||
var cache = {},
|
||||
index = -1;
|
||||
index = fromIndex - 1;
|
||||
|
||||
while (++index < length) {
|
||||
var key = keyPrefix + array[index];
|
||||
(cache[key] || (cache[key] = [])).push(array[index]);
|
||||
// manually coerce `value` to a string because `hasOwnProperty`, in some
|
||||
// older versions of Firefox, coerces objects incorrectly
|
||||
var key = String(array[index]);
|
||||
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
|
||||
}
|
||||
}
|
||||
return function(value) {
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + value;
|
||||
return cache[key] && indexOf(cache[key], value) > -1;
|
||||
var key = String(value);
|
||||
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
|
||||
}
|
||||
return indexOf(array, value) > -1;
|
||||
return indexOf(array, value, fromIndex) > -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -706,7 +683,7 @@
|
||||
}
|
||||
if (partialArgs.length) {
|
||||
args = args.length
|
||||
? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
|
||||
: partialArgs;
|
||||
}
|
||||
if (this instanceof bound) {
|
||||
@@ -732,7 +709,6 @@
|
||||
* @param {Object} [options1, options2, ...] The compile options object(s).
|
||||
* arrays - A string of code to determine if the iterable is an array or array-like.
|
||||
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
|
||||
* useKeys - A boolean to specify using `_.keys` for own property iteration.
|
||||
* args - A string of comma separated arguments the iteration function will accept.
|
||||
* top - A string of code to execute before the iteration branches.
|
||||
* loop - A string of code to execute in the object loop.
|
||||
@@ -836,7 +812,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* A fallback implementation of `isPlainObject` which checks if a given `value`
|
||||
* A fallback implementation of `isPlainObject` that checks if a given `value`
|
||||
* is an object created by the `Object` constructor, assuming objects created
|
||||
* by the `Object` constructor have no inherited enumerable properties and that
|
||||
* there are no `Object.prototype` extensions.
|
||||
@@ -944,7 +920,29 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` which produces an array of the
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
||||
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
||||
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
|
||||
};
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` that produces an array of the
|
||||
* given object's own enumerable property names.
|
||||
*
|
||||
* @private
|
||||
@@ -1265,7 +1263,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
* a "_.pluck" or "_.where" style callback, respectively.
|
||||
@@ -1273,16 +1271,14 @@
|
||||
* @returns {Mixed} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
|
||||
* // => 'b'
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
function findKey(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
forOwn(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
forOwn(collection, function(value, key, collection) {
|
||||
if (callback(value, key, collection)) {
|
||||
result = key;
|
||||
return false;
|
||||
}
|
||||
@@ -1416,29 +1412,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Mixed} value The value to check.
|
||||
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArray(arguments); })();
|
||||
* // => false
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*/
|
||||
function isArray(value) {
|
||||
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
|
||||
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
|
||||
return (support.argsObject && value instanceof Array) ||
|
||||
(nativeIsArray ? nativeIsArray(value) : toString.call(value) == arrayClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is a boolean value.
|
||||
*
|
||||
@@ -1573,8 +1546,11 @@
|
||||
function isEqual(a, b, callback, thisArg, stackA, stackB) {
|
||||
// used to indicate that when comparing objects, `a` has at least the properties of `b`
|
||||
var whereIndicator = callback === indicatorObject;
|
||||
if (typeof callback == 'function' && !whereIndicator) {
|
||||
callback = lodash.createCallback(callback, thisArg, 2);
|
||||
if (callback && !whereIndicator) {
|
||||
callback = (typeof thisArg == 'undefined')
|
||||
? callback
|
||||
: lodash.createCallback(callback, thisArg, 2);
|
||||
|
||||
var result = callback(a, b);
|
||||
if (typeof result != 'undefined') {
|
||||
return !!result;
|
||||
@@ -2060,24 +2036,22 @@
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
var isShallow;
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
|
||||
if (callback) {
|
||||
result = callback(value, source);
|
||||
if ((isShallow = typeof result != 'undefined')) {
|
||||
if (typeof result != 'undefined') {
|
||||
value = result;
|
||||
}
|
||||
}
|
||||
if (!isShallow) {
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
}
|
||||
// add `source` and associated `value` to the stack of traversed objects
|
||||
stackA.push(source);
|
||||
stackB.push(value);
|
||||
|
||||
// recursively merge objects and arrays (susceptible to call stack limits)
|
||||
if (!isShallow) {
|
||||
if (!callback) {
|
||||
value = merge(value, source, indicatorObject, callback, stackA, stackB);
|
||||
}
|
||||
}
|
||||
@@ -2132,12 +2106,12 @@
|
||||
if (isFunc) {
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
} else {
|
||||
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1));
|
||||
var props = concat.apply(arrayRef, arguments);
|
||||
}
|
||||
forIn(object, function(value, key, object) {
|
||||
if (isFunc
|
||||
? !callback(value, key, object)
|
||||
: indexOf(props, key) < 0
|
||||
: indexOf(props, key, 1) < 0
|
||||
) {
|
||||
result[key] = value;
|
||||
}
|
||||
@@ -2200,8 +2174,8 @@
|
||||
function pick(object, callback, thisArg) {
|
||||
var result = {};
|
||||
if (typeof callback != 'function') {
|
||||
var index = -1,
|
||||
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
var index = 0,
|
||||
props = concat.apply(arrayRef, arguments),
|
||||
length = isObject(object) ? props.length : 0;
|
||||
|
||||
while (++index < length) {
|
||||
@@ -2271,7 +2245,7 @@
|
||||
*/
|
||||
function at(collection) {
|
||||
var index = -1,
|
||||
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
props = concat.apply(arrayRef, slice(arguments, 1)),
|
||||
length = props.length,
|
||||
result = Array(length);
|
||||
|
||||
@@ -2526,9 +2500,7 @@
|
||||
* @returns {Mixed} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.find([1, 2, 3, 4], function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; });
|
||||
* // => 2
|
||||
*
|
||||
* var food = [
|
||||
@@ -2676,7 +2648,7 @@
|
||||
* // => [['1', '2', '3'], ['4', '5', '6']]
|
||||
*/
|
||||
function invoke(collection, methodName) {
|
||||
var args = nativeSlice.call(arguments, 2),
|
||||
var args = slice(arguments, 2),
|
||||
index = -1,
|
||||
isFunc = typeof methodName == 'function',
|
||||
length = collection ? collection.length : 0,
|
||||
@@ -2906,7 +2878,7 @@
|
||||
var pluck = map;
|
||||
|
||||
/**
|
||||
* Reduces a `collection` to a value which is the accumulated result of running
|
||||
* Reduces a `collection` to a value that is the accumulated result of running
|
||||
* each element in the `collection` through the `callback`, where each successive
|
||||
* `callback` execution consumes the return value of the previous execution.
|
||||
* If `accumulator` is not passed, the first element of the `collection` will be
|
||||
@@ -3313,8 +3285,8 @@
|
||||
function difference(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
|
||||
contains = cachedContains(flattened),
|
||||
flattened = concat.apply(arrayRef, arguments),
|
||||
contains = cachedContains(flattened, length, 100),
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
@@ -3333,7 +3305,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
* a "_.pluck" or "_.where" style callback, respectively.
|
||||
@@ -3341,18 +3313,16 @@
|
||||
* @returns {Mixed} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.findIndex(['apple', 'banana', 'beet'], function(food) {
|
||||
* return /^b/.test(food);
|
||||
* });
|
||||
* _.findIndex(['apple', 'banana', 'beet'], function(food) { return /^b/.test(food); });
|
||||
* // => 1
|
||||
*/
|
||||
function findIndex(array, callback, thisArg) {
|
||||
function findIndex(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
while (++index < length) {
|
||||
if (callback(array[index], index, array)) {
|
||||
if (callback(collection[index], index, collection)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
@@ -3454,7 +3424,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {Array} array The array to compact.
|
||||
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -3645,7 +3615,7 @@
|
||||
cache = { '0': {} },
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
isLarge = length >= largeArraySize,
|
||||
isLarge = length >= 100,
|
||||
result = [],
|
||||
seen = result;
|
||||
|
||||
@@ -3653,8 +3623,8 @@
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + value;
|
||||
var inited = cache[0][key]
|
||||
var key = String(value);
|
||||
var inited = hasOwnProperty.call(cache[0], key)
|
||||
? !(seen = cache[0][key])
|
||||
: (seen = cache[0][key] = []);
|
||||
}
|
||||
@@ -3664,7 +3634,7 @@
|
||||
}
|
||||
var argsIndex = argsLength;
|
||||
while (--argsIndex) {
|
||||
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex])))(value)) {
|
||||
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
@@ -3925,7 +3895,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Mixed} value The value to evaluate.
|
||||
* @param {Function|Object|String} [callback=identity] The function called per
|
||||
* iteration. If a property name or object is passed, it will be used to create
|
||||
@@ -3988,10 +3958,7 @@
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
*/
|
||||
function union(array) {
|
||||
if (!isArray(array)) {
|
||||
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
|
||||
}
|
||||
function union() {
|
||||
return uniq(concat.apply(arrayRef, arguments));
|
||||
}
|
||||
|
||||
@@ -4051,7 +4018,7 @@
|
||||
isSorted = false;
|
||||
}
|
||||
// init value cache for large arrays
|
||||
var isLarge = !isSorted && length >= largeArraySize;
|
||||
var isLarge = !isSorted && length >= 75;
|
||||
if (isLarge) {
|
||||
var cache = {};
|
||||
}
|
||||
@@ -4064,8 +4031,8 @@
|
||||
computed = callback ? callback(value, index, array) : value;
|
||||
|
||||
if (isLarge) {
|
||||
var key = keyPrefix + computed;
|
||||
var inited = cache[key]
|
||||
var key = String(computed);
|
||||
var inited = hasOwnProperty.call(cache, key)
|
||||
? !(seen = cache[key])
|
||||
: (seen = cache[key] = []);
|
||||
}
|
||||
@@ -4082,37 +4049,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.zip`, this method splits groups of elements into arrays
|
||||
* composed of elements from each group at their corresponding indexes.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to process.
|
||||
* @returns {Array} Returns a new array of the composed arrays.
|
||||
* @example
|
||||
*
|
||||
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
|
||||
* // => [['moe', 'larry'], [30, 40], [true, false]];
|
||||
*/
|
||||
function unzip(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
tupleLength = length ? max(pluck(array, 'length')) : 0,
|
||||
result = Array(tupleLength);
|
||||
|
||||
while (++index < length) {
|
||||
var tupleIndex = -1,
|
||||
tuple = array[index];
|
||||
|
||||
while (++tupleIndex < tupleLength) {
|
||||
(result[tupleIndex] || (result[tupleIndex] = Array(length)))[index] = tuple[tupleIndex];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array with all occurrences of the passed values removed using
|
||||
* strict equality for comparisons, i.e. `===`.
|
||||
@@ -4129,7 +4065,18 @@
|
||||
* // => [2, 3, 4]
|
||||
*/
|
||||
function without(array) {
|
||||
return difference(array, nativeSlice.call(arguments, 1));
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
contains = cachedContains(arguments, 1, 30),
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (!contains(value)) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4255,7 +4202,7 @@
|
||||
// (in V8 `Function#bind` is slower except when partially applied)
|
||||
return support.fastBind || (nativeBind && arguments.length > 2)
|
||||
? nativeBind.call.apply(nativeBind, arguments)
|
||||
: createBound(func, thisArg, nativeSlice.call(arguments, 2));
|
||||
: createBound(func, thisArg, slice(arguments, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4282,8 +4229,8 @@
|
||||
* // => alerts 'clicked docs', when the button is clicked
|
||||
*/
|
||||
function bindAll(object) {
|
||||
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
|
||||
index = -1,
|
||||
var funcs = concat.apply(arrayRef, arguments),
|
||||
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),
|
||||
length = funcs.length;
|
||||
|
||||
while (++index < length) {
|
||||
@@ -4328,7 +4275,7 @@
|
||||
* // => 'hi, moe!'
|
||||
*/
|
||||
function bindKey(object, key) {
|
||||
return createBound(object, key, nativeSlice.call(arguments, 2), indicatorObject);
|
||||
return createBound(object, key, slice(arguments, 2), indicatorObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4458,53 +4405,44 @@
|
||||
/**
|
||||
* Creates a function that will delay the execution of `func` until after
|
||||
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
|
||||
* an `options` object to indicate that `func` should be invoked on the leading
|
||||
* and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
|
||||
* function will return the result of the last `func` call.
|
||||
* `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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to debounce.
|
||||
* @param {Number} wait The number of milliseconds to delay.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=false] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @param {Boolean} immediate A flag to indicate execution is on the leading
|
||||
* edge of the timeout.
|
||||
* @returns {Function} Returns the new debounced function.
|
||||
* @example
|
||||
*
|
||||
* var lazyLayout = _.debounce(calculateLayout, 300);
|
||||
* jQuery(window).on('resize', lazyLayout);
|
||||
*/
|
||||
function debounce(func, wait, options) {
|
||||
function debounce(func, wait, immediate) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
timeoutId,
|
||||
trailing = true;
|
||||
timeoutId;
|
||||
|
||||
function delayed() {
|
||||
timeoutId = null;
|
||||
if (trailing) {
|
||||
if (!immediate) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
if (options === true) {
|
||||
var leading = true;
|
||||
trailing = false;
|
||||
} else if (options && objectTypes[typeof options]) {
|
||||
leading = options.leading;
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
}
|
||||
return function() {
|
||||
var isLeading = leading && !timeoutId;
|
||||
var isImmediate = immediate && !timeoutId;
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
|
||||
if (isLeading) {
|
||||
if (isImmediate) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
return result;
|
||||
@@ -4527,7 +4465,7 @@
|
||||
* // returns from the function before `alert` is called
|
||||
*/
|
||||
function defer(func) {
|
||||
var args = nativeSlice.call(arguments, 1);
|
||||
var args = slice(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
// use `setImmediate` if it's available in Node.js
|
||||
@@ -4553,7 +4491,7 @@
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
var args = nativeSlice.call(arguments, 2);
|
||||
var args = slice(arguments, 2);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
||||
}
|
||||
|
||||
@@ -4579,7 +4517,7 @@
|
||||
function memoize(func, resolver) {
|
||||
var cache = {};
|
||||
return function() {
|
||||
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
return hasOwnProperty.call(cache, key)
|
||||
? cache[key]
|
||||
: (cache[key] = func.apply(this, arguments));
|
||||
@@ -4639,7 +4577,7 @@
|
||||
* // => 'hi moe'
|
||||
*/
|
||||
function partial(func) {
|
||||
return createBound(func, nativeSlice.call(arguments, 1));
|
||||
return createBound(func, slice(arguments, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4670,61 +4608,43 @@
|
||||
* // => { '_': _, 'jq': $ }
|
||||
*/
|
||||
function partialRight(func) {
|
||||
return createBound(func, nativeSlice.call(arguments, 1), null, indicatorObject);
|
||||
return createBound(func, slice(arguments, 1), null, indicatorObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that, when executed, will only call the `func` function
|
||||
* at most once per every `wait` milliseconds. If the throttled function is
|
||||
* invoked more than once during the `wait` timeout, `func` will also be called
|
||||
* on the trailing edge of the timeout. Pass an `options` object to indicate
|
||||
* that `func` should be invoked on the leading and/or trailing edge of the
|
||||
* `wait` 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.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to throttle.
|
||||
* @param {Number} wait The number of milliseconds to throttle executions to.
|
||||
* @param {Object} options The options object.
|
||||
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
|
||||
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
|
||||
* @returns {Function} Returns the new throttled function.
|
||||
* @example
|
||||
*
|
||||
* var throttled = _.throttle(updatePosition, 100);
|
||||
* jQuery(window).on('scroll', throttled);
|
||||
*/
|
||||
function throttle(func, wait, options) {
|
||||
function throttle(func, wait) {
|
||||
var args,
|
||||
result,
|
||||
thisArg,
|
||||
timeoutId,
|
||||
lastCalled = 0,
|
||||
leading = true,
|
||||
trailing = true;
|
||||
lastCalled = 0;
|
||||
|
||||
function trailingCall() {
|
||||
lastCalled = new Date;
|
||||
timeoutId = null;
|
||||
|
||||
if (trailing) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
}
|
||||
if (options === false) {
|
||||
leading = false;
|
||||
} else if (options && objectTypes[typeof options]) {
|
||||
leading = 'leading' in options ? options.leading : leading;
|
||||
trailing = 'trailing' in options ? options.trailing : trailing;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
return function() {
|
||||
var now = new Date;
|
||||
if (!timeoutId && !leading) {
|
||||
lastCalled = now;
|
||||
}
|
||||
var remaining = wait - (now - lastCalled);
|
||||
var now = new Date,
|
||||
remaining = wait - (now - lastCalled);
|
||||
|
||||
args = arguments;
|
||||
thisArg = this;
|
||||
|
||||
@@ -4954,6 +4874,9 @@
|
||||
* 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 using precompiled templates, or loading Lo-Dash in a sandbox.
|
||||
*
|
||||
* For more information on precompiling templates see:
|
||||
* http://lodash.com/#custom-builds
|
||||
*
|
||||
@@ -4964,7 +4887,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {String} text The template text.
|
||||
* @param {Object} data The data object used to populate the text.
|
||||
* @param {Obect} data The data object used to populate the text.
|
||||
* @param {Object} options The options object.
|
||||
* escape - The "escape" delimiter regexp.
|
||||
* evaluate - The "evaluate" delimiter regexp.
|
||||
@@ -5164,7 +5087,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* The inverse of `_.escape`, this method converts the HTML entities
|
||||
* The opposite of `_.escape`, this method converts the HTML entities
|
||||
* `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding characters.
|
||||
*
|
||||
@@ -5317,7 +5240,6 @@
|
||||
lodash.toArray = toArray;
|
||||
lodash.union = union;
|
||||
lodash.uniq = uniq;
|
||||
lodash.unzip = unzip;
|
||||
lodash.values = values;
|
||||
lodash.where = where;
|
||||
lodash.without = without;
|
||||
@@ -5435,7 +5357,7 @@
|
||||
* @memberOf _
|
||||
* @type String
|
||||
*/
|
||||
lodash.VERSION = '1.2.0';
|
||||
lodash.VERSION = '1.1.1';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.toString = wrapperToString;
|
||||
|
||||
19
package.json
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "1.2.0",
|
||||
"version": "1.1.1",
|
||||
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
|
||||
"homepage": "http://lodash.com",
|
||||
"license": "MIT",
|
||||
"main": "./dist/lodash.js",
|
||||
"main": "./dist/lodash",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"client",
|
||||
@@ -14,6 +13,12 @@
|
||||
"speed",
|
||||
"util"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://lodash.com/license"
|
||||
}
|
||||
],
|
||||
"author": {
|
||||
"name": "John-David Dalton",
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
@@ -29,11 +34,19 @@
|
||||
"bin": {
|
||||
"lodash": "./build.js"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "./doc",
|
||||
"test": "./test"
|
||||
},
|
||||
"engines": [
|
||||
"node",
|
||||
"rhino"
|
||||
],
|
||||
"jam": {
|
||||
"main": "./lodash.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node ./build.js",
|
||||
"test": "node ./test/test.js ./dist/lodash.js && node ./test/test.js ./dist/lodash.min.js && node ./test/test-build.js"
|
||||
}
|
||||
}
|
||||
|
||||
106
perf/perf.js
@@ -182,31 +182,23 @@
|
||||
aHz = getHz(this[0]),
|
||||
bHz = getHz(this[1]);
|
||||
|
||||
for (var index = 0, length = this.length; index < length; index++) {
|
||||
var bench = this[index];
|
||||
if (bench.error) {
|
||||
var errored = true;
|
||||
log(bench.error);
|
||||
}
|
||||
if (fastest.length > 1) {
|
||||
log('It\'s too close to call.');
|
||||
aHz = bHz = slowestHz;
|
||||
}
|
||||
if (!errored) {
|
||||
if (fastest.length > 1) {
|
||||
log('It\'s too close to call.');
|
||||
aHz = bHz = slowestHz;
|
||||
}
|
||||
else {
|
||||
var percent = ((fastestHz / slowestHz) - 1) * 100;
|
||||
else {
|
||||
var percent = ((fastestHz / slowestHz) - 1) * 100;
|
||||
|
||||
log(
|
||||
fastest[0].name + ' is ' +
|
||||
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
|
||||
'% faster.'
|
||||
);
|
||||
}
|
||||
// add score adjusted for margin of error
|
||||
score.a += aHz;
|
||||
score.b += bHz;
|
||||
log(
|
||||
fastest[0].name + ' is ' +
|
||||
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
|
||||
'% faster.'
|
||||
);
|
||||
}
|
||||
// add score adjusted for margin of error
|
||||
score.a += aHz;
|
||||
score.b += bHz;
|
||||
|
||||
// remove current suite from queue
|
||||
suites.shift();
|
||||
|
||||
@@ -386,14 +378,12 @@
|
||||
fiftyValues2 = Array(50),\
|
||||
seventyFiveValues = Array(75),\
|
||||
seventyFiveValues2 = Array(75),\
|
||||
oneHundredValues = Array(100),\
|
||||
oneHundredValues2 = Array(100),\
|
||||
twoHundredValues = Array(200),\
|
||||
twoHundredValues2 = Array(200),\
|
||||
hundredValues = Array(100),\
|
||||
hundredValues2 = Array(100),\
|
||||
lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\
|
||||
upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\
|
||||
\
|
||||
for (index = 0; index < 200; index++) {\
|
||||
for (index = 0; index < 100; index++) {\
|
||||
if (index < 15) {\
|
||||
twentyValues[index] = lowerChars[index];\
|
||||
twentyValues2[index] = upperChars[index];\
|
||||
@@ -413,15 +403,13 @@
|
||||
fortyValues[index] =\
|
||||
fiftyValues[index] =\
|
||||
seventyFiveValues[index] =\
|
||||
oneHundredValues[index] =\
|
||||
twoHundredValues[index] = lowerChars[index];\
|
||||
hundredValues[index] = lowerChars[index];\
|
||||
\
|
||||
thirtyValues2[index] =\
|
||||
fortyValues2[index] =\
|
||||
fiftyValues2[index] =\
|
||||
seventyFiveValues2[index] =\
|
||||
oneHundredValues2[index] =\
|
||||
twoHundredValues2[index] = upperChars[index];\
|
||||
hundredValues2[index] = upperChars[index];\
|
||||
}\
|
||||
else {\
|
||||
if (index < 30) {\
|
||||
@@ -440,12 +428,8 @@
|
||||
seventyFiveValues[index] =\
|
||||
seventyFiveValues2[index] = index;\
|
||||
}\
|
||||
if (index < 100) {\
|
||||
oneHundredValues[index] =\
|
||||
oneHundredValues2[index] = index;\
|
||||
}\
|
||||
twoHundredValues[index] =\
|
||||
twoHundredValues2[index] = index;\
|
||||
hundredValues[index] =\
|
||||
hundredValues2[index] = index;\
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
@@ -503,10 +487,6 @@
|
||||
var _findWhere = _.findWhere || _.find,\
|
||||
lodashFindWhere = lodash.findWhere || lodash.find,\
|
||||
whereObject = { "num": 9 };\
|
||||
}\
|
||||
if (typeof zip != "undefined") {\
|
||||
var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]],\
|
||||
zipped = [["a", 1, true], ["b", 2, false], ["c", 3, true]];\
|
||||
}'
|
||||
});
|
||||
|
||||
@@ -754,13 +734,13 @@
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.difference` iterating 200 elements')
|
||||
Benchmark.Suite('`_.difference` iterating 100 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)',
|
||||
'fn': 'lodash.difference(hundredValues, hundredValues2)',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.difference(twoHundredValues, twoHundredValues2)',
|
||||
'fn': '_.difference(hundredValues, hundredValues2)',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
@@ -1063,13 +1043,13 @@
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.intersection` iterating 200 elements')
|
||||
Benchmark.Suite('`_.intersection` iterating 100 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.intersection(twoHundredValues, twoHundredValues2)',
|
||||
'fn': 'lodash.intersection(hundredValues, hundredValues2)',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.intersection(twoHundredValues, twoHundredValues2)',
|
||||
'fn': '_.intersection(hundredValues, hundredValues2)',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
@@ -1759,33 +1739,19 @@
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(oneHundredValues.concat(oneHundredValues2));',
|
||||
'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(oneHundredValues.concat(oneHundredValues2));',
|
||||
'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.unzip`')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.unzip(zipped);',
|
||||
'teardown': 'function zip(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.unzip(zipped);',
|
||||
'teardown': 'function zip(){}'
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.values`')
|
||||
.add(buildName, '\
|
||||
@@ -1822,17 +1788,15 @@
|
||||
)
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.zip`')
|
||||
Benchmark.Suite('`_.without` iterating an array of 30 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.zip.apply(lodash, unzipped);',
|
||||
'teardown': 'function zip(){}'
|
||||
'fn': 'lodash.without.apply(lodash, [thirtyValues].concat(thirtyValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.zip.apply(_, unzipped);',
|
||||
'teardown': 'function zip(){}'
|
||||
'fn': '_.without.apply(_, [thirtyValues].concat(thirtyValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
'use strict';
|
||||
|
||||
/** Load Node.js modules */
|
||||
var vm = require('vm');
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
vm = require('vm');
|
||||
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js'),
|
||||
build = require('../build.js'),
|
||||
minify = require('../build/minify.js'),
|
||||
util = require('../build/util.js');
|
||||
|
||||
/** Module shortcuts */
|
||||
var fs = util.fs,
|
||||
path = util.path;
|
||||
var build = require('../build.js'),
|
||||
minify = require('../build/minify'),
|
||||
_ = require('../lodash.js');
|
||||
|
||||
/** Used to avoid `noglobal` false positives caused by `errno` leaked in Node.js */
|
||||
global.errno = true;
|
||||
|
||||
/** Add `path.sep` for older versions of Node.js */
|
||||
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
|
||||
|
||||
/** The current working directory */
|
||||
var cwd = process.cwd();
|
||||
|
||||
@@ -90,12 +90,10 @@
|
||||
};
|
||||
|
||||
/** List of all Lo-Dash methods */
|
||||
var lodashMethods = _.functions(_).filter(function(methodName) {
|
||||
return !/^_/.test(methodName);
|
||||
});
|
||||
|
||||
/** List of all methods */
|
||||
var allMethods = lodashMethods.concat('chain', 'findWhere');
|
||||
var allMethods = _.functions(_)
|
||||
.filter(function(methodName) { return !/^_/.test(methodName); })
|
||||
.concat('chain')
|
||||
.sort();
|
||||
|
||||
/** List of "Arrays" category methods */
|
||||
var arraysMethods = [
|
||||
@@ -120,7 +118,6 @@
|
||||
'union',
|
||||
'uniq',
|
||||
'unique',
|
||||
'unzip',
|
||||
'without',
|
||||
'zip',
|
||||
'zipObject'
|
||||
@@ -128,7 +125,6 @@
|
||||
|
||||
/** List of "Chaining" category methods */
|
||||
var chainingMethods = [
|
||||
'chain',
|
||||
'tap',
|
||||
'value'
|
||||
];
|
||||
@@ -146,7 +142,6 @@
|
||||
'every',
|
||||
'filter',
|
||||
'find',
|
||||
'findWhere',
|
||||
'foldl',
|
||||
'foldr',
|
||||
'forEach',
|
||||
@@ -301,8 +296,8 @@
|
||||
'without'
|
||||
];
|
||||
|
||||
/** List of Lo-Dash only methods */
|
||||
var lodashOnlyMethods = [
|
||||
/** List of methods used by Underscore */
|
||||
var underscoreMethods = _.without.apply(_, [allMethods].concat([
|
||||
'at',
|
||||
'bindKey',
|
||||
'cloneDeep',
|
||||
@@ -315,12 +310,8 @@
|
||||
'merge',
|
||||
'parseInt',
|
||||
'partialRight',
|
||||
'runInContext',
|
||||
'unzip'
|
||||
];
|
||||
|
||||
/** List of Underscore methods */
|
||||
var underscoreMethods = _.without.apply(_, [allMethods].concat(lodashOnlyMethods));
|
||||
'runInContext'
|
||||
]));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -582,12 +573,9 @@
|
||||
context._ = _;
|
||||
vm.runInContext(data.source, context);
|
||||
|
||||
var actual = _.templates.a(object.a);
|
||||
equal(actual.replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
|
||||
|
||||
equal(_.templates.a(object.a).replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
|
||||
equal(_.templates.b(object.b), 'Hello stooge.', basename);
|
||||
equal(_.templates.c(object.c), 'Hello ES6!', basename);
|
||||
|
||||
delete _.templates;
|
||||
start();
|
||||
});
|
||||
@@ -620,9 +608,7 @@
|
||||
|
||||
equal(moduleId, expectedId, basename);
|
||||
ok('a' in _.templates && 'b' in _.templates, basename);
|
||||
|
||||
var actual = _.templates.a({ 'people': ['moe', 'larry'] });
|
||||
equal(actual.replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li></ul>', basename);
|
||||
equal(_.templates.a({ 'people': ['moe', 'larry'] }), '<ul>\n<li>moe</li><li>larry</li>\n</ul>', basename);
|
||||
|
||||
delete _.templates;
|
||||
start();
|
||||
@@ -707,71 +693,7 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('csp modifier');
|
||||
|
||||
(function() {
|
||||
asyncTest('`lodash csp`', function() {
|
||||
var sources = [];
|
||||
|
||||
var check = _.after(2, _.once(function() {
|
||||
ok(_.every(sources, function(source) {
|
||||
// remove `Function` in `_.template` before testing for additional use
|
||||
return !/\bFunction\(/.test(source.replace(/= *\w+\(\w+, *['"]return.+?apply[^)]+\)/, ''));
|
||||
}));
|
||||
|
||||
equal(sources[0], sources[1]);
|
||||
QUnit.start();
|
||||
}));
|
||||
|
||||
var callback = function(data) {
|
||||
// remove copyright header and append to `sources`
|
||||
sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, ''));
|
||||
check();
|
||||
};
|
||||
|
||||
build(['-s', '-d', 'csp'], callback);
|
||||
build(['-s', '-d', 'modern'], callback);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('mobile modifier');
|
||||
|
||||
(function() {
|
||||
asyncTest('`lodash mobile`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', 'mobile'], function(data) {
|
||||
var array = [1, 2, 3],
|
||||
basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext(),
|
||||
object1 = [{ 'a': 1 }],
|
||||
object2 = [{ 'b': 2 }],
|
||||
object3 = [{ 'a': 1, 'b': 2 }],
|
||||
circular1 = { 'a': 1 },
|
||||
circular2 = { 'a': 1 };
|
||||
|
||||
circular1.b = circular1;
|
||||
circular2.b = circular2;
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
deepEqual(lodash.merge(object1, object2), object3, basename);
|
||||
deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename);
|
||||
strictEqual(lodash.isEqual(circular1, circular2), true, basename);
|
||||
|
||||
var actual = lodash.cloneDeep(circular1);
|
||||
ok(actual != circular1 && actual.b == actual, basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('source-map modifier');
|
||||
QUnit.module('source maps');
|
||||
|
||||
(function() {
|
||||
var mapCommands = [
|
||||
@@ -870,6 +792,50 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('underscore chaining methods');
|
||||
|
||||
(function() {
|
||||
var commands = [
|
||||
'backbone',
|
||||
'underscore'
|
||||
];
|
||||
|
||||
commands.forEach(function(command) {
|
||||
asyncTest('`lodash ' + command +'`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', command], function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename);
|
||||
ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename);
|
||||
|
||||
var wrapped = lodash(1);
|
||||
strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename);
|
||||
equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename);
|
||||
equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename);
|
||||
|
||||
wrapped.chain();
|
||||
ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename);
|
||||
ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename);
|
||||
|
||||
wrapped = lodash([1, 2, 3]);
|
||||
ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename);
|
||||
ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename);
|
||||
deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename);
|
||||
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('underscore modifier');
|
||||
|
||||
(function() {
|
||||
@@ -1004,7 +970,22 @@
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
_.each(lodashOnlyMethods.concat('assign'), function(methodName) {
|
||||
_.each([
|
||||
'assign',
|
||||
'at',
|
||||
'bindKey',
|
||||
'createCallback',
|
||||
'findIndex',
|
||||
'findKey',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'isPlainObject',
|
||||
'merge',
|
||||
'parseInt',
|
||||
'partialRight',
|
||||
'runInContext',
|
||||
'zipObject'
|
||||
], function(methodName) {
|
||||
equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename);
|
||||
});
|
||||
|
||||
@@ -1012,6 +993,23 @@
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('`lodash underscore include=findWhere`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', 'underscore', 'include=findWhere'], function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
var collection = [{ 'a': 1 }, { 'a': 1 }];
|
||||
deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename);
|
||||
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('`lodash underscore include=partial`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
@@ -1061,51 +1059,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('underscore chaining methods');
|
||||
|
||||
(function() {
|
||||
var commands = [
|
||||
'backbone',
|
||||
'underscore',
|
||||
'modern plus=chain'
|
||||
];
|
||||
|
||||
commands.forEach(function(command) {
|
||||
asyncTest('`lodash ' + command +'`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s'].concat(command.split(' ')), function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename);
|
||||
ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename);
|
||||
|
||||
var wrapped = lodash(1);
|
||||
strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename);
|
||||
equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename);
|
||||
equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename);
|
||||
|
||||
wrapped.chain();
|
||||
ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename);
|
||||
ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename);
|
||||
|
||||
wrapped = lodash([1, 2, 3]);
|
||||
ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename);
|
||||
ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename);
|
||||
deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename);
|
||||
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('exports command');
|
||||
|
||||
(function() {
|
||||
@@ -1244,66 +1197,7 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('commands with findWhere');
|
||||
|
||||
(function() {
|
||||
var commands = [
|
||||
'underscore include=findWhere',
|
||||
'modern include=findWhere',
|
||||
'plus=findWhere'
|
||||
];
|
||||
|
||||
commands.forEach(function(command) {
|
||||
asyncTest('`lodash ' + command + '`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s'].concat(command.split(' ')), function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
var collection = [{ 'a': 1 }, { 'a': 1 }];
|
||||
deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename);
|
||||
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('no-dep option');
|
||||
|
||||
(function() {
|
||||
var commands = [
|
||||
'-n',
|
||||
'--no-dep'
|
||||
];
|
||||
|
||||
commands.forEach(function(command) {
|
||||
asyncTest('`lodash modern include=each ' + command +'`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', 'modern', 'include=each', command], function(data) {
|
||||
var basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
deepEqual(_.functions(lodash), ['each', 'forEach'], basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('output option');
|
||||
QUnit.module('output options');
|
||||
|
||||
(function() {
|
||||
var nestedPath = path.join(__dirname, 'a', 'b');
|
||||
@@ -1344,7 +1238,7 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('stdout option');
|
||||
QUnit.module('stdout options');
|
||||
|
||||
(function() {
|
||||
var commands = [
|
||||
@@ -1375,6 +1269,64 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('mobile build');
|
||||
|
||||
(function() {
|
||||
asyncTest('`lodash mobile`', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', 'mobile'], function(data) {
|
||||
var array = [1, 2, 3],
|
||||
basename = path.basename(data.outputPath, '.js'),
|
||||
context = createContext(),
|
||||
object1 = [{ 'a': 1 }],
|
||||
object2 = [{ 'b': 2 }],
|
||||
object3 = [{ 'a': 1, 'b': 2 }],
|
||||
circular1 = { 'a': 1 },
|
||||
circular2 = { 'a': 1 };
|
||||
|
||||
circular1.b = circular1;
|
||||
circular2.b = circular2;
|
||||
|
||||
vm.runInContext(data.source, context);
|
||||
var lodash = context._;
|
||||
|
||||
deepEqual(lodash.merge(object1, object2), object3, basename);
|
||||
deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename);
|
||||
strictEqual(lodash.isEqual(circular1, circular2), true, basename);
|
||||
|
||||
var actual = lodash.cloneDeep(circular1);
|
||||
ok(actual != circular1 && actual.b == actual, basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('`lodash csp`', function() {
|
||||
var sources = [];
|
||||
|
||||
var check = _.after(2, _.once(function() {
|
||||
ok(_.every(sources, function(source) {
|
||||
// remove `Function` in `_.template` before testing for additional use
|
||||
return !/\bFunction\(/.test(source.replace(/= *\w+\(\w+, *['"]return.+?apply[^)]+\)/, ''));
|
||||
}));
|
||||
|
||||
equal(sources[0], sources[1]);
|
||||
QUnit.start();
|
||||
}));
|
||||
|
||||
var callback = function(data) {
|
||||
// remove copyright header and append to `sources`
|
||||
sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, ''));
|
||||
check();
|
||||
};
|
||||
|
||||
build(['-s', '-d', 'csp'], callback);
|
||||
build(['-s', '-d', 'mobile'], callback);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash build');
|
||||
|
||||
(function() {
|
||||
@@ -1468,7 +1420,7 @@
|
||||
methodNames = (methodNames || []).concat(command.match(/category=(\S*)/)[1].split(/, */).map(capitalize));
|
||||
}
|
||||
if (!methodNames) {
|
||||
methodNames = lodashMethods.slice();
|
||||
methodNames = allMethods.slice();
|
||||
}
|
||||
if (/plus/.test(command)) {
|
||||
methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */));
|
||||
@@ -1485,13 +1437,16 @@
|
||||
var result = getMethodsByCategory(category);
|
||||
|
||||
// limit category methods to those available for specific builds
|
||||
result = result.filter(function(methodName) {
|
||||
return _.contains(
|
||||
isBackbone ? backboneDependencies :
|
||||
isUnderscore ? underscoreMethods :
|
||||
lodashMethods, methodName
|
||||
);
|
||||
});
|
||||
if (isBackbone) {
|
||||
result = result.filter(function(methodName) {
|
||||
return _.contains(backboneDependencies, methodName);
|
||||
});
|
||||
}
|
||||
else if (isUnderscore) {
|
||||
result = result.filter(function(methodName) {
|
||||
return _.contains(underscoreMethods, methodName);
|
||||
});
|
||||
}
|
||||
if (result.length) {
|
||||
methodNames = _.without(methodNames, category);
|
||||
push.apply(methodNames, result);
|
||||
|
||||
383
test/test.js
@@ -196,8 +196,6 @@
|
||||
QUnit.module('lodash.at');
|
||||
|
||||
(function() {
|
||||
var args = arguments;
|
||||
|
||||
test('should return `undefined` for nonexistent keys', function() {
|
||||
var actual = _.at(['a', 'b', 'c'], [0, 2, 4]);
|
||||
deepEqual(actual, ['a', 'c', undefined]);
|
||||
@@ -212,11 +210,6 @@
|
||||
deepEqual(actual, ['a', 'c', 'd']);
|
||||
});
|
||||
|
||||
test('should work with an `arguments` object for `collection`', function() {
|
||||
var actual = _.at(args, [0, 2]);
|
||||
deepEqual(actual, ['a', 'c']);
|
||||
});
|
||||
|
||||
test('should work with an object for `collection`', function() {
|
||||
var actual = _.at({ 'a': 1, 'b': 2, 'c': 3 }, ['a', 'c']);
|
||||
deepEqual(actual, [1, 3]);
|
||||
@@ -231,7 +224,7 @@
|
||||
deepEqual(_.at(collection, [0, 2]), ['a', 'c']);
|
||||
});
|
||||
});
|
||||
}('a', 'b', 'c'));
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -302,12 +295,6 @@
|
||||
|
||||
deepEqual(actual, [1, 2, 3, undefined]);
|
||||
});
|
||||
|
||||
test('should work with an array `object` argument', function() {
|
||||
var array = ['push', 'pop'];
|
||||
_.bindAll(array);
|
||||
equal(array.pop, Array.prototype.pop);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -347,7 +334,7 @@
|
||||
};
|
||||
|
||||
var objects = {
|
||||
'an `arguments` object': arguments,
|
||||
'an arguments object': arguments,
|
||||
'an array': ['a', 'b', 'c', ''],
|
||||
'an array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 },
|
||||
'boolean': false,
|
||||
@@ -520,14 +507,14 @@
|
||||
|
||||
(function() {
|
||||
test('subsequent "immediate" debounced calls return the last `func` result', function() {
|
||||
var debounced = _.debounce(_.identity, 32, true),
|
||||
var debounced = _.debounce(function(value) { return value; }, 32, true),
|
||||
result = [debounced('x'), debounced('y')];
|
||||
|
||||
deepEqual(result, ['x', 'x']);
|
||||
});
|
||||
|
||||
asyncTest('subsequent debounced calls return the last `func` result', function() {
|
||||
var debounced = _.debounce(_.identity, 32);
|
||||
var debounced = _.debounce(function(value) { return value; }, 32);
|
||||
debounced('x');
|
||||
|
||||
setTimeout(function() {
|
||||
@@ -535,58 +522,6 @@
|
||||
QUnit.start();
|
||||
}, 64);
|
||||
});
|
||||
|
||||
asyncTest('should apply default options correctly', function() {
|
||||
var count = 0;
|
||||
|
||||
var debounced = _.debounce(function(value) {
|
||||
count++;
|
||||
return value;
|
||||
}, 32, {});
|
||||
|
||||
strictEqual(debounced('x'), undefined);
|
||||
|
||||
setTimeout(function() {
|
||||
strictEqual(count, 1);
|
||||
QUnit.start();
|
||||
}, 64);
|
||||
});
|
||||
|
||||
test('should work with `leading` option', function() {
|
||||
_.each([true, { 'leading': true }], function(options) {
|
||||
var withLeading = _.debounce(_.identity, 32, options);
|
||||
equal(withLeading('x'), 'x');
|
||||
});
|
||||
|
||||
_.each([false, { 'leading': false }], function(options) {
|
||||
var withoutLeading = _.debounce(_.identity, 32, options);
|
||||
strictEqual(withoutLeading('x'), undefined);
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('should work with `trailing` option', function() {
|
||||
var withCount = 0,
|
||||
withoutCount = 0;
|
||||
|
||||
var withTrailing = _.debounce(function(value) {
|
||||
withCount++;
|
||||
return value;
|
||||
}, 32, { 'trailing': true });
|
||||
|
||||
var withoutTrailing = _.debounce(function(value) {
|
||||
withoutCount++;
|
||||
return value;
|
||||
}, 32, { 'trailing': false });
|
||||
|
||||
strictEqual(withTrailing('x'), undefined);
|
||||
strictEqual(withoutTrailing('x'), undefined);
|
||||
|
||||
setTimeout(function() {
|
||||
strictEqual(withCount, 1);
|
||||
strictEqual(withoutCount, 0);
|
||||
QUnit.start();
|
||||
}, 64);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -1085,21 +1020,12 @@
|
||||
|
||||
test('lodash.' + methodName + ' should pass the correct `callback` arguments', function() {
|
||||
var args;
|
||||
|
||||
func({ 'a': 1 }, { 'a': 2 }, function() {
|
||||
args || (args = slice.call(arguments));
|
||||
});
|
||||
|
||||
deepEqual(args, [1, 2], 'primitive property values');
|
||||
|
||||
var array = [1, 2],
|
||||
object = { 'b': 2 };
|
||||
|
||||
args = null;
|
||||
func({ 'a': array }, { 'a': object }, function() {
|
||||
args || (args = slice.call(arguments));
|
||||
});
|
||||
|
||||
deepEqual(args, [array, object], 'non-primitive property values');
|
||||
deepEqual(args, [1, 2]);
|
||||
});
|
||||
|
||||
test('lodash.' + methodName + ' should correct set the `this` binding', function() {
|
||||
@@ -1148,36 +1074,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('`__proto__` property bugs');
|
||||
|
||||
(function() {
|
||||
var stringLiteral = '__proto__',
|
||||
stringObject = Object(stringLiteral),
|
||||
expected = [stringLiteral, stringObject];
|
||||
|
||||
var array = _.times(100, function(count) {
|
||||
return count % 2 ? stringObject : stringLiteral;
|
||||
});
|
||||
|
||||
test('internal data objects should work with the `__proto__` key', function() {
|
||||
deepEqual(_.difference(array, array), []);
|
||||
deepEqual(_.intersection(array, array), expected);
|
||||
deepEqual(_.uniq(array), expected);
|
||||
deepEqual(_.without.apply(_, [array].concat(array)), []);
|
||||
});
|
||||
|
||||
test('lodash.memoize should memoize values resolved to the `__proto__` key', function() {
|
||||
var count = 0,
|
||||
memoized = _.memoize(function() { return ++count; });
|
||||
|
||||
memoized('__proto__');
|
||||
memoized('__proto__');
|
||||
strictEqual(count, 1);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.groupBy');
|
||||
|
||||
(function() {
|
||||
@@ -1460,14 +1356,6 @@
|
||||
strictEqual(actual, false);
|
||||
});
|
||||
});
|
||||
|
||||
test('should ensure `callback` is a function', function() {
|
||||
var array = [1, 2, 3],
|
||||
eq = _.partial(_.isEqual, array),
|
||||
actual = _.every([array, [1, 0, 3]], eq);
|
||||
|
||||
strictEqual(actual, false);
|
||||
})
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -1883,27 +1771,8 @@
|
||||
});
|
||||
|
||||
test('should handle merging if `callback` returns `undefined`', function() {
|
||||
var actual = _.merge({ 'a': { 'b': [1, 1] } }, { 'a': { 'b': [0] } }, function() { });
|
||||
deepEqual(actual, { 'a': { 'b': [0, 1] } });
|
||||
});
|
||||
|
||||
test('should defer to `callback` when it returns a value other than `undefined`', function() {
|
||||
var actual = _.merge({ 'a': { 'b': [0, 1] } }, { 'a': { 'b': [2] } }, function(a, b) {
|
||||
return _.isArray(a) ? a.concat(b) : undefined;
|
||||
});
|
||||
deepEqual(actual, { 'a': { 'b': [0, 1, 2] } });
|
||||
});
|
||||
|
||||
test('should pass the correct values to `callback`', function() {
|
||||
var argsList = [],
|
||||
array = [1, 2],
|
||||
object = { 'b': 2 };
|
||||
|
||||
_.merge({ 'a': array }, { 'a': object }, function(a, b) {
|
||||
argsList.push(slice.call(arguments));
|
||||
});
|
||||
|
||||
deepEqual(argsList, [[array, object], [undefined, 2]]);
|
||||
var actual = _.merge({ 'a': 1 }, { 'a': 2 }, function() { });
|
||||
deepEqual(actual, { 'a': 2 });
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
@@ -1934,10 +1803,6 @@
|
||||
deepEqual(_.omit(new Foo, 'a'), expected);
|
||||
});
|
||||
|
||||
test('should work with an array `object` argument', function() {
|
||||
deepEqual(_.omit([1, 2, 3], '0', '2'), { '1': 2 });
|
||||
});
|
||||
|
||||
test('should work with a `callback` argument', function() {
|
||||
var actual = _.omit(object, function(value) {
|
||||
return value == 1;
|
||||
@@ -1972,41 +1837,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.once');
|
||||
|
||||
(function() {
|
||||
test('should ignore recursive calls', function() {
|
||||
var count = 0;
|
||||
|
||||
var func = _.once(function() {
|
||||
count++;
|
||||
func();
|
||||
});
|
||||
|
||||
func();
|
||||
strictEqual(count, 1);
|
||||
});
|
||||
|
||||
test('should not throw more than once', function() {
|
||||
var pass = true;
|
||||
|
||||
var func = _.once(function() {
|
||||
throw new Error;
|
||||
});
|
||||
|
||||
raises(function() { func(); }, Error);
|
||||
|
||||
try {
|
||||
func();
|
||||
} catch(e) {
|
||||
pass = false;
|
||||
}
|
||||
ok(pass);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.parseInt');
|
||||
|
||||
(function() {
|
||||
@@ -2097,10 +1927,6 @@
|
||||
deepEqual(_.pick(new Foo, 'b'), { 'b': 2 });
|
||||
});
|
||||
|
||||
test('should work with an array `object` argument', function() {
|
||||
deepEqual(_.pick([1, 2, 3], '1'), { '1': 2 });
|
||||
});
|
||||
|
||||
test('should work with a `callback` argument', function() {
|
||||
var actual = _.pick(object, function(value) {
|
||||
return value == 2;
|
||||
@@ -2732,109 +2558,53 @@
|
||||
});
|
||||
|
||||
asyncTest('supports recursive calls', function() {
|
||||
var count = 0;
|
||||
var counter = 0;
|
||||
var throttled = _.throttle(function() {
|
||||
count++;
|
||||
if (count < 10) {
|
||||
counter++;
|
||||
if (counter < 10) {
|
||||
throttled();
|
||||
}
|
||||
}, 32);
|
||||
|
||||
throttled();
|
||||
equal(count, 1);
|
||||
equal(counter, 1);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(count < 3)
|
||||
ok(counter < 3)
|
||||
QUnit.start();
|
||||
}, 32);
|
||||
});
|
||||
|
||||
asyncTest('should not trigger a trailing call when invoked once', function() {
|
||||
var count = 0,
|
||||
throttled = _.throttle(function() { count++; }, 32);
|
||||
var counter = 0,
|
||||
throttled = _.throttle(function() { counter++; }, 32);
|
||||
|
||||
throttled();
|
||||
equal(count, 1);
|
||||
equal(counter, 1);
|
||||
|
||||
setTimeout(function() {
|
||||
equal(count, 1);
|
||||
equal(counter, 1);
|
||||
QUnit.start();
|
||||
}, 96);
|
||||
});
|
||||
|
||||
asyncTest('should trigger trailing call when invoked repeatedly', function() {
|
||||
var count = 0,
|
||||
var counter = 0,
|
||||
limit = 48,
|
||||
throttled = _.throttle(function() { count++; }, 32),
|
||||
throttled = _.throttle(function() { counter++; }, 32),
|
||||
start = new Date;
|
||||
|
||||
while ((new Date - start) < limit) {
|
||||
throttled();
|
||||
}
|
||||
var lastCount = count;
|
||||
var lastCount = counter;
|
||||
ok(lastCount > 1);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(count > lastCount);
|
||||
ok(counter > lastCount);
|
||||
QUnit.start();
|
||||
}, 96);
|
||||
});
|
||||
|
||||
asyncTest('should apply default options correctly', function() {
|
||||
var count = 0;
|
||||
|
||||
var throttled = _.throttle(function(value) {
|
||||
count++;
|
||||
return value;
|
||||
}, 32, {});
|
||||
|
||||
_.times(2, function() {
|
||||
equal(throttled('x'), 'x');
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
strictEqual(count, 2);
|
||||
QUnit.start();
|
||||
}, 64);
|
||||
});
|
||||
|
||||
test('should work with `leading` option', function() {
|
||||
_.each([true, { 'leading': true }], function(options) {
|
||||
var withLeading = _.throttle(_.identity, 32, options);
|
||||
equal(withLeading('x'), 'x');
|
||||
});
|
||||
|
||||
_.each([false, { 'leading': false }], function(options) {
|
||||
var withoutLeading = _.throttle(_.identity, 32, options);
|
||||
strictEqual(withoutLeading('x'), undefined);
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('should work with `trailing` option', function() {
|
||||
var withCount = 0,
|
||||
withoutCount = 0;
|
||||
|
||||
var withTrailing = _.throttle(function(value) {
|
||||
withCount++;
|
||||
return value;
|
||||
}, 32, { 'trailing': true });
|
||||
|
||||
var withoutTrailing = _.throttle(function(value) {
|
||||
withoutCount++;
|
||||
return value;
|
||||
}, 32, { 'trailing': false });
|
||||
|
||||
_.times(2, function() {
|
||||
equal(withTrailing('x'), 'x');
|
||||
equal(withoutTrailing('x'), 'x');
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
strictEqual(withCount, 2);
|
||||
strictEqual(withoutCount, 1);
|
||||
QUnit.start();
|
||||
}, 64);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -2932,19 +2702,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.union');
|
||||
|
||||
(function() {
|
||||
test('should produce correct results when passed a falsey `array` argument', function() {
|
||||
var expected = [1, 2, 3],
|
||||
actual = _.union(null, expected);
|
||||
|
||||
deepEqual(actual, expected);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.uniq');
|
||||
|
||||
(function() {
|
||||
@@ -2957,14 +2714,10 @@
|
||||
});
|
||||
|
||||
test('should distinguish between numbers and numeric strings', function() {
|
||||
var array = [],
|
||||
expected = ['2', 2, Object('2'), Object(2)];
|
||||
var expected = ['2', 2, Object('2'), Object(2)],
|
||||
actual = _.uniq(expected);
|
||||
|
||||
_.times(50, function() {
|
||||
array.push.apply(array, expected);
|
||||
});
|
||||
|
||||
deepEqual(_.uniq(expected), expected);
|
||||
deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
_.each({
|
||||
@@ -2997,58 +2750,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.unzip');
|
||||
|
||||
(function() {
|
||||
var object = {
|
||||
'an empty array': [
|
||||
[],
|
||||
[]
|
||||
],
|
||||
'0-tuples': [
|
||||
[[], []],
|
||||
[]
|
||||
],
|
||||
'1-tuples': [
|
||||
[['moe'], ['larry']],
|
||||
[['moe', 'larry']]
|
||||
],
|
||||
'2-tuples': [
|
||||
[['moe', 30], ['larry', 40]],
|
||||
[['moe', 'larry'], [30, 40]]
|
||||
],
|
||||
'3-tuples': [
|
||||
[['moe', 30, true], ['larry', 40, false]],
|
||||
[['moe', 'larry'], [30, 40], [true, false]]
|
||||
]
|
||||
};
|
||||
|
||||
_.forOwn(object, function(pair, key) {
|
||||
test('should work with ' + key, function() {
|
||||
var actual = _.unzip(pair[0]);
|
||||
deepEqual(actual, pair[1]);
|
||||
deepEqual(_.zip.apply(_, actual), pair[1].length ? pair[0] : pair[1]);
|
||||
});
|
||||
});
|
||||
|
||||
test('should work with tuples of different lengths', function() {
|
||||
var pair = [
|
||||
[['moe', 30], ['larry', 40, false]],
|
||||
[['moe', 'larry'], [30, 40], [undefined, false]]
|
||||
];
|
||||
|
||||
var actual = _.unzip(pair[0]);
|
||||
ok(1 in actual);
|
||||
deepEqual(actual, pair[1]);
|
||||
|
||||
actual = _.zip.apply(_, actual);
|
||||
ok(2 in actual[0]);
|
||||
deepEqual(actual, [['moe', 30, undefined], ['larry', 40, false]]);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.where');
|
||||
|
||||
(function() {
|
||||
@@ -3261,37 +2962,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('"Arrays" category methods');
|
||||
|
||||
(function() {
|
||||
var args = arguments;
|
||||
|
||||
test('should work with `arguments` objects', function() {
|
||||
function message(methodName) {
|
||||
return '_.' + methodName + ' should work with `arguments` objects';
|
||||
}
|
||||
|
||||
deepEqual(_.compact(args), [1, [3], 5], message('compact'));
|
||||
deepEqual(_.difference(args, [null]), [1, [3], 5], message('difference'));
|
||||
deepEqual(_.findIndex(args, _.identity), 0, message('findIndex'));
|
||||
deepEqual(_.first(args), 1, message('first'));
|
||||
deepEqual(_.flatten(args), [1, null, 3, null, 5], message('flatten'));
|
||||
deepEqual(_.indexOf(args, 5), 4, message('indexOf'));
|
||||
deepEqual(_.initial(args, 4), [1], message('initial'));
|
||||
deepEqual(_.intersection(args, [1]), [1], message('intersection'));
|
||||
deepEqual(_.last(args), 5, message('last'));
|
||||
deepEqual(_.lastIndexOf(args, 1), 0, message('lastIndexOf'));
|
||||
deepEqual(_.rest(args, 4), [5], message('rest'));
|
||||
deepEqual(_.sortedIndex(args, 6), 5, message('sortedIndex'));
|
||||
deepEqual(_.union(args, [null, 6]), [1, null, [3], 5, 6], message('union'));
|
||||
deepEqual(_.uniq(args), [1, null, [3], 5], message('uniq'));
|
||||
deepEqual(_.without(args, null), [1, [3], 5], message('without'));
|
||||
deepEqual(_.zip(args, args), [[1, 1], [null, null], [[3], [3]], [null, null], [5, 5]], message('zip'));
|
||||
});
|
||||
}(1, null, [3], null, 5));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash methods');
|
||||
|
||||
(function() {
|
||||
@@ -3352,10 +3022,13 @@
|
||||
|
||||
_.each(funcs, function(methodName) {
|
||||
var actual = [],
|
||||
expected = _.map(falsey, function() { return []; }),
|
||||
func = _[methodName],
|
||||
pass = true;
|
||||
|
||||
var expected = (methodName == 'union')
|
||||
? _.map(falsey, function(value, index) { return index ? [value] : []; })
|
||||
: _.map(falsey, function() { return []; });
|
||||
|
||||
_.each(falsey, function(value, index) {
|
||||
try {
|
||||
actual.push(index ? func(value) : func());
|
||||
|
||||
2
vendor/benchmark.js/README.md
vendored
@@ -15,7 +15,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
|
||||
|
||||
## Support
|
||||
|
||||
Benchmark.js has been tested in at least Chrome 5~26, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
Benchmark.js has been tested in at least Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.1, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Installation and usage
|
||||
|
||||
|
||||
12
vendor/benchmark.js/benchmark.js
vendored
@@ -21,9 +21,9 @@
|
||||
/** Detect free variable `require` */
|
||||
var freeRequire = typeof require == 'function' && require;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
@@ -738,7 +738,13 @@
|
||||
cycle(deferred);
|
||||
}
|
||||
else if (++deferred.cycles < clone.count) {
|
||||
clone.compiled.call(deferred, context, timer);
|
||||
// continue the test loop
|
||||
if (support.timeout) {
|
||||
// use setTimeout to avoid a call stack overflow if called recursively
|
||||
setTimeout(function() { clone.compiled.call(deferred, context, timer); }, 0);
|
||||
} else {
|
||||
clone.compiled.call(deferred, context, timer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
timer.stop(deferred);
|
||||
|
||||
0
vendor/firebug-lite/license.txt
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/blank.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/buttonBg.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
0
vendor/firebug-lite/skin/xp/buttonBgHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
0
vendor/firebug-lite/skin/xp/debugger.css
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/detach.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
vendor/firebug-lite/skin/xp/detachHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
0
vendor/firebug-lite/skin/xp/disable.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
0
vendor/firebug-lite/skin/xp/disable.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/disableHover.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
0
vendor/firebug-lite/skin/xp/disableHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
0
vendor/firebug-lite/skin/xp/down.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
0
vendor/firebug-lite/skin/xp/downActive.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/downHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
0
vendor/firebug-lite/skin/xp/errorIcon-sm.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
0
vendor/firebug-lite/skin/xp/errorIcon.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
0
vendor/firebug-lite/skin/xp/errorIcon.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
0
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/firebug.css
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/firebug.html
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/firebug.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
vendor/firebug-lite/skin/xp/group.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
0
vendor/firebug-lite/skin/xp/html.css
vendored
Executable file → Normal file
0
vendor/firebug-lite/skin/xp/infoIcon.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
0
vendor/firebug-lite/skin/xp/infoIcon.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
0
vendor/firebug-lite/skin/xp/loading_16.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
vendor/firebug-lite/skin/xp/min.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
0
vendor/firebug-lite/skin/xp/minHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 485 B |
0
vendor/firebug-lite/skin/xp/off.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
0
vendor/firebug-lite/skin/xp/offHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 680 B |
0
vendor/firebug-lite/skin/xp/pixel_transparent.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/roundCorner.svg
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
0
vendor/firebug-lite/skin/xp/search.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
0
vendor/firebug-lite/skin/xp/search.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
0
vendor/firebug-lite/skin/xp/shadow.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
vendor/firebug-lite/skin/xp/shadow2.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
0
vendor/firebug-lite/skin/xp/shadowAlpha.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
0
vendor/firebug-lite/skin/xp/sprite.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
0
vendor/firebug-lite/skin/xp/tabHoverLeft.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
0
vendor/firebug-lite/skin/xp/tabHoverMid.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
0
vendor/firebug-lite/skin/xp/tabHoverRight.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
0
vendor/firebug-lite/skin/xp/tabLeft.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
0
vendor/firebug-lite/skin/xp/tabMenuCheckbox.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
0
vendor/firebug-lite/skin/xp/tabMenuPin.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
0
vendor/firebug-lite/skin/xp/tabMenuRadio.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
0
vendor/firebug-lite/skin/xp/tabMenuTarget.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
0
vendor/firebug-lite/skin/xp/tabMenuTargetHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
0
vendor/firebug-lite/skin/xp/tabMid.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
0
vendor/firebug-lite/skin/xp/tabRight.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 448 B |
0
vendor/firebug-lite/skin/xp/textEditorBorders.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
0
vendor/firebug-lite/skin/xp/textEditorBorders.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
0
vendor/firebug-lite/skin/xp/textEditorCorners.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
vendor/firebug-lite/skin/xp/textEditorCorners.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
vendor/firebug-lite/skin/xp/titlebarMid.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 273 B |
0
vendor/firebug-lite/skin/xp/toolbarMid.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
0
vendor/firebug-lite/skin/xp/tree_close.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
0
vendor/firebug-lite/skin/xp/tree_open.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
0
vendor/firebug-lite/skin/xp/twistyClosed.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
0
vendor/firebug-lite/skin/xp/twistyOpen.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
0
vendor/firebug-lite/skin/xp/up.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 619 B |
0
vendor/firebug-lite/skin/xp/upActive.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 551 B |
0
vendor/firebug-lite/skin/xp/upHover.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
0
vendor/firebug-lite/skin/xp/warningIcon.gif
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
0
vendor/firebug-lite/skin/xp/warningIcon.png
vendored
Executable file → Normal file
|
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 516 B |
0
vendor/firebug-lite/src/firebug-lite-debug.js
vendored
Executable file → Normal file
2
vendor/platform.js/README.md
vendored
@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
|
||||
|
||||
## Support
|
||||
|
||||
Platform.js has been tested in at least Chrome 5~26, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
Platform.js has been tested in at least Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.1, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Installation and usage
|
||||
|
||||
|
||||
2
vendor/qunit-clib/README.md
vendored
@@ -9,7 +9,7 @@ QUnit CLIB helps extend QUnit’s CLI support to many common CLI environments.
|
||||
|
||||
## Support
|
||||
|
||||
QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.1, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
4
vendor/qunit-clib/qunit-clib.js
vendored
@@ -10,9 +10,9 @@
|
||||
/** Detect free variable `exports` */
|
||||
var freeExports = typeof exports == 'object' && exports;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
|
||||
2
vendor/underscore/underscore-min.js
vendored
57
vendor/underscore/underscore.js
vendored
@@ -96,7 +96,7 @@
|
||||
if (obj == null) return results;
|
||||
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
results.push(iterator.call(context, value, index, list));
|
||||
results[results.length] = iterator.call(context, value, index, list);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
@@ -171,7 +171,7 @@
|
||||
if (obj == null) return results;
|
||||
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
if (iterator.call(context, value, index, list)) results.push(value);
|
||||
if (iterator.call(context, value, index, list)) results[results.length] = value;
|
||||
});
|
||||
return results;
|
||||
};
|
||||
@@ -238,7 +238,7 @@
|
||||
// Convenience version of a common use case of `filter`: selecting only objects
|
||||
// containing specific `key:value` pairs.
|
||||
_.where = function(obj, attrs, first) {
|
||||
if (_.isEmpty(attrs)) return first ? void 0 : [];
|
||||
if (_.isEmpty(attrs)) return first ? null : [];
|
||||
return _[first ? 'find' : 'filter'](obj, function(value) {
|
||||
for (var key in attrs) {
|
||||
if (attrs[key] !== value[key]) return false;
|
||||
@@ -255,7 +255,7 @@
|
||||
|
||||
// Return the maximum element or (element-based computation).
|
||||
// Can't optimize arrays of integers longer than 65,535 elements.
|
||||
// See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
|
||||
// See: https://bugs.webkit.org/show_bug.cgi?id=80797
|
||||
_.max = function(obj, iterator, context) {
|
||||
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
|
||||
return Math.max.apply(Math, obj);
|
||||
@@ -324,7 +324,7 @@
|
||||
// An internal function used for aggregate "group by" operations.
|
||||
var group = function(obj, value, context, behavior) {
|
||||
var result = {};
|
||||
var iterator = lookupIterator(value == null ? _.identity : value);
|
||||
var iterator = lookupIterator(value || _.identity);
|
||||
each(obj, function(value, index) {
|
||||
var key = iterator.call(context, value, index, obj);
|
||||
behavior(result, key, value);
|
||||
@@ -499,17 +499,6 @@
|
||||
return results;
|
||||
};
|
||||
|
||||
// The inverse operation to `_.zip`. If given an array of pairs it
|
||||
// returns an array of the paired elements split into two left and
|
||||
// right element arrays, if given an array of triples it returns a
|
||||
// three element array and so on. For example, `_.unzip` given
|
||||
// `[['a',1],['b',2],['c',3]]` returns the array
|
||||
// [['a','b','c'],[1,2,3]].
|
||||
_.unzip = function(tuples) {
|
||||
var maxLen = _.max(_.pluck(tuples, "length"))
|
||||
return _.times(maxLen, _.partial(_.pluck, tuples));
|
||||
};
|
||||
|
||||
// Converts lists into objects. Pass either a single array of `[key, value]`
|
||||
// pairs, or two parallel arrays of the same length -- one of keys, and one of
|
||||
// the corresponding values.
|
||||
@@ -585,25 +574,14 @@
|
||||
// Function (ahem) Functions
|
||||
// ------------------
|
||||
|
||||
// Reusable constructor function for prototype setting.
|
||||
var ctor = function(){};
|
||||
|
||||
// Create a function bound to a given object (assigning `this`, and arguments,
|
||||
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
|
||||
// available.
|
||||
_.bind = function(func, context) {
|
||||
var args, bound;
|
||||
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
|
||||
if (!_.isFunction(func)) throw new TypeError;
|
||||
args = slice.call(arguments, 2);
|
||||
return bound = function() {
|
||||
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
|
||||
ctor.prototype = func.prototype;
|
||||
var self = new ctor;
|
||||
ctor.prototype = null;
|
||||
var result = func.apply(self, args.concat(slice.call(arguments)));
|
||||
if (Object(result) === result) return result;
|
||||
return self;
|
||||
var args = slice.call(arguments, 2);
|
||||
return function() {
|
||||
return func.apply(context, args.concat(slice.call(arguments)));
|
||||
};
|
||||
};
|
||||
|
||||
@@ -620,7 +598,7 @@
|
||||
// all callbacks defined on an object belong to it.
|
||||
_.bindAll = function(obj) {
|
||||
var funcs = slice.call(arguments, 1);
|
||||
if (funcs.length === 0) throw new Error("bindAll must be passed function names");
|
||||
if (funcs.length === 0) funcs = _.functions(obj);
|
||||
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
|
||||
return obj;
|
||||
};
|
||||
@@ -650,7 +628,7 @@
|
||||
|
||||
// Returns a function, that, when invoked, will only be triggered at most once
|
||||
// during a given window of time.
|
||||
_.throttle = function(func, wait, immediate) {
|
||||
_.throttle = function(func, wait) {
|
||||
var context, args, timeout, result;
|
||||
var previous = 0;
|
||||
var later = function() {
|
||||
@@ -660,7 +638,6 @@
|
||||
};
|
||||
return function() {
|
||||
var now = new Date;
|
||||
if (!previous && immediate === false) previous = now;
|
||||
var remaining = wait - (now - previous);
|
||||
context = this;
|
||||
args = arguments;
|
||||
@@ -751,7 +728,7 @@
|
||||
_.keys = nativeKeys || function(obj) {
|
||||
if (obj !== Object(obj)) throw new TypeError('Invalid object');
|
||||
var keys = [];
|
||||
for (var key in obj) if (_.has(obj, key)) keys.push(key);
|
||||
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
|
||||
return keys;
|
||||
};
|
||||
|
||||
@@ -823,7 +800,7 @@
|
||||
each(slice.call(arguments, 1), function(source) {
|
||||
if (source) {
|
||||
for (var prop in source) {
|
||||
if (obj[prop] === void 0) obj[prop] = source[prop];
|
||||
if (obj[prop] == null) obj[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -847,7 +824,7 @@
|
||||
// Internal recursive comparison function for `isEqual`.
|
||||
var eq = function(a, b, aStack, bStack) {
|
||||
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
||||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
||||
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
|
||||
if (a === b) return a !== 0 || 1 / a == 1 / b;
|
||||
// A strict comparison is necessary because `null == undefined`.
|
||||
if (a == null || b == null) return a === b;
|
||||
@@ -1035,7 +1012,7 @@
|
||||
|
||||
// Run a function **n** times.
|
||||
_.times = function(n, iterator, context) {
|
||||
var accum = Array(Math.max(0, n));
|
||||
var accum = Array(n);
|
||||
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
|
||||
return accum;
|
||||
};
|
||||
@@ -1078,10 +1055,10 @@
|
||||
};
|
||||
});
|
||||
|
||||
// If the value of the named `property` is a function then invoke it with the
|
||||
// `object` as context; otherwise, return it.
|
||||
// If the value of the named property is a function then invoke it;
|
||||
// otherwise, return it.
|
||||
_.result = function(object, property) {
|
||||
if (object == null) return void 0;
|
||||
if (object == null) return null;
|
||||
var value = object[property];
|
||||
return _.isFunction(value) ? value.call(object) : value;
|
||||
};
|
||||
|
||||