Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04de328dbe |
@@ -1,12 +0,0 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
4
.gitattributes
vendored
@@ -1 +1,5 @@
|
||||
* text=auto
|
||||
*.html text eol=lf
|
||||
*.js text eol=lf
|
||||
*.md text eol=lf
|
||||
*.sh text eol=lf
|
||||
|
||||
78
.github/CONTRIBUTING.md
vendored
@@ -1,78 +0,0 @@
|
||||
# Contributing to Lodash
|
||||
|
||||
Contributions are always welcome. Before contributing please read the
|
||||
[code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md)
|
||||
& [search the issue tracker](https://github.com/lodash/lodash/issues); your issue
|
||||
may have already been discussed or fixed in `master`. To contribute,
|
||||
[fork](https://help.github.com/articles/fork-a-repo/) Lodash, commit your changes,
|
||||
& [send a pull request](https://help.github.com/articles/using-pull-requests/).
|
||||
|
||||
## Feature Requests
|
||||
|
||||
Feature requests should be submitted in the
|
||||
[issue tracker](https://github.com/lodash/lodash/issues), with a description of
|
||||
the expected behavior & use case, where they’ll remain closed until sufficient interest,
|
||||
[e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/),
|
||||
has been shown by the community. Before submitting a request, please search for
|
||||
similar ones in the
|
||||
[closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
For additions or bug fixes you should only need to modify `lodash.js`. Include
|
||||
updated unit tests in the `test` directory as part of your pull request. Don’t
|
||||
worry about regenerating the `dist/` or `doc/` files.
|
||||
|
||||
Before running the unit tests you’ll need to install, `npm i`,
|
||||
[development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
|
||||
Run unit tests from the command-line via `npm test`, or open `test/index.html` &
|
||||
`test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) &
|
||||
[Underscore](http://underscorejs.org/) test suites are included as well.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Lodash is a member of the [jQuery Foundation](https://jquery.org/).
|
||||
As such, we request that all contributors sign the jQuery Foundation
|
||||
[contributor license agreement (CLA)](https://contribute.jquery.org/CLA/).
|
||||
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post,
|
||||
[“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
In addition to the following guidelines, please follow the conventions already
|
||||
established in the code.
|
||||
|
||||
- **Spacing**:<br>
|
||||
Use two spaces for indentation. No tabs.
|
||||
|
||||
- **Naming**:<br>
|
||||
Keep variable & method names concise & descriptive.<br>
|
||||
Variable names `index`, `collection`, & `callback` are preferable to
|
||||
`i`, `arr`, & `fn`.
|
||||
|
||||
- **Quotes**:<br>
|
||||
Single-quoted strings are preferred to double-quoted strings; however,
|
||||
please use a double-quoted string if the value contains a single-quote
|
||||
character to avoid unnecessary escaping.
|
||||
|
||||
- **Comments**:<br>
|
||||
Please use single-line comments to annotate significant additions, &
|
||||
[JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for
|
||||
functions.
|
||||
|
||||
Guidelines are enforced using [JSCS](https://www.npmjs.com/package/jscs):
|
||||
```bash
|
||||
$ npm run style
|
||||
```
|
||||
|
||||
## Tips
|
||||
|
||||
You can opt-in to a pre-push git hook by adding an `.opt-in` file to the root of
|
||||
the project containing:
|
||||
```txt
|
||||
pre-push
|
||||
```
|
||||
|
||||
With that, when you `git push`, the pre-push git hook will trigger and execute
|
||||
`npm run validate`.
|
||||
11
.gitignore
vendored
@@ -1,9 +1,10 @@
|
||||
.DS_Store
|
||||
*.custom.*
|
||||
*.log
|
||||
*.template.*
|
||||
*.map
|
||||
lodash.compat.min.js
|
||||
coverage
|
||||
/*.min.*
|
||||
modularize
|
||||
node_modules
|
||||
.opt-in
|
||||
.opt-out
|
||||
dist/*.backbone.*
|
||||
dist/*.legacy.*
|
||||
dist/*.mobile.*
|
||||
|
||||
96
.jscsrc
@@ -1,96 +0,0 @@
|
||||
{
|
||||
"maxErrors": "2000",
|
||||
"maximumLineLength": {
|
||||
"value": 180,
|
||||
"allExcept": ["comments", "functionSignature", "regex"]
|
||||
},
|
||||
"requireCurlyBraces": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"=",
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!==",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<="
|
||||
],
|
||||
"requireSpaceAfterKeywords": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"switch",
|
||||
"return",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
|
||||
"&=", "|=", "^=", "+=",
|
||||
|
||||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
|
||||
"|", "^", "&&", "||", "===", "==", ">=",
|
||||
"<=", "<", ">", "!=", "!=="
|
||||
],
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"requireDotNotation": { "allExcept": ["keywords"] },
|
||||
"requireEarlyReturn": true,
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"requireSemicolons": true,
|
||||
"requireSpaceAfterBinaryOperators": true,
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireSpacesInForStatement": true,
|
||||
|
||||
"validateIndentation": 2,
|
||||
"validateParameterSeparator": ", ",
|
||||
"validateQuoteMarks": { "mark": "'", "escape": true },
|
||||
|
||||
"disallowSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowKeywords": ["with"],
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowMultipleLineBreaks": true,
|
||||
"disallowNewlineBeforeBlockStatements": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||
"disallowSpacesInCallExpression": true,
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"disallowTrailingWhitespace": true,
|
||||
|
||||
"jsDoc": {
|
||||
"checkRedundantAccess": true,
|
||||
"checkTypes": true,
|
||||
"requireNewlineAfterDescription": true,
|
||||
"requireParamDescription": true,
|
||||
"requireParamTypes": true,
|
||||
"requireReturnTypes": true
|
||||
}
|
||||
}
|
||||
86
.travis.yml
@@ -1,77 +1,35 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "5"
|
||||
- "0.6"
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
env:
|
||||
global:
|
||||
- BIN="node" ISTANBUL=false OPTION=""
|
||||
- SAUCE_LABS=false SAUCE_USERNAME="lodash"
|
||||
- secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
|
||||
- BIN="node" BUILD=false MAKE=false
|
||||
matrix:
|
||||
-
|
||||
- BIN="phantomjs"
|
||||
- ISTANBUL=true
|
||||
- SAUCE_LABS=true
|
||||
- BUILD="compat"
|
||||
- BUILD="modern"
|
||||
- BUILD="legacy" MAKE=true
|
||||
- BUILD="mobile" MAKE=true
|
||||
- BIN="phantomjs" BUILD="compat"
|
||||
- BIN="phantomjs" BUILD="legacy" MAKE=true
|
||||
- BIN="phantomjs" BUILD="mobile" MAKE=true
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "0.10"
|
||||
env:
|
||||
- node_js: "0.12"
|
||||
env:
|
||||
- node_js: "4"
|
||||
env:
|
||||
env: BIN="istanbul"
|
||||
git:
|
||||
depth: 10
|
||||
depth: 1
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
|
||||
on_success: change
|
||||
on_failure: always
|
||||
before_install:
|
||||
- "nvm use $TRAVIS_NODE_VERSION"
|
||||
- "npm set loglevel error"
|
||||
- "npm set progress false"
|
||||
- "npm i -g npm@\"^2.0.0\""
|
||||
- |
|
||||
PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|"
|
||||
PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|"
|
||||
PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
|
||||
PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|"
|
||||
PATTERN[4]="|\bcase\s+(?:dataView|set|map|weakMap)CtorString:.+|g"
|
||||
PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
|
||||
PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
|
||||
PATTERN[7]="|\s*define\([\s\S]+?\);|"
|
||||
PATTERN[8]="|\s*root\._\s*=\s*_;|"
|
||||
|
||||
if [ $ISTANBUL == true ]; then
|
||||
set -e
|
||||
for PTRN in ${PATTERN[@]}; do
|
||||
node ./test/remove.js "$PTRN" ./lodash.js
|
||||
done
|
||||
fi
|
||||
- "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../"
|
||||
- "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
|
||||
before_script:
|
||||
- "npm install -g istanbul"
|
||||
script:
|
||||
- "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js"
|
||||
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true"
|
||||
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true"
|
||||
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test"
|
||||
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js"
|
||||
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
|
||||
- "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash"
|
||||
- "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./node_modules/lodash && node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/lodash.js)"
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
|
||||
- "[ $SAUCE_LABS == false ] || npm run build"
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash-fp tests\" runner=\"test/fp.html?noglobals=true\" tags=\"development\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.js\" tags=\"development,underscore\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.min.js\" tags=\"production,underscore\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.js\" tags=\"development,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.min.js\" tags=\"production,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.js\" tags=\"development,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.min.js\" tags=\"production,backbone\""
|
||||
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
||||
- "[ $MAKE != false ] && git clone --depth=1 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
|
||||
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
||||
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
||||
- "[ $BUILD != false ] && cd ./test || true"
|
||||
- "[ $BUILD != false ] && $BIN ./test.js ../dist/lodash.$BUILD.js || true"
|
||||
- "[ $BUILD != false ] && $BIN ./test.js ../dist/lodash.$BUILD.min.js || true"
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [coc@lodash.com](mailto:coc@lodash.com).
|
||||
The project team will review and investigate all complaints, and will respond in
|
||||
a way that it deems appropriate to the circumstances. The project team is obligated
|
||||
to maintain confidentiality with regard to the reporter of an incident. Further
|
||||
details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
35
CONTRIBUTING.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Contributing to Lo-Dash
|
||||
|
||||
If you’d like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
|
||||
Please make sure to [search the issue tracker](https://github.com/lodash/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
|
||||
|
||||
## Tests
|
||||
|
||||
Include updated unit tests in the `test` directory as part of your pull request.
|
||||
You can run the tests from the command line via `node test/test`, or open `test/index.html` in a web browser.
|
||||
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
|
||||
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
|
||||
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
|
||||
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post, [“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
In addition to the following guidelines, please follow the conventions already established in the code.
|
||||
|
||||
- **Spacing**:<br>
|
||||
Use two spaces for indentation. No tabs.
|
||||
|
||||
- **Naming**:<br>
|
||||
Keep variable and method names concise and descriptive.<br>
|
||||
Variable names `index`, `collection`, and `callback` are preferable to `i`, `arr`, and `fn`.
|
||||
|
||||
- **Quotes**:<br>
|
||||
Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.
|
||||
|
||||
- **Comments**:<br>
|
||||
Please use single-line comments to annotate significant additions, and [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for new methods.
|
||||
@@ -1,17 +1,7 @@
|
||||
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
|
||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/lodash/lodash
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
@@ -29,19 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
Copyright and related rights for sample code are waived via CC0. Sample
|
||||
code is defined as all source code displayed within the prose of the
|
||||
documentation.
|
||||
|
||||
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
====
|
||||
|
||||
Files located in the node_modules and vendor directories are externally
|
||||
maintained libraries used by this software which have their own
|
||||
licenses; we recommend you read them, as their terms may differ from the
|
||||
terms above.
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
170
README.md
@@ -1,52 +1,142 @@
|
||||
# lodash v4.9.0
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module.
|
||||
|
||||
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
||||
```bash
|
||||
$ npm run build
|
||||
$ lodash -o ./dist/lodash.js
|
||||
$ lodash core -o ./dist/lodash.core.js
|
||||
```
|
||||
|
||||
## Community
|
||||
|
||||
[](https://gitter.im/lodash/lodash)
|
||||
|
||||
## Documentation
|
||||
|
||||
* [API Documentation](https://lodash.com/docs)
|
||||
* [FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide)
|
||||
# Lo-Dash v2.1.0
|
||||
A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
|
||||
|
||||
## Download
|
||||
|
||||
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.9.0/LICENSE) & supports [modern environments](#support).<br>
|
||||
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one that’s right for you.
|
||||
* Modern builds perfect for newer browsers/environments:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.min.js)
|
||||
|
||||
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.9.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.9.0/dist/lodash.core.min.js))
|
||||
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.9.0/dist/lodash.js) ([~21 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.9.0/dist/lodash.min.js))
|
||||
* [CDN copies](https://www.jsdelivr.com/projects/lodash)
|
||||
* Compatibility builds for older environment support too:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.compat.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.compat.min.js)
|
||||
|
||||
## Why Lodash?
|
||||
* Underscore builds to use as a drop-in replacement:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.underscore.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.1.0/dist/lodash.underscore.min.js)
|
||||
|
||||
Lodash makes JavaScript easier by taking the hassle out of working with arrays,<br>
|
||||
numbers, objects, strings, etc. Lodash’s modular methods are great for:
|
||||
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash).<br>
|
||||
For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed.<br>
|
||||
Love modules? We’ve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-node](https://npmjs.org/package/lodash-node), and [npm packages](https://npmjs.org/browse/author/jdalton) per method.
|
||||
|
||||
* Iterating arrays, objects, & strings
|
||||
* Manipulating & testing values
|
||||
* Creating composite functions
|
||||
## Dive in
|
||||
|
||||
## Module Formats
|
||||
There’s plenty of [documentation](http://lodash.com/docs), [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).<br>
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).<br>
|
||||
The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).
|
||||
|
||||
Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
|
||||
## Features *not* in Underscore
|
||||
|
||||
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
|
||||
* [lodash-amd](https://www.npmjs.com/package/lodash-amd)
|
||||
* [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash)
|
||||
* [lodash/fp](https://github.com/lodash/lodash/tree/4.9.0-npm/fp)
|
||||
* AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.)
|
||||
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
|
||||
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
|
||||
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
|
||||
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex`
|
||||
* [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
|
||||
* [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
|
||||
* [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept `options` for more control
|
||||
* [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys
|
||||
* [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early
|
||||
* [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties
|
||||
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties
|
||||
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
|
||||
* [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions
|
||||
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior
|
||||
* [_.partialRight](http://lodash.com/docs#partialRight) for [partial application](http://lodash.com/docs#partial) from the right
|
||||
* [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays
|
||||
* [_.random](http://lodash.com/docs#random) supports returning floating-point numbers
|
||||
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking
|
||||
* [_.support](http://lodash.com/docs#support) for flagging environment features
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6)
|
||||
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.zip](http://lodash.com/docs#zip) is capable of unzipping values
|
||||
* [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), &
|
||||
[more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
|
||||
* [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), &
|
||||
[more](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings
|
||||
* [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), &
|
||||
[more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
|
||||
* [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), &
|
||||
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight") right-associative methods
|
||||
|
||||
## Further Reading
|
||||
## Resources
|
||||
|
||||
* [Contributing](https://github.com/lodash/lodash/blob/4.9.0/.github/CONTRIBUTING.md)
|
||||
* [Release Notes](https://github.com/lodash/lodash/releases/tag/4.0.0)
|
||||
* [Wiki (Changelog, Roadmap, etc.)](https://github.com/lodash/lodash/wiki)
|
||||
* Posts
|
||||
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
|
||||
- [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/)
|
||||
|
||||
* Videos
|
||||
- [Introduction](https://vimeo.com/44154599)
|
||||
- [Origins](https://vimeo.com/44154600)
|
||||
- [Optimizations & builds](https://vimeo.com/44154601)
|
||||
- [Native method use](https://vimeo.com/48576012)
|
||||
- [Testing](https://vimeo.com/45865290)
|
||||
- [CascadiaJS ’12](http://www.youtube.com/watch?v=dpPy4f_SeEk)
|
||||
|
||||
## Support
|
||||
|
||||
Tested in Chrome 5~29, Firefox 2~24, IE 6-10, Opera 9.25~16, Safari 3-6, Node.js 0.6.8-0.10.18, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.
|
||||
|
||||
## Installation & usage
|
||||
|
||||
In browsers:
|
||||
|
||||
```html
|
||||
<script src="lodash.js"></script>
|
||||
```
|
||||
|
||||
Using [`npm`](http://npmjs.org/):
|
||||
|
||||
```bash
|
||||
npm i --save lodash
|
||||
|
||||
{sudo} npm i -g lodash
|
||||
npm ln lodash
|
||||
```
|
||||
|
||||
In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var _ = require('lodash');
|
||||
// or as Underscore
|
||||
var _ = require('lodash/dist/lodash.underscore');
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
* Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL
|
||||
* If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it
|
||||
* Node.js 0.10.8-0.10.11 [have](https://github.com/joyent/node/issues/5622) [bugs](https://github.com/joyent/node/issues/5688) preventing minified builds
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
```js
|
||||
load('lodash.js');
|
||||
```
|
||||
|
||||
In an AMD loader:
|
||||
|
||||
```js
|
||||
require({
|
||||
'packages': [
|
||||
{ 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
|
||||
]
|
||||
},
|
||||
['lodash'], function(_) {
|
||||
console.log(_.VERSION);
|
||||
});
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
| [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
| [](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](http://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|---|---|
|
||||
| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||
|
||||
23
bower.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "2.1.0",
|
||||
"main": "dist/lodash.compat.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.template.*",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"/*.min.*",
|
||||
"/lodash.js",
|
||||
"index.js",
|
||||
"component.json",
|
||||
"package.json",
|
||||
"doc",
|
||||
"modularize",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
12
component.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"repo": "lodash/lodash",
|
||||
"version": "2.1.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"license": "MIT",
|
||||
"keywords": ["amd", "browser", "client", "customize", "functional", "performance", "server", "speed", "util"],
|
||||
"scripts": [
|
||||
"index.js",
|
||||
"dist/lodash.compat.js"
|
||||
]
|
||||
}
|
||||
6694
dist/lodash.compat.js
vendored
Normal file
56
dist/lodash.compat.min.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.1.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
*/
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.k,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:_+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.k,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:_+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=!0
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.l,r=t.l;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.m-t.m}function o(n){var t=-1,r=n.length,u=n[0],o=n[0|r/2],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return!1;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=l(),o.b=n,o.k=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Q[n]}function i(){return y.pop()||[]}function l(){return m.pop()||{a:"",b:null,c:"",k:null,configurable:!1,l:null,enumerable:!1,"false":!1,d:"",m:0,e:"",v:null,leading:!1,g:"",maxWait:0,"null":!1,number:null,z:null,push:null,h:null,string:null,i:"",trailing:!1,"true":!1,undefined:!1,j:!1,n:null,writable:!1}
|
||||
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(){}function p(n){n.length=0,y.length<j&&y.push(n)}function s(n){var t=n.k;t&&s(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=null,m.length<j&&m.push(n)}function g(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function h(e){function y(n){return n&&typeof n=="object"&&!qe(n)&&ve.call(n,"__wrapped__")?n:new m(n)}function m(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function j(n,t,e,r,u){var o=n;if(e){if(o=e(o),typeof o!="undefined")return o;o=n}var a=mt(o);if(a){var l=we.call(o);if(!U[l]||!Le.nodeClass&&f(o))return o;var c=qe(o)}if(!a||!t)return a?c?g(o):Ye({},o):o;switch(a=$e[l],l){case T:case q:return new a(+o);case G:case H:return new a(o);case M:return a(o.source,A.exec(o))}l=!r,r||(r=i()),u||(u=i());for(var s=r.length;s--;)if(r[s]==n)return u[s];return o=c?a(o.length):{},c&&(ve.call(n,"index")&&(o.index=n.index),ve.call(n,"input")&&(o.input=n.input)),r.push(n),u.push(o),(c?Xe:tr)(n,function(n,a){o[a]=j(n,t,e,r,u)
|
||||
}),l&&(p(r),p(u)),o}function Q(n,t,e){if(typeof n!="function")return Gt;if(typeof t=="undefined")return n;var r=n.__bindData__||Le.funcNames&&!n.name;if(typeof r=="undefined"){var u=P&&ge.call(n);Le.funcNames||!u||I.test(u)||(r=!0),(Le.funcNames||!r)&&(r=!Le.funcDecomp||P.test(u),Te(n,r))}if(true!==r&&r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)
|
||||
}}return qt(n,t)}function Y(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(qe(a)||st(a))){t||(a=Y(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function Z(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&V[typeof n]||t&&V[typeof t]))return!1;if(null==n||null==t)return n===t;var l=we.call(n),c=we.call(t);if(l==z&&(l=J),c==z&&(c=J),l!=c)return!1;
|
||||
switch(l){case T:case q:return+n==+t;case G:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case M:case H:return n==ee(t)}if(c=l==L,!c){if(ve.call(n,"__wrapped__")||ve.call(t,"__wrapped__"))return Z(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(l!=J||!Le.nodeClass&&(f(n)||f(t)))return!1;var l=!Le.argsObject&&st(n)?ne:n.constructor,s=!Le.argsObject&&st(t)?ne:t.constructor;if(l!=s&&!(yt(l)&&l instanceof l&&yt(s)&&s instanceof s))return!1}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;
|
||||
var g=0,a=!0;if(u.push(n),o.push(t),c){if(l=n.length,g=t.length,a=g==n.length,!a&&!r)return a;for(;g--;)if(c=l,s=t[g],r)for(;c--&&!(a=Z(n[c],s,e,r,u,o)););else if(!(a=Z(n[g],s,e,r,u,o)))break;return a}return nr(t,function(t,i,l){return ve.call(l,i)?(g++,a=ve.call(n,i)&&Z(n[i],t,e,r,u,o)):void 0}),a&&!r&&nr(n,function(n,t,e){return ve.call(e,t)?a=-1<--g:void 0}),s&&(p(u),p(o)),a}function tt(n,t,e,r,u){(qe(t)?Ct:tr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=qe(t))||er(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
|
||||
break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?qe(f)?f:[]:er(f)?f:{}),r.push(t),u.push(f),c||tt(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function rt(e,r,u){var a=-1,l=ft(),f=e?e.length:0,c=[],g=!r&&f>=w&&l===n,h=u||g?i():c;if(g){var v=o(h);v?(l=t,h=v):(g=!1,h=u?h:(p(h),c))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),c.push(v))}return g?(p(h.b),s(h)):u&&p(h),c}function ut(n){return function(t,e,r){var u={};
|
||||
if(e=y.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Xe(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function ot(n,t,e,r,u,o){var a=1&t,i=2&t,l=4&t,f=8&t,c=16&t,p=32&t,s=n;if(!i&&!yt(n))throw new re;c&&!e.length&&(t&=-17,c=e=!1),p&&!r.length&&(t&=-33,p=r=!1);var g=n&&n.__bindData__;if(g)return!a||1&g[1]||(g[4]=u),!a&&1&g[1]&&(t|=8),!l||4&g[1]||(g[5]=o),c&&ye.apply(g[2]||(g[2]=[]),e),p&&ye.apply(g[3]||(g[3]=[]),r),g[1]|=t,ot.apply(null,g);if(!a||i||l||p||!(Le.fastBind||ke&&c))v=function(){var g=arguments,h=a?u:this;
|
||||
return(l||c||p)&&(g=Pe.call(g),c&&je.apply(g,e),p&&ye.apply(g,r),l&&g.length<o)?(t|=16,ot(n,f?t:-4&t,g,null,u,o)):(i&&(n=h[s]),this instanceof v?(h=it(n.prototype),g=n.apply(h,g),mt(g)?g:h):n.apply(h,g))};else{if(c){var h=[u];ye.apply(h,e)}var v=c?ke.apply(n,h):ke.call(n,u)}return Te(v,Pe.call(arguments)),v}function at(){var n=l();n.h=$,n.b=n.c=n.g=n.i="",n.e="t",n.j=!0;for(var t,e=0;t=arguments[e];e++)for(var r in t)n[r]=t[r];e=n.a,n.d=/^[^,]+/.exec(e)[0],t=Xt,e="return function("+e+"){",r="var n,t="+n.d+",E="+n.e+";if(!t)return E;"+n.i+";",n.b?(r+="var u=t.length;n=-1;if("+n.b+"){",Le.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+n.g+";}}else{"):Le.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+n.g+";}}else{"),Le.enumPrototypes&&(r+="var G=typeof t=='function';"),Le.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");
|
||||
var u=[];if(Le.enumPrototypes&&u.push('!(G&&n=="prototype")'),Le.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),n.j&&n.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=n.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",n.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=n.g+";",u.length&&(r+="}"),r+="}",Le.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+n.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",n.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+n.g+"}";
|
||||
r+="}"}return(n.b||Le.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t=t("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",e+r+"}"),s(n),t(Q,K,oe,ve,b,st,qe,bt,n.f,ae,V,ze,H,ie,we)}function it(n){return mt(n)?Ce(n):{}}function lt(n){return He[n]}function ft(){var t=(t=y.indexOf)===Rt?n:t;return t}function ct(n){var t,e;return!n||we.call(n)!=J||(t=n.constructor,yt(t)&&!(t instanceof t))||!Le.argsClass&&st(n)||!Le.nodeClass&&f(n)?!1:Le.ownLast?(nr(n,function(n,t,r){return e=ve.call(r,t),!1}),false!==e):(nr(n,function(n,t){e=t
|
||||
}),typeof e=="undefined"||ve.call(n,e))}function pt(n){return Ue[n]}function st(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n)==z||!1}function gt(n,t,e){var r=We(n),u=r.length;for(t=Q(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function ht(n){var t=[];return nr(n,function(n,e){yt(n)&&t.push(e)}),t.sort()}function vt(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function yt(n){return typeof n=="function"}function mt(n){return!(!n||!V[typeof n])
|
||||
}function dt(n){return typeof n=="number"||we.call(n)==G}function bt(n){return typeof n=="string"||we.call(n)==H}function _t(n){for(var t=-1,e=We(n),r=e.length,u=Ut(r);++t<r;)u[t]=n[e[t]];return u}function wt(n,t,e){var r=-1,u=ft(),o=n?n.length:0,a=!1;return e=(0>e?Ie(0,o+e):e)||0,qe(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(bt(n)?n.indexOf(t,e):u(n,t,e)):Xe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function jt(n,t,e){var r=!0;if(t=y.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Xe(n,function(n,e,u){return r=!!t(n,e,u)
|
||||
});return r}function xt(n,t,e){var r=[];if(t=y.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function kt(n,t,e){if(t=y.createCallback(t,e,3),!qe(n)){var r;return Xe(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 Ct(n,t,e){if(t&&typeof e=="undefined"&&qe(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Xe(n,t,e);
|
||||
return n}function Et(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:Q(t,e,3),qe(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=We(n),u=o.length;else Le.unindexedChars&&bt(n)&&(r=n.split(""));Xe(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Ot(n,t,e){var r=-1,u=n?n.length:0,o=Ut(typeof u=="number"?u:0);if(t=y.createCallback(t,e,3),qe(n))for(;++r<u;)o[r]=t(n[r],r,n);else Xe(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function St(n,t,e){var u=-1/0,o=u;
|
||||
if(!t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&bt(n)?r:y.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function At(n,t,e,r){var u=3>arguments.length;if(t=Q(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Xe(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)});return e}function It(n,t,e,r){var u=3>arguments.length;return t=Q(t,r,4),Et(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Nt(n){var t=-1,e=n?n.length:0,r=Ut(typeof e=="number"?e:0);
|
||||
return Ct(n,function(n){var e=Mt(++t);r[t]=r[e],r[e]=n}),r}function Bt(n,t,e){var r;if(t=y.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Xe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Dt(e){var r=-1,u=ft(),a=e?e.length:0,i=Y(arguments,!0,!0,1),l=[],f=a>=w&&u===n;if(f){var c=o(i);c?(u=t,i=c):f=!1}for(;++r<a;)c=e[r],0>u(i,c)&&l.push(c);return f&&s(i),l}function Pt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++
|
||||
}else if(r=t,null==r||e)return n?n[0]:v;return g(n,0,Ne(Ie(0,r),u))}function Rt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ie(0,u+r):r||0}else if(r)return r=$t(t,e),t[r]===e?r:-1;return n(t,e,r)}function Ft(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ie(0,t);return g(n,r)}function $t(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?y.createCallback(e,r,1):Gt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
|
||||
return u}function zt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(e=y.createCallback(e,r,3)),rt(n,t,e)}function Lt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?St(ar(n,"length")):0,r=Ut(0>e?0:e);++t<e;)r[t]=ar(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function qt(n,t){return 2<arguments.length?ot(n,17,Pe.call(arguments,2),null,t):ot(n,1,null,null,t)}function Kt(n,t,e){function r(){c&&pe(c),a=c=p=v,(h||g!==t)&&(s=+new Qt,i=n.apply(f,o))
|
||||
}function u(){var e=t-(new Qt-l);0<e?c=be(u,e):(a&&pe(a),e=p,a=c=p=v,e&&(s=+new Qt,i=n.apply(f,o)))}var o,a,i,l,f,c,p,s=0,g=!1,h=!0;if(!yt(n))throw new re;if(t=Ie(0,t)||0,true===e)var y=!0,h=!1;else mt(e)&&(y=e.leading,g="maxWait"in e&&(Ie(t,e.maxWait)||0),h="trailing"in e?e.trailing:h);return function(){if(o=arguments,l=+new Qt,f=this,p=h&&(c||!y),false===g)var e=y&&!c;else{a||y||(s=l);var v=g-(l-s);0<v?a||(a=be(r,v)):(a&&(a=pe(a)),s=l,i=n.apply(f,o))}return c||t===g||(c=be(u,t)),e&&(i=n.apply(f,o)),i
|
||||
}}function Wt(n){if(!yt(n))throw new re;var t=Pe.call(arguments,1);return be(function(){n.apply(v,t)},1)}function Gt(n){return n}function Jt(n,t){var e=n,r=!t||yt(e);t||(e=m,t=n,n=y),Ct(ht(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return ye.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:new e(r)})})}function Mt(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r=De(),e||n%1||t%1?n+Ne(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+se(r*(t-n+1))
|
||||
}function Ht(){return this.__wrapped__}e=e?et.defaults(X.Object(),e,et.pick(X,F)):X;var Ut=e.Array,Vt=e.Boolean,Qt=e.Date,Xt=e.Function,Yt=e.Math,Zt=e.Number,ne=e.Object,te=e.RegExp,ee=e.String,re=e.TypeError,ue=[],oe=e.Error.prototype,ae=ne.prototype,ie=ee.prototype,le=e._,fe=te("^"+ee(ae.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ce=Yt.ceil,pe=e.clearTimeout,se=Yt.floor,ge=Xt.prototype.toString,he=fe.test(he=ne.getPrototypeOf)&&he,ve=ae.hasOwnProperty,ye=ue.push,me=ae.propertyIsEnumerable,de=e.setImmediate,be=e.setTimeout,_e=ue.splice,we=ae.toString,je=ue.unshift,xe=function(){try{var n={},t=fe.test(t=ne.defineProperty)&&t,e=t(n,n,n)&&t
|
||||
}catch(r){}return e}(),ke=fe.test(ke=we.bind)&&ke,Ce=fe.test(Ce=ne.create)&&Ce,Ee=fe.test(Ee=Ut.isArray)&&Ee,Oe=e.isFinite,Se=e.isNaN,Ae=fe.test(Ae=ne.keys)&&Ae,Ie=Yt.max,Ne=Yt.min,Be=e.parseInt,De=Yt.random,Pe=ue.slice,Re=fe.test(e.attachEvent),Fe=ke&&!/\n|true/.test(ke+Re),$e={};$e[L]=Ut,$e[T]=Vt,$e[q]=Qt,$e[W]=Xt,$e[J]=ne,$e[G]=Zt,$e[M]=te,$e[H]=ee;var ze={};ze[L]=ze[q]=ze[G]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},ze[T]=ze[H]={constructor:!0,toString:!0,valueOf:!0},ze[K]=ze[W]=ze[M]={constructor:!0,toString:!0},ze[J]={constructor:!0},function(){for(var n=$.length;n--;){var t,e=$[n];
|
||||
for(t in ze)ve.call(ze,t)&&!ve.call(ze[t],e)&&(ze[t][e]=!1)}}(),m.prototype=y.prototype;var Le=y.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};for(var u in new n)r.push(u);for(u in arguments);Le.argsClass=we.call(arguments)==z,Le.argsObject=arguments.constructor==ne&&!(arguments instanceof Ut),Le.enumErrorProps=me.call(oe,"message")||me.call(oe,"name"),Le.enumPrototypes=me.call(n,"prototype"),Le.fastBind=ke&&!Fe,Le.funcDecomp=!fe.test(e.o)&&P.test(h),Le.funcNames=typeof Xt.name=="string",Le.nonEnumArgs=0!=u,Le.nonEnumShadows=!/valueOf/.test(r),Le.ownLast="x"!=r[0],Le.spliceObjects=(ue.splice.call(t,0,1),!t[0]),Le.unindexedChars="xx"!="x"[0]+ne("x")[0];
|
||||
try{Le.nodeClass=!(we.call(document)==J&&!({toString:0}+""))}catch(o){Le.nodeClass=!0}}(1),y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:y}},Ce||(it=function(n){if(mt(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}});var Te=xe?function(n,t){var e=l();e.value=t,xe(n,"__bindData__",e),s(e)}:c;Le.argsClass||(st=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n,"callee")||!1});var qe=Ee||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n)==L||!1
|
||||
},Ke=at({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ae?function(n){return mt(n)?Le.enumPrototypes&&typeof n=="function"||Le.nonEnumArgs&&n.length&&st(n)?Ke(n):Ae(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:We,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Me={i:"if(!B[typeof t])return E;"+Ge.i,b:!1},He={"&":"&","<":"<",">":">",'"':""","'":"'"},Ue=vt(He),Ve=te("("+We(Ue).join("|")+")","g"),Qe=te("["+We(He).join("")+"]","g"),Xe=at(Ge),Ye=at(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=at(Je),nr=at(Ge,Me,{j:!1}),tr=at(Ge,Me);
|
||||
yt(/x/)&&(yt=function(n){return typeof n=="function"&&we.call(n)==W});var er=he?function(n){if(!n||we.call(n)!=J||!Le.argsClass&&st(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=he(t))&&he(e);return e?n==e||he(n)==e:ct(n)}:ct,rr=ut(function(n,t,e){ve.call(n,e)?n[e]++:n[e]=1}),ur=ut(function(n,t,e){(ve.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ut(function(n,t,e){n[e]=t}),ar=Ot;Fe&&nt&&typeof de=="function"&&(Wt=function(n){if(!yt(n))throw new re;return de.apply(e,arguments)});var ir=8==Be(x+"08")?Be:function(n,t){return Be(bt(n)?n.replace(B,""):n,t||0)
|
||||
};return y.after=function(n,t){if(!yt(t))throw new re;return function(){return 1>--n?t.apply(this,arguments):void 0}},y.assign=Ye,y.at=function(n){var t=arguments,e=-1,r=Y(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Ut(t);for(Le.unindexedChars&&bt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},y.bind=qt,y.bindAll=function(n){for(var t=1<arguments.length?Y(arguments,!0,!1,1):ht(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=ot(n[u],1,null,null,n)}return n},y.bindKey=function(n,t){return 2<arguments.length?ot(t,19,Pe.call(arguments,2),null,n):ot(t,3,null,null,n)
|
||||
},y.chain=function(n){return n=new m(n),n.__chain__=!0,n},y.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},y.compose=function(){for(var n=arguments,t=n.length;t--;)if(!yt(n[t]))throw new re;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},y.countBy=rr,y.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return Q(n,t,e);if("object"!=r)return function(t){return t[n]};var u=We(n),o=u[0],a=n[o];
|
||||
return 1!=u.length||a!==a||mt(a)?function(t){for(var e=u.length,r=!1;e--&&(r=Z(t[u[e]],n[u[e]],null,!0)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},y.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,ot(n,4,null,null,null,t)},y.debounce=Kt,y.defaults=Ze,y.defer=Wt,y.delay=function(n,t){if(!yt(n))throw new re;var e=Pe.call(arguments,2);return be(function(){n.apply(v,e)},t)},y.difference=Dt,y.filter=xt,y.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(n=Ot(n,e,r)),Y(n,t)
|
||||
},y.forEach=Ct,y.forEachRight=Et,y.forIn=nr,y.forInRight=function(n,t,e){var r=[];nr(n,function(n,t){r.push(t,n)});var u=r.length;for(t=Q(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},y.forOwn=tr,y.forOwnRight=gt,y.functions=ht,y.groupBy=ur,y.indexBy=or,y.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return g(n,0,Ne(Ie(0,u-r),u))},y.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,c=ft(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
|
||||
l[a]=c===n&&(y?y.length:0)>=w&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):c(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):c(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&s(m);return p(l),p(v),h},y.invert=vt,y.invoke=function(n,t){var e=Pe.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Ut(typeof o=="number"?o:0);return Ct(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},y.keys=We,y.map=Ot,y.max=St,y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):_+arguments[0];
|
||||
return ve.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!yt(n))throw new re;return e.cache={},e},y.merge=function(n){var t=arguments,e=2;if(!mt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Q(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Pe.call(arguments,1,e),u=-1,o=i(),a=i();++u<e;)tt(n,t[u],r,o,a);return p(o),p(a),n},y.min=function(n,t,e){var u=1/0,o=u;if(!t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&bt(n)?r:y.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
|
||||
});return o},y.omit=function(n,t,e){var r=ft(),u=typeof t=="function",o={};if(u)t=y.createCallback(t,e,3);else var a=Y(arguments,!0,!1,1);return nr(n,function(n,e,i){(u?!t(n,e,i):0>r(a,e))&&(o[e]=n)}),o},y.once=function(n){var t,e;if(!yt(n))throw new re;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},y.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Ut(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},y.partial=function(n){return ot(n,16,Pe.call(arguments,1))},y.partialRight=function(n){return ot(n,32,null,Pe.call(arguments,1))
|
||||
},y.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=Y(arguments,!0,!1,1),a=mt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=y.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},y.pluck=ar,y.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(_e.call(n,o--,1),u--);return n},y.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ie(0,ce((t-n)/(e||1)));
|
||||
for(var u=Ut(t);++r<t;)u[r]=n,n+=e;return u},y.reject=function(n,t,e){return t=y.createCallback(t,e,3),xt(n,function(n,e,r){return!t(n,e,r)})},y.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=y.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),_e.call(n,r--,1),u--);return o},y.rest=Ft,y.shuffle=Nt,y.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=Ut(typeof o=="number"?o:0);for(t=y.createCallback(t,e,3),Ct(n,function(n,e,u){var o=a[++r]=l();o.l=t(n,e,u),o.m=r,o.n=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.n,s(n);
|
||||
return a},y.tap=function(n,t){return t(n),n},y.throttle=function(n,t,e){var r=!0,u=!0;if(!yt(n))throw new re;return false===e?r=!1:mt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Kt(n,t,e),s(e),n},y.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ut(n);for(t=Q(t,e,1);++r<n;)u[r]=t(r);return u},y.toArray=function(n){return n&&typeof n.length=="number"?Le.unindexedChars&&bt(n)?n.split(""):g(n):_t(n)},y.transform=function(n,t,e,r){var u=qe(n);
|
||||
return t=Q(t,r,4),null==e&&(u?e=[]:(r=n&&n.constructor,e=it(r&&r.prototype))),(u?Xe:tr)(n,function(n,r,u){return t(e,n,r,u)}),e},y.union=function(){return rt(Y(arguments,!0,!0))},y.uniq=zt,y.values=_t,y.where=xt,y.without=function(n){return Dt(n,Pe.call(arguments,1))},y.wrap=function(n,t){if(!yt(t))throw new re;return function(){var e=[n];return ye.apply(e,arguments),t.apply(this,e)}},y.zip=Lt,y.zipObject=Tt,y.collect=Ot,y.drop=Ft,y.each=Ct,y.p=Et,y.extend=Ye,y.methods=ht,y.object=Tt,y.select=xt,y.tail=Ft,y.unique=zt,y.unzip=Lt,Jt(y),y.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),j(n,t,typeof e=="function"&&Q(e,r,1))
|
||||
},y.cloneDeep=function(n,t,e){return j(n,!0,typeof t=="function"&&Q(t,e,1))},y.contains=wt,y.escape=function(n){return null==n?"":ee(n).replace(Qe,lt)},y.every=jt,y.find=kt,y.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=y.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},y.findKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),tr(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.findLast=function(n,t,e){var r;return t=y.createCallback(t,e,3),Et(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0
|
||||
}),r},y.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=y.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},y.findLastKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),gt(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.has=function(n,t){return n?ve.call(n,t):!1},y.identity=Gt,y.indexOf=Rt,y.isArguments=st,y.isArray=qe,y.isBoolean=function(n){return true===n||false===n||we.call(n)==T},y.isDate=function(n){return n?typeof n=="object"&&we.call(n)==q:!1},y.isElement=function(n){return n?1===n.nodeType:!1
|
||||
},y.isEmpty=function(n){var t=!0;if(!n)return t;var e=we.call(n),r=n.length;return e==L||e==H||(Le.argsClass?e==z:st(n))||e==J&&typeof r=="number"&&yt(n.splice)?!r:(tr(n,function(){return t=!1}),t)},y.isEqual=function(n,t,e,r){return Z(n,t,typeof e=="function"&&Q(e,r,2))},y.isFinite=function(n){return Oe(n)&&!Se(parseFloat(n))},y.isFunction=yt,y.isNaN=function(n){return dt(n)&&n!=+n},y.isNull=function(n){return null===n},y.isNumber=dt,y.isObject=mt,y.isPlainObject=er,y.isRegExp=function(n){return n&&V[typeof n]?we.call(n)==M:!1
|
||||
},y.isString=bt,y.isUndefined=function(n){return typeof n=="undefined"},y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ie(0,r+e):Ne(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},y.mixin=Jt,y.noConflict=function(){return e._=le,this},y.parseInt=ir,y.random=Mt,y.reduce=At,y.reduceRight=It,y.result=function(n,t){if(n){var e=n[t];return yt(e)?n[t]():e}},y.runInContext=h,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},y.some=Bt,y.sortedIndex=$t,y.template=function(n,t,e){var r=y.templateSettings;
|
||||
n||(n=""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=_t(o),i=0,l=e.interpolate||D,f="__p+='",l=te((e.escape||D).source+"|"+l.source+"|"+(l===N?S:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(R,a),e&&(f+="'+__e("+e+")+'"),l&&(u=!0,f+="';"+l+";__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';\n",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(C,""):f).replace(E,"$1").replace(O,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";
|
||||
try{var c=Xt(r,"return "+f).apply(v,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.unescape=function(n){return null==n?"":ee(n).replace(Ve,pt)},y.uniqueId=function(n){var t=++d;return ee(null==n?"":n)+t},y.all=jt,y.any=Bt,y.detect=kt,y.findWhere=kt,y.foldl=At,y.foldr=It,y.include=wt,y.inject=At,tr(y,function(n,t){y.prototype[t]||(y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return ye.apply(t,arguments),t=n.apply(y,t),e?new m(t,e):t})}),y.first=Pt,y.last=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return g(n,Ie(0,u-r))},y.sample=function(n,t,e){var r=n?n.length:0;return typeof r!="number"?n=_t(n):Le.unindexedChars&&bt(n)&&(n=n.split("")),null==t||e?n?n[Mt(r-1)]:v:(n=Nt(n),n.length=Ne(Ie(0,t),n.length),n)},y.take=Pt,y.head=Pt,tr(y,function(n,t){var e="sample"!==t;y.prototype[t]||(y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new m(o,u):o
|
||||
})}),y.VERSION="2.1.0",y.prototype.chain=function(){return this.__chain__=!0,this},y.prototype.toString=function(){return ee(this.__wrapped__)},y.prototype.value=Ht,y.prototype.valueOf=Ht,Xe(["join","pop","shift"],function(n){var t=ue[n];y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new m(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=ue[n];y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=ue[n];
|
||||
y.prototype[n]=function(){return new m(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Le.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=ue[n],e="splice"==n;y.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new m(u,n):u}}),y}var v,y=[],m=[],d=0,b={},_=+new Date+"",w=75,j=40,x=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",C=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,O=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,I=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,B=RegExp("^["+x+"]*0+(?=.$)"),D=/($^)/,P=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),z="[object Arguments]",L="[object Array]",T="[object Boolean]",q="[object Date]",K="[object Error]",W="[object Function]",G="[object Number]",J="[object Object]",M="[object RegExp]",H="[object String]",U={};
|
||||
U[W]=!1,U[z]=U[L]=U[T]=U[q]=U[G]=U[J]=U[M]=U[H]=!0;var V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=V[typeof window]&&window||this,Y=V[typeof exports]&&exports&&!exports.nodeType&&exports,Z=V[typeof module]&&module&&!module.nodeType&&module,nt=Z&&Z.exports===Y&&Y,tt=V[typeof global]&&global;!tt||tt.global!==tt&&tt.window!==tt||(X=tt);var et=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(X._=et, define(function(){return et
|
||||
})):Y&&Z?nt?(Z.exports=et)._=et:Y._=et:X._=et}).call(this);
|
||||
4000
dist/lodash.core.js
vendored
30
dist/lodash.core.min.js
vendored
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.9.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* Build: `lodash core -o ./dist/lodash.core.js`
|
||||
*/
|
||||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===pn?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return w(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return gn[n]}function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{
|
||||
t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||yn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){return n instanceof l?n:new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function s(n){return Z(n)?Bn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){
|
||||
n.apply(pn,r)},t)}function v(n,t){var r=true;return Cn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return Cn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function g(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=C),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?g(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function b(n,t){return n&&Gn(n,t,on)}function _(n,t){return y(t,function(t){return X(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Z(n)&&!nn(t)?n!==n&&t!==t:d(n,t,j,r,e,u);
|
||||
}function d(n,t,r,e,u,o){var i=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";i||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t),l=a==l;o||(o=[]);var s=M(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=i||isTypedArray(n)?I(n,t,r,e,u,o):$(n,t,a),o.pop(),r):2&u||(i=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!i&&!a)?l?(r=q(n,t,r,e,u,o),
|
||||
o.pop(),r):false:(i=i?n.value():n,t=a?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?x:E)(n)}function O(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=W(n)?Array(n.length):[];return Cn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],pn,3)))return false}return true}}function A(n,t){
|
||||
return n=Object(n),U(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?pn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function N(n){return k(n,0,n.length)}function S(n,t){var r;return Cn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function T(t,r){return U(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function F(n,t,r,e){r||(r={});
|
||||
for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function R(n){return H(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=s(n.prototype),t=n.apply(r,t);return Z(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==xn&&this instanceof e?u:n;++c<f;)a[c]=r[c];
|
||||
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function I(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==pn){a=false;break}if(c){if(!S(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function $(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
|
||||
return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function q(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),
|
||||
a}function z(n){var t=n?n.length:pn;if(Y(t)&&(Vn(n)||rn(n)||Q(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function C(n){return nn(n)&&W(n)&&(Vn(n)||Q(n))}function G(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function J(n){return n?n[0]:pn}function M(n,t){return r(n,m(t),Cn)}function P(n,t){return Cn(n,m(t))}function U(n,t,r){return e(n,m(t),r,3>arguments.length,Cn)}function V(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");
|
||||
return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function H(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function K(){if(!arguments.length)return[];var n=arguments[0];return Vn(n)?n:[n]}function L(n,t){return n>t}function Q(n){return nn(n)&&W(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n));
|
||||
}function W(n){return null!=n&&Y(Jn(n))&&!X(n)}function X(n){return n=Z(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Y(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Z(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function nn(n){return!!n&&typeof n=="object"}function tn(n){return typeof n=="number"||nn(n)&&"[object Number]"==Sn.call(n)}function rn(n){return typeof n=="string"||!Vn(n)&&nn(n)&&"[object String]"==Sn.call(n)}function en(n,t){
|
||||
return t>n}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=G(n);if(!t&&!W(n))return $n(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=G(n),e=O(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!kn.call(n,a))||o.push(a)}return o}function fn(n){return n?u(n,on(n)):[]}function an(n){return n;
|
||||
}function ln(t,r,e){var u=on(r),o=_(r,u);null!=e||Z(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=_(r,on(r)));var i=Z(e)&&"chain"in e?e.chain:true,c=X(t);return Cn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={
|
||||
"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,jn=bn[typeof module]&&module&&!module.nodeType?module:pn,dn=jn&&jn.exports===_n?_n:pn,mn=o(bn[typeof self]&&self),On=o(bn[typeof window]&&window),wn=o(bn[typeof this]&&this),xn=o(_n&&jn&&typeof global=="object"&&global)||On!==(wn&&wn.window)&&On||mn||wn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=xn._,Fn=xn.Reflect,Rn=Fn?Fn.f:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=xn.isFinite,$n=Object.keys,qn=Math.max,zn=!Dn.call({
|
||||
valueOf:1},"valueOf");l.prototype=s(a.prototype),l.prototype.constructor=l;var Cn=function(n,t){return function(r,e){if(null==r)return r;if(!W(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(b),Gn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(O=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);
|
||||
return r});var Jn=E("length"),Mn=H(function(n,t,r){return D(n,t,r)}),Pn=H(function(n,t){return h(n,1,t)}),Un=H(function(n,t,r){return h(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=R(function(n,t){F(t,on(t),n)}),Qn=R(function(n,t){F(t,cn(t),n)}),Wn=R(function(n,t,r,e){F(t,cn(t),n,e)}),Xn=H(function(n){return n.push(pn,p),Wn.apply(pn,n)}),Yn=H(function(n,t){return null==n?{}:A(n,g(t,1))}),Zn=m;a.assignIn=Qn,a.before=V,a.bind=Mn,a.chain=function(n){return n=a(n),n.__chain__=true,n},a.compact=function(n){
|
||||
return y(n,Boolean)},a.concat=function(){var t=arguments.length,r=K(arguments[0]);if(2>t)return t?N(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return g(e,1),n(N(r),fn)},a.create=function(n,t){var r=s(n);return t?Ln(r,t):r},a.defaults=Xn,a.defer=Pn,a.delay=Un,a.filter=function(n,t){return y(n,m(t))},a.flatten=function(n){return n&&n.length?g(n,1):[]},a.flattenDeep=function(n){return n&&n.length?g(n,sn):[]},a.iteratee=Zn,a.keys=on,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){
|
||||
return x(Ln({},n))},a.mixin=ln,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return V(2,n)},a.pick=Yn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===pn,i=r===r,c=null===e,f=e===pn,a=e===e;
|
||||
if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return W(n)?n.length?N(n):[]:fn(n)},a.values=fn,a.extend=Qn,ln(a,a),a.clone=function(n){return Z(n)?Vn(n)?N(n):F(n,on(n)):n},a.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,i):n},a.every=function(n,t,r){return t=r?pn:t,v(n,m(t))},a.find=M,a.forEach=P,a.has=function(n,t){return null!=n&&kn.call(n,t);
|
||||
},a.head=J,a.identity=an,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=Q,a.isArray=Vn,a.isBoolean=function(n){return true===n||false===n||nn(n)&&"[object Boolean]"==Sn.call(n)},a.isDate=function(n){return nn(n)&&"[object Date]"==Sn.call(n)},a.isEmpty=function(n){if(W(n)&&(Vn(n)||rn(n)||X(n.splice)||Q(n)))return!n.length;for(var t in n)if(kn.call(n,t))return false;return!(zn&&on(n).length);
|
||||
},a.isEqual=function(n,t){return j(n,t)},a.isFinite=function(n){return typeof n=="number"&&In(n)},a.isFunction=X,a.isNaN=function(n){return tn(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=tn,a.isObject=Z,a.isRegExp=function(n){return Z(n)&&"[object RegExp]"==Sn.call(n)},a.isString=rn,a.isUndefined=function(n){return n===pn},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},a.max=function(n){return n&&n.length?t(n,an,L):pn},a.min=function(n){return n&&n.length?t(n,an,en):pn},
|
||||
a.noConflict=function(){return xn._===this&&(xn._=Tn),this},a.noop=function(){},a.reduce=U,a.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),X(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=W(n)?n:on(n),n.length)},a.some=function(n,t,r){return t=r?pn:t,S(n,m(t))},a.uniqueId=function(n){var t=++Nn;return un(n)+t},a.each=P,a.first=J,ln(a,function(){var n={};return b(a,function(t,r){kn.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.9.0",Cn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
|
||||
var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);a.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return T(this.__wrapped__,this.__actions__)},(On||mn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
|
||||
return a}):_n&&jn?(dn&&((jn.exports=a)._=a),_n._=a):xn._=a}).call(this);
|
||||
860
dist/lodash.fp.js
vendored
@@ -1,860 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["fp"] = factory();
|
||||
else
|
||||
root["fp"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var baseConvert = __webpack_require__(1);
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Function} lodash The lodash function to convert.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function browserConvert(lodash, options) {
|
||||
return baseConvert(lodash, lodash, options);
|
||||
}
|
||||
|
||||
if (typeof _ == 'function') {
|
||||
_ = browserConvert(_.runInContext());
|
||||
}
|
||||
module.exports = browserConvert;
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 1 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var mapping = __webpack_require__(2),
|
||||
mutateMap = mapping.mutate,
|
||||
fallbackHolder = __webpack_require__(3);
|
||||
|
||||
/**
|
||||
* Creates a function, with an arity of `n`, that invokes `func` with the
|
||||
* arguments it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} n The arity of the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseArity(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func.apply(undefined, arguments); }
|
||||
: function(a) { return func.apply(undefined, arguments); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
|
||||
* any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseAry(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func(a, b); }
|
||||
: function(a) { return func(a); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to clone.
|
||||
* @returns {Array} Returns the cloned array.
|
||||
*/
|
||||
function cloneArray(array) {
|
||||
var length = array ? array.length : 0,
|
||||
result = Array(length);
|
||||
|
||||
while (length--) {
|
||||
result[length] = array[length];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that clones a given object using the assignment `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The assignment function.
|
||||
* @returns {Function} Returns the new cloner function.
|
||||
*/
|
||||
function createCloner(func) {
|
||||
return function(object) {
|
||||
return func({}, object);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and uses `cloner` to clone the first
|
||||
* argument it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {Function} cloner The function to clone arguments.
|
||||
* @returns {Function} Returns the new immutable function.
|
||||
*/
|
||||
function immutWrap(func, cloner) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var result = args[0] = cloner.apply(undefined, args);
|
||||
func.apply(undefined, args);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `convert` which accepts a `util` object of methods
|
||||
* required to perform conversions.
|
||||
*
|
||||
* @param {Object} util The util object.
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||
* @param {boolean} [options.curry=true] Specify currying.
|
||||
* @param {boolean} [options.fixed=true] Specify fixed arity.
|
||||
* @param {boolean} [options.immutable=true] Specify immutable operations.
|
||||
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function baseConvert(util, name, func, options) {
|
||||
var setPlaceholder,
|
||||
isLib = typeof name == 'function',
|
||||
isObj = name === Object(name);
|
||||
|
||||
if (isObj) {
|
||||
options = func;
|
||||
func = name;
|
||||
name = undefined;
|
||||
}
|
||||
if (func == null) {
|
||||
throw new TypeError;
|
||||
}
|
||||
options || (options = {});
|
||||
|
||||
var config = {
|
||||
'cap': 'cap' in options ? options.cap : true,
|
||||
'curry': 'curry' in options ? options.curry : true,
|
||||
'fixed': 'fixed' in options ? options.fixed : true,
|
||||
'immutable': 'immutable' in options ? options.immutable : true,
|
||||
'rearg': 'rearg' in options ? options.rearg : true
|
||||
};
|
||||
|
||||
var forceCurry = ('curry' in options) && options.curry,
|
||||
forceFixed = ('fixed' in options) && options.fixed,
|
||||
forceRearg = ('rearg' in options) && options.rearg,
|
||||
placeholder = isLib ? func : fallbackHolder,
|
||||
pristine = isLib ? func.runInContext() : undefined;
|
||||
|
||||
var helpers = isLib ? func : {
|
||||
'ary': util.ary,
|
||||
'assign': util.assign,
|
||||
'clone': util.clone,
|
||||
'curry': util.curry,
|
||||
'forEach': util.forEach,
|
||||
'isArray': util.isArray,
|
||||
'isFunction': util.isFunction,
|
||||
'iteratee': util.iteratee,
|
||||
'keys': util.keys,
|
||||
'rearg': util.rearg,
|
||||
'spread': util.spread,
|
||||
'toPath': util.toPath
|
||||
};
|
||||
|
||||
var ary = helpers.ary,
|
||||
assign = helpers.assign,
|
||||
clone = helpers.clone,
|
||||
curry = helpers.curry,
|
||||
each = helpers.forEach,
|
||||
isArray = helpers.isArray,
|
||||
isFunction = helpers.isFunction,
|
||||
keys = helpers.keys,
|
||||
rearg = helpers.rearg,
|
||||
spread = helpers.spread,
|
||||
toPath = helpers.toPath;
|
||||
|
||||
var aryMethodKeys = keys(mapping.aryMethod);
|
||||
|
||||
var wrappers = {
|
||||
'castArray': function(castArray) {
|
||||
return function() {
|
||||
var value = arguments[0];
|
||||
return isArray(value)
|
||||
? castArray(cloneArray(value))
|
||||
: castArray.apply(undefined, arguments);
|
||||
};
|
||||
},
|
||||
'iteratee': function(iteratee) {
|
||||
return function() {
|
||||
var func = arguments[0],
|
||||
arity = arguments[1],
|
||||
result = iteratee(func, arity),
|
||||
length = result.length;
|
||||
|
||||
if (config.cap && typeof arity == 'number') {
|
||||
arity = arity > 2 ? (arity - 2) : 1;
|
||||
return (length && length <= arity) ? result : baseAry(result, arity);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
},
|
||||
'mixin': function(mixin) {
|
||||
return function(source) {
|
||||
var func = this;
|
||||
if (!isFunction(func)) {
|
||||
return mixin(func, Object(source));
|
||||
}
|
||||
var methods = [],
|
||||
methodNames = [];
|
||||
|
||||
each(keys(source), function(key) {
|
||||
var value = source[key];
|
||||
if (isFunction(value)) {
|
||||
methodNames.push(key);
|
||||
methods.push(func.prototype[key]);
|
||||
}
|
||||
});
|
||||
|
||||
mixin(func, Object(source));
|
||||
|
||||
each(methodNames, function(methodName, index) {
|
||||
var method = methods[index];
|
||||
if (isFunction(method)) {
|
||||
func.prototype[methodName] = method;
|
||||
} else {
|
||||
delete func.prototype[methodName];
|
||||
}
|
||||
});
|
||||
return func;
|
||||
};
|
||||
},
|
||||
'runInContext': function(runInContext) {
|
||||
return function(context) {
|
||||
return baseConvert(util, runInContext(context), options);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a clone of `object` by `path`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to clone.
|
||||
* @param {Array|string} path The path to clone by.
|
||||
* @returns {Object} Returns the cloned object.
|
||||
*/
|
||||
function cloneByPath(object, path) {
|
||||
path = toPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
result = clone(Object(object)),
|
||||
nested = result;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = path[index],
|
||||
value = nested[key];
|
||||
|
||||
if (value != null) {
|
||||
nested[key] = clone(Object(value));
|
||||
}
|
||||
nested = nested[key];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function convertLib(options) {
|
||||
return _.runInContext.convert(options)(undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a converter function for `func` of `name`.
|
||||
*
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @returns {Function} Returns the new converter function.
|
||||
*/
|
||||
function createConverter(name, func) {
|
||||
var oldOptions = options;
|
||||
return function(options) {
|
||||
var newUtil = isLib ? pristine : helpers,
|
||||
newFunc = isLib ? pristine[name] : func,
|
||||
newOptions = assign(assign({}, oldOptions), options);
|
||||
|
||||
return baseConvert(newUtil, name, newFunc, newOptions);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
|
||||
* arguments, ignoring any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap iteratee arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeAry(func, n) {
|
||||
return overArg(func, function(func) {
|
||||
return typeof func == 'function' ? baseAry(func, n) : func;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee with arguments
|
||||
* arranged according to the specified `indexes` where the argument value at
|
||||
* the first index is provided as the first argument, the argument value at
|
||||
* the second index is provided as the second argument, and so on.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to rearrange iteratee arguments for.
|
||||
* @param {number[]} indexes The arranged argument indexes.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeRearg(func, indexes) {
|
||||
return overArg(func, function(func) {
|
||||
var n = indexes.length;
|
||||
return baseArity(rearg(baseAry(func, n), indexes), n);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with its first argument passed
|
||||
* thru `transform`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...Function} transform The functions to transform the first argument.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function overArg(func, transform) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return func();
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var index = config.rearg ? 0 : (length - 1);
|
||||
args[index] = transform(args[index]);
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and applys the conversions
|
||||
* rules by `name`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} func The function to wrap.
|
||||
* @returns {Function} Returns the converted function.
|
||||
*/
|
||||
function wrap(name, func) {
|
||||
name = mapping.aliasToReal[name] || name;
|
||||
|
||||
var result,
|
||||
wrapped = func,
|
||||
wrapper = wrappers[name];
|
||||
|
||||
if (wrapper) {
|
||||
wrapped = wrapper(func);
|
||||
}
|
||||
else if (config.immutable) {
|
||||
if (mutateMap.array[name]) {
|
||||
wrapped = immutWrap(func, cloneArray);
|
||||
}
|
||||
else if (mutateMap.object[name]) {
|
||||
wrapped = immutWrap(func, createCloner(func));
|
||||
}
|
||||
else if (mutateMap.set[name]) {
|
||||
wrapped = immutWrap(func, cloneByPath);
|
||||
}
|
||||
}
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(otherName) {
|
||||
if (name == otherName) {
|
||||
var aryN = !isLib && mapping.iterateeAry[name],
|
||||
reargIndexes = mapping.iterateeRearg[name],
|
||||
spreadStart = mapping.methodSpread[name];
|
||||
|
||||
result = wrapped;
|
||||
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||
result = spreadStart === undefined
|
||||
? ary(result, aryKey)
|
||||
: spread(result, spreadStart);
|
||||
}
|
||||
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
|
||||
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
|
||||
}
|
||||
if (config.cap) {
|
||||
if (reargIndexes) {
|
||||
result = iterateeRearg(result, reargIndexes);
|
||||
} else if (aryN) {
|
||||
result = iterateeAry(result, aryN);
|
||||
}
|
||||
}
|
||||
if (forceCurry || (config.curry && aryKey > 1)) {
|
||||
forceCurry && console.log(forceCurry, name);
|
||||
result = curry(result, aryKey);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
result || (result = wrapped);
|
||||
if (result == func) {
|
||||
result = forceCurry ? curry(result, 1) : function() {
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
result.convert = createConverter(name, func);
|
||||
if (mapping.placeholder[name]) {
|
||||
setPlaceholder = true;
|
||||
result.placeholder = func.placeholder = placeholder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (!isObj) {
|
||||
return wrap(name, func);
|
||||
}
|
||||
var _ = func;
|
||||
|
||||
// Convert methods by ary cap.
|
||||
var pairs = [];
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(key) {
|
||||
var func = _[mapping.remap[key] || key];
|
||||
if (func) {
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Convert remaining methods.
|
||||
each(keys(_), function(key) {
|
||||
var func = _[key];
|
||||
if (typeof func == 'function') {
|
||||
var length = pairs.length;
|
||||
while (length--) {
|
||||
if (pairs[length][0] == key) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
func.convert = createConverter(key, func);
|
||||
pairs.push([key, func]);
|
||||
}
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
_.convert = convertLib;
|
||||
if (setPlaceholder) {
|
||||
_.placeholder = placeholder;
|
||||
}
|
||||
// Assign aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.realToAlias[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
module.exports = baseConvert;
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 2 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'mapObj': 'mapValues',
|
||||
'omitAll': 'omit',
|
||||
'nAry': 'ary',
|
||||
'path': 'get',
|
||||
'pathEq': 'matchesProperty',
|
||||
'pathOr': 'getOr',
|
||||
'pickAll': 'pick',
|
||||
'pipe': 'flow',
|
||||
'prop': 'get',
|
||||
'propOf': 'propertyOf',
|
||||
'propOr': 'getOr',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy',
|
||||
'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight',
|
||||
'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range',
|
||||
'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result',
|
||||
'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex',
|
||||
'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith',
|
||||
'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap',
|
||||
'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart',
|
||||
'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without',
|
||||
'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 3 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/**
|
||||
* The default argument placeholder value for methods.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = {};
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
16
dist/lodash.fp.min.js
vendored
@@ -1,16 +0,0 @@
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())),
|
||||
t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(!r)return i;for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n),
|
||||
i}}function u(t,e,r,d){function f(t,e){e=F(e);for(var r=-1,n=e.length,i=M(Object(t)),a=i;null!=a&&++r<n;){var o=e[r],s=a[o];null!=s&&(a[o]=M(Object(s))),a=a[o]}return i}function h(t){return N.runInContext.convert(t)(void 0)}function y(t,e){var r=d;return function(n){var i=R?B:j,a=R?B[t]:e,o=w(w({},r),n);return u(i,t,a,o)}}function g(t,e){return v(t,function(t){return"function"==typeof t?i(t,e):t})}function m(t,e){return v(t,function(t){var r=e.length;return n(L(i(t,r),e),r)})}function v(t,e){return function(){
|
||||
var r=arguments.length;if(!r)return t();for(var n=Array(r);r--;)n[r]=arguments[r];var i=I.rearg?0:r-1;return n[i]=e(n[i]),t.apply(void 0,n)}}function x(t,e){t=p.aliasToReal[t]||t;var r,n=e,i=_[t];return i?n=i(e):I.immutable&&(l.array[t]?n=s(e,a):l.object[t]?n=s(e,o(e)):l.set[t]&&(n=s(e,f))),P(T,function(e){return P(p.aryMethod[e],function(i){if(t==i){var a=!R&&p.iterateeAry[t],o=p.iterateeRearg[t],s=p.methodSpread[t];return r=n,!I.fixed||!O&&p.skipFixed[t]||(r=void 0===s?C(r,e):D(r,s)),I.rearg&&e>1&&(k||!p.skipRearg[t])&&(r=L(r,p.methodRearg[t]||p.aryRearg[e])),
|
||||
I.cap&&(o?r=m(r,o):a&&(r=g(r,a))),(b||I.curry&&e>1)&&(b&&console.log(b,t),r=q(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=b?q(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=E),r}var W,R="function"==typeof e,A=e===Object(e);if(A&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var I={cap:"cap"in d?d.cap:!0,curry:"curry"in d?d.curry:!0,fixed:"fixed"in d?d.fixed:!0,immutable:"immutable"in d?d.immutable:!0,rearg:"rearg"in d?d.rearg:!0
|
||||
},b="curry"in d&&d.curry,O="fixed"in d&&d.fixed,k="rearg"in d&&d.rearg,E=R?r:c,B=R?r.runInContext():void 0,j=R?r:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isFunction:t.isFunction,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,spread:t.spread,toPath:t.toPath},C=j.ary,w=j.assign,M=j.clone,q=j.curry,P=j.forEach,S=j.isArray,z=j.isFunction,K=j.keys,L=j.rearg,D=j.spread,F=j.toPath,T=K(p.aryMethod),_={castArray:function(t){return function(){var e=arguments[0];
|
||||
return S(e)?t(a(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],r=arguments[1],n=t(e,r),a=n.length;return I.cap&&"number"==typeof r?(r=r>2?r-2:1,a&&r>=a?n:i(n,r)):n}},mixin:function(t){return function(e){var r=this;if(!z(r))return t(r,Object(e));var n=[],i=[];return P(K(e),function(t){var a=e[t];z(a)&&(i.push(t),n.push(r.prototype[t]))}),t(r,Object(e)),P(i,function(t,e){var i=n[e];z(i)?r.prototype[t]=i:delete r.prototype[t]}),r}},runInContext:function(e){
|
||||
return function(r){return u(t,e(r),d)}}};if(!A)return x(e,r);var N=r,V=[];return P(T,function(t){P(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),P(K(N),function(t){var e=N[t];if("function"==typeof e){for(var r=V.length;r--;)if(V[r][0]==t)return;e.convert=y(t,e),V.push([t,e])}}),P(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=E),P(K(N),function(t){P(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),l=p.mutate,c=r(3);t.exports=u},function(t,e){e.aliasToReal={
|
||||
each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendWith:"assignInWith",first:"head",__:"placeholder",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",equals:"isEqual",identical:"eq",init:"initial",invertObj:"invert",juxt:"over",mapObj:"mapValues",omitAll:"omit",nAry:"ary",path:"get",
|
||||
pathEq:"matchesProperty",pathOr:"getOr",pickAll:"pick",pipe:"flow",prop:"get",propOf:"propertyOf",propOr:"getOr",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},e.aryMethod={1:["attempt","castArray","ceil","create","curry","curryRight","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"],
|
||||
2:["add","after","ary","assign","assignIn","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","minBy","multiply","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],
|
||||
3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],
|
||||
4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],getOr:[2,1,0],isEqualWith:[1,2,0],
|
||||
isMatchWith:[2,1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],updateWith:[3,1,2,0],zipWith:[1,2,0]},e.methodSpread={invokeArgs:2,invokeArgsMap:2,partial:1,partialRight:1,without:1},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,
|
||||
merge:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={curryN:"curry",curryRightN:"curryRight",getOr:"get",invokeArgs:"invoke",invokeArgsMap:"invokeMap",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",restFrom:"rest",
|
||||
spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,without:!0,zip:!0,zipObject:!0}},function(t,e){t.exports={}}])});
|
||||
20078
dist/lodash.js
vendored
171
dist/lodash.min.js
vendored
@@ -1,125 +1,52 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.9.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* Build: `lodash -o ./dist/lodash.js`
|
||||
* Lo-Dash 2.1.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
*/
|
||||
;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t.length;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t.length;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=-1,e=t.length;++r<e;)if(!n(t[r],r,t))return false;
|
||||
return true}function i(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function f(t,n){return!!t.length&&-1<d(t,n,0)}function c(t,n,r){for(var e=-1,u=t.length;++e<u;)if(r(n,t[e]))return true;return false}function a(t,n){for(var r=-1,e=t.length,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function l(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function s(t,n,r,e){var u=-1,o=t.length;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function h(t,n,r,e){
|
||||
var u=t.length;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function p(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return true;return false}function _(t,n,r){for(var e=-1,u=t.length;++e<u;){var o=t[e],i=n(o);if(null!=i&&(f===T?i===i:r(i,f)))var f=i,c=o}return c}function v(t,n,r,e){var u;return r(t,function(t,r,o){return n(t,r,o)?(u=e?r:t,false):void 0}),u}function g(t,n,r){for(var e=t.length,u=r?e:-1;r?u--:++u<e;)if(n(t[u],u,t))return u;return-1}function d(t,n,r){if(n!==n)return U(t,r);--r;for(var e=t.length;++r<e;)if(t[r]===n)return r;
|
||||
return-1}function y(t,n,r,e){--r;for(var u=t.length;++r<u;)if(e(t[r],n))return r;return-1}function b(t,n){var r=t?t.length:0;return r?m(t,n)/r:K}function x(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=false,t):n(r,t,u,o)}),r}function j(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].c;return t}function m(t,n){for(var r,e=-1,u=t.length;++e<u;){var o=n(t[e]);o!==T&&(r=r===T?o:r+o)}return r}function w(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function A(t,n){return a(n,function(n){return[n,t[n]];
|
||||
})}function O(t){return function(n){return t(n)}}function k(t,n){return a(n,function(n){return t[n]})}function E(t,n){for(var r=-1,e=t.length;++r<e&&-1<d(n,t[r],0););return r}function I(t,n){for(var r=t.length;r--&&-1<d(n,t[r],0););return r}function S(t){return t&&t.Object===Object?t:null}function R(t,n){if(t!==n){var r=null===t,e=t===T,u=t===t,o=null===n,i=n===T,f=n===n;if(t>n&&!o||!u||r&&!i&&f||e&&f)return 1;if(n>t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function W(t){return function(n,r){var e;
|
||||
return n===T&&r===T?0:(n!==T&&(e=n),r!==T&&(e=e===T?r:t(e,r)),e)}}function B(t){return Mt[t]}function C(t){return Lt[t]}function z(t){return"\\"+Ft[t]}function U(t,n,r){var e=t.length;for(n+=r?0:-1;r?n--:++n<e;){var u=t[n];if(u!==u)return n}return-1}function M(t){var n=false;if(null!=t&&typeof t.toString!="function")try{n=!!(t+"")}catch(r){}return n}function L(t,n){return t=typeof t=="number"||xt.test(t)?+t:-1,t>-1&&0==t%1&&(null==n?9007199254740991:n)>t}function $(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);
|
||||
return r}function D(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function F(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];i!==n&&"__lodash_placeholder__"!==i||(t[r]="__lodash_placeholder__",o[u++]=r)}return o}function N(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function P(t){if(!t||!St.test(t))return t.length;for(var n=It.lastIndex=0;It.test(t);)n++;return n}function Z(t){return $t[t]}function q(S){function xt(t){if(We(t)&&!ti(t)&&!(t instanceof kt)){
|
||||
if(t instanceof Ot)return t;if(du.call(t,"__wrapped__"))return Hr(t)}return new Ot(t)}function At(){}function Ot(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=T}function kt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mt(){}function Lt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function $t(t){var n=-1,r=t?t.length:0;
|
||||
for(this.__data__=new Lt;++n<r;)this.push(t[n])}function Dt(t,n){var r=t.__data__;return qr(n)?(r=r.__data__,"__lodash_hash_undefined__"===(typeof n=="string"?r.string:r.hash)[n]):r.has(n)}function Ft(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Zt(t,n){var r=Vt(t,n);return 0>r?false:(r==t.length-1?t.pop():zu.call(t,r,1),true)}function qt(t,n){var r=Vt(t,n);return 0>r?T:t[r][1]}function Vt(t,n){for(var r=t.length;r--;)if(je(t[r][0],n))return r;return-1}function Kt(t,n,r){
|
||||
var e=Vt(t,n);0>e?t.push([n,r]):t[e][1]=r}function Gt(t,n,r,e){return t===T||je(t,vu[r])&&!du.call(e,r)?n:t}function Ht(t,n,r){(r===T||je(t[n],r))&&(typeof n!="number"||r!==T||n in t)||(t[n]=r)}function Qt(t,n,r){var e=t[n];du.call(t,n)&&je(e,r)&&(r!==T||n in t)||(t[n]=r)}function Xt(t,n,r,e){return ao(t,function(t,u,o){n(e,t,r(t),o)}),e}function tn(t,n){return t&&ur(n,Je(n),t)}function nn(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r<u;)o[r]=e?T:Ve(t,n[r]);return o}function rn(t){return Oe(t)?t:[];
|
||||
}function en(t){return typeof t=="string"||Le(t)?t:t+""}function un(t){return ti(t)?t:xo(t)}function on(t,n,r){return t===t&&(r!==T&&(t=t>r?r:t),n!==T&&(t=n>t?n:t)),t}function fn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==T)return c;if(!Re(t))return t;if(o=ti(t)){if(c=Mr(t),!n)return er(t,c)}else{var a=zr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(ni(t))return Xn(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(M(t))return i?t:{};if(c=Lr(l?{}:t),!n)return ir(t,tn(c,t));
|
||||
}else{if(!Ut[a])return i?t:{};c=$r(t,a,fn,n)}}if(f||(f=new Ft),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?bn(t,Je,Cr):Je(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),Qt(c,o,fn(u,n,r,e,o,t,f))}),c}function cn(t){var n=Je(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===T&&!(o in Object(e))||!i(f))return false}return true}}function an(t){return Re(t)?Wu(t):{}}function ln(t,n,r){if(typeof t!="function")throw new pu("Expected a function");return Cu(function(){
|
||||
t.apply(T,r)},n)}function sn(t,n,r,e){var u=-1,o=f,i=true,l=t.length,s=[],h=n.length;if(!l)return s;r&&(n=a(n,O(r))),e?(o=c,i=false):n.length>=200&&(o=Dt,i=false,n=new $t(n));t:for(;++u<l;){var p=t[u],_=r?r(p):p;if(i&&_===_){for(var v=h;v--;)if(n[v]===_)continue t;s.push(p)}else o(n,_,e)||s.push(p)}return s}function hn(t,n){var r=true;return ao(t,function(t,e,u){return r=!!n(t,e,u)}),r}function pn(t,n){var r=[];return ao(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function _n(t,n,r,e,u){var o=-1,i=t.length;for(r||(r=Fr),
|
||||
u||(u=[]);++o<i;){var f=t[o];n>0&&r(f)?n>1?_n(f,n-1,r,e,u):l(u,f):e||(u[u.length]=f)}return u}function vn(t,n){return t&&so(t,n,Je)}function gn(t,n){return t&&ho(t,n,Je)}function dn(t,n){return i(n,function(n){return Ee(t[n])})}function yn(t,n){n=Zr(n,t)?[n]:un(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[n[r++]];return r&&r==e?t:T}function bn(t,n,r){return n=n(t),ti(t)?n:l(n,r(t))}function xn(t,n){return du.call(t,n)||typeof t=="object"&&n in t&&null===Lu(Object(t))}function jn(t,n){return n in Object(t);
|
||||
}function mn(t,n,r){for(var e=r?c:f,u=t[0].length,o=t.length,i=o,l=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=a(p,O(n))),s=Pu(p.length,s),l[i]=r||!n&&(120>u||120>p.length)?T:new $t(i&&p)}var p=t[0],_=-1,v=l[0];t:for(;++_<u&&s>h.length;){var g=p[_],d=n?n(g):g;if(v?!Dt(v,d):!e(h,d,r)){for(i=o;--i;){var y=l[i];if(y?!Dt(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function wn(t,n,r){var e={};return vn(t,function(t,u,o){n(e,r(t),u,o)}),e}function An(t,n,e){return Zr(n,t)||(n=un(n),
|
||||
t=Jr(t,n),n=ne(n)),n=null==t?t:t[n],null==n?T:r(n,t,e)}function On(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Re(t)&&!We(n))n=t!==t&&n!==n;else t:{var o=ti(t),i=ti(n),f="[object Array]",c="[object Array]";o||(f=zr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=zr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!M(t),i="[object Object]"==c&&!M(n);if((c=f==c)&&!a)u||(u=new Ft),n=o||$e(t)?kr(t,n,On,r,e,u):Er(t,n,f,On,r,e,u);else{if(!(2&e)&&(o=a&&du.call(t,"__wrapped__"),
|
||||
f=i&&du.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new Ft),n=On(t,n,r,e,u);break t}if(c)n:if(u||(u=new Ft),o=2&e,f=Je(t),i=f.length,c=Je(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:xn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{c=true,u.set(t,n);for(var s=o;++a<i;){var l=f[a],h=t[l],p=n[l];if(r)var _=o?r(p,h,l,n,t,u):r(h,p,l,t,n,u);if(_===T?h!==p&&!On(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(r=t.constructor,e=n.constructor,r!=e&&"constructor"in t&&"constructor"in n&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),
|
||||
u["delete"](t),n=c}}else n=false;else n=false}}return n}function kn(t,n,r,e){var u=r.length,o=u,i=!e;if(null==t)return!o;for(t=Object(t);u--;){var f=r[u];if(i&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return false}for(;++u<o;){var f=r[u],c=f[0],a=t[c],l=f[1];if(i&&f[2]){if(a===T&&!(c in t))return false}else{if(f=new Ft,e)var s=e(a,l,c,t,n,f);if(s===T?!On(l,a,e,3,f):!s)return false}}return true}function En(t){return typeof t=="function"?t:null==t?uu:typeof t=="object"?ti(t)?Wn(t[0],t[1]):Rn(t):cu(t)}function In(t){t=null==t?t:Object(t);
|
||||
var n,r=[];for(n in t)r.push(n);return r}function Sn(t,n){var r=-1,e=Ae(t)?Array(t.length):[];return ao(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function Rn(t){var n=Rr(t);return 1==n.length&&n[0][2]?Kr(n[0][0],n[0][1]):function(r){return r===t||kn(r,t,n)}}function Wn(t,n){return Zr(t)&&n===n&&!Re(n)?Kr(t,n):function(r){var e=Ve(r,t);return e===T&&e===n?Ge(r,t):On(n,e,T,3)}}function Bn(t,n,r,e,o){if(t!==n){if(!ti(n)&&!$e(n))var i=Ye(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Re(u)){o||(o=new Ft);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);
|
||||
if(h)Ht(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s,ti(s)||$e(s)?ti(l)?h=l:Oe(l)?h=er(l):(p=false,h=fn(s,true)):ze(s)||we(s)?we(l)?h=qe(l):!Re(l)||r&&Ee(l)?(p=false,h=fn(s,true)):h=l:p=false),a.set(s,h),p&&Bn(h,s,r,e,a),a["delete"](s),Ht(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u),Ht(t,f,c)})}}function Cn(t,n,r){var e=-1;return n=a(n.length?n:[uu],Sr()),t=Sn(t,function(t){return{a:a(n,function(n){return n(t)}),b:++e,c:t}}),j(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e<i;){
|
||||
var c=R(u[e],o[e]);if(c){e=f>e?c*("desc"==r[e]?-1:1):c;break t}}e=t.b-n.b}return e})}function zn(t,n){return t=Object(t),s(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Un(t,n){for(var r=-1,e=bn(t,Ye,yo),u=e.length,o={};++r<u;){var i=e[r],f=t[i];n(f,i)&&(o[i]=f)}return o}function Mn(t){return function(n){return null==n?T:n[t]}}function Ln(t){return function(n){return yn(n,t)}}function $n(t,n,r,e){var u=e?y:d,o=-1,i=n.length,f=t;for(r&&(f=a(t,O(r)));++o<i;)for(var c=0,l=n[o],l=r?r(l):l;-1<(c=u(f,l,c,e));)f!==t&&zu.call(f,c,1),
|
||||
zu.call(t,c,1);return t}function Dn(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(e==r||u!=o){var o=u;if(L(u))zu.call(t,u,1);else if(Zr(u,t))delete t[u];else{var u=un(u),i=Jr(t,u);null!=i&&delete i[ne(u)]}}}}function Fn(t,n){return t+Mu(qu()*(n-t+1))}function Nn(t,n){var r="";if(!t||1>n||n>9007199254740991)return r;do n%2&&(r+=t),(n=Mu(n/2))&&(t+=t);while(n);return r}function Pn(t,n,r,e){n=Zr(n,t)?[n]:un(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){var c=n[u];if(Re(f)){var a=r;if(u!=i){
|
||||
var l=f[c],a=e?e(l,c,f):T;a===T&&(a=null==l?L(n[u+1])?[]:{}:l)}Qt(f,c,a)}f=f[c]}return t}function Zn(t,n,r){var e=-1,u=t.length;for(0>n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e<u;)r[e]=t[e+n];return r}function qn(t,n){var r;return ao(t,function(t,e,u){return r=n(t,e,u),!r}),!!r}function Tn(t,n,r){var e=0,u=t?t.length:e;if(typeof n=="number"&&n===n&&2147483647>=u){for(;u>e;){var o=e+u>>>1,i=t[o];(r?n>=i:n>i)&&null!==i?e=o+1:u=o}return u}return Vn(t,n,uu,r)}function Vn(t,n,r,e){
|
||||
n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=n===T;o>u;){var a=Mu((u+o)/2),l=r(t[a]),s=l!==T,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?n>=l:n>l)?u=a+1:o=a}return Pu(o,4294967294)}function Kn(t,n){for(var r=0,e=t.length,u=t[0],o=n?n(u):u,i=o,f=1,c=[u];++r<e;)u=t[r],o=n?n(u):u,je(o,i)||(i=o,c[f++]=u);return c}function Gn(t,n,r){var e=-1,u=f,o=t.length,i=true,a=[],l=a;if(r)i=false,u=c;else if(o<200)l=n?[]:a;else{if(u=n?null:_o(t))return N(u);i=false,u=Dt,l=new $t}t:for(;++e<o;){
|
||||
var s=t[e],h=n?n(s):s;if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),a.push(s)}else u(l,h,r)||(l!==a&&l.push(h),a.push(s))}return a}function Jn(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?Zn(t,e?0:o,e?o+1:u):Zn(t,e?o+1:0,e?u:o)}function Yn(t,n){var r=t;return r instanceof kt&&(r=r.value()),s(n,function(t,n){return n.func.apply(n.thisArg,l([t],n.args))},r)}function Hn(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?l(sn(o,t[e],n,r),sn(t[e],o,n,r)):t[e];
|
||||
return o&&o.length?Gn(o,n,r):[]}function Qn(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;)r(i,t[e],o>e?n[e]:T);return i}function Xn(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function tr(t){var n=new t.constructor(t.byteLength);return new ku(n).set(new ku(t)),n}function nr(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Nu(o-i,0),l=Array(c+a);for(e=!e;++f<c;)l[f]=n[f];for(;++u<i;)(e||o>u)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function rr(t,n,r,e){
|
||||
var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Nu(o-f,0),s=Array(l+a);for(e=!e;++u<l;)s[u]=t[u];for(l=u;++c<a;)s[l+c]=n[c];for(;++i<f;)(e||o>u)&&(s[l+r[i]]=t[u++]);return s}function er(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function ur(t,n,r){return or(t,n,r)}function or(t,n,r,e){r||(r={});for(var u=-1,o=n.length;++u<o;){var i=n[u],f=e?e(r[i],t[i],i,r,t):t[i];Qt(r,i,f)}return r}function ir(t,n){return ur(t,Cr(t),n)}function fr(t,n){return function(r,u){var o=ti(r)?e:Xt,i=n?n():{};
|
||||
return o(r,t,Sr(u),i)}}function cr(t){return be(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:T,i=u>2?r[2]:T,o=typeof o=="function"?(u--,o):T;for(i&&Pr(r[0],r[1],i)&&(o=3>u?T:o,u=1),n=Object(n);++e<u;)(i=r[e])&&t(n,i,e,o);return n})}function ar(t,n){return function(r,e){if(null==r)return r;if(!Ae(r))return t(r,e);for(var u=r.length,o=n?u:-1,i=Object(r);(n?o--:++o<u)&&false!==e(i[o],o,i););return r}}function lr(t){return function(n,r,e){var u=-1,o=Object(n);e=e(n);for(var i=e.length;i--;){var f=e[t?i:++u];
|
||||
if(false===r(o[f],f,o))break}return n}}function sr(t,n,r){function e(){return(this&&this!==Jt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=_r(t);return e}function hr(t){return function(n){n=Te(n);var r=St.test(n)?n.match(It):T,e=r?r[0]:n.charAt(0);return n=r?r.slice(1).join(""):n.slice(1),e[t]()+n}}function pr(t){return function(n){return s(ru(nu(n)),t,"")}}function _r(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);
|
||||
case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var r=an(t.prototype),n=t.apply(r,n);return Re(n)?n:r}}function vr(t,n,e){function u(){for(var i=arguments.length,f=Array(i),c=i,a=Br(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:F(f,a),i-=c.length,e>i?wr(t,n,dr,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Jt&&this instanceof u?o:t,this,f);
|
||||
}var o=_r(t);return u}function gr(t){return be(function(n){n=_n(n,1);var r=n.length,e=r,u=Ot.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new pu("Expected a function");if(u&&!i&&"wrapper"==Ir(o))var i=new Ot([],true)}for(e=i?e:r;++e<r;)var o=n[e],u=Ir(o),f="wrapper"==u?vo(o):T,i=f&&Tr(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[Ir(f[0])].apply(i,f[3]):1==o.length&&Tr(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&ti(e)&&e.length>=200)return i.plant(e).value();
|
||||
for(var u=0,t=r?n[u].apply(this,t):e;++u<r;)t=n[u].call(this,t);return t}})}function dr(t,n,r,e,u,o,i,f,c,a){function l(){for(var d=arguments.length,y=d,b=Array(d);y--;)b[y]=arguments[y];if(_){var x,j=Br(l),y=b.length;for(x=0;y--;)b[y]===j&&x++}if(e&&(b=nr(b,e,u,_)),o&&(b=rr(b,o,i,_)),d-=x,_&&a>d)return j=F(b,j),wr(t,n,dr,l.placeholder,r,b,j,f,c,a-d);if(j=h?r:this,y=p?j[t]:t,d=b.length,f){x=b.length;for(var m=Pu(f.length,x),w=er(b);m--;){var A=f[m];b[m]=L(A,x)?w[A]:T}}else v&&d>1&&b.reverse();return s&&d>c&&(b.length=c),
|
||||
this&&this!==Jt&&this instanceof l&&(y=g||_r(y)),y.apply(j,b)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:_r(t);return l}function yr(t,n){return function(r,e){return wn(r,t,n(e))}}function br(t){return be(function(n){return n=a(_n(n,1,Nr),Sr()),be(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function xr(t,n){n=n===T?" ":n+"";var r=n.length;return 2>r?r?Nn(n,t):n:(r=Nn(n,Uu(t/P(n))),St.test(n)?r.match(It).slice(0,t).join(""):r.slice(0,t))}function jr(t,n,e,u){function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Jt&&this instanceof o?f:t;++a<l;)s[a]=u[a];
|
||||
for(;c--;)s[a++]=arguments[++n];return r(h,i?e:this,s)}var i=1&n,f=_r(t);return o}function mr(t){return function(n,r,e){e&&typeof e!="number"&&Pr(n,r,e)&&(r=e=T),n=Ze(n),n=n===n?n:0,r===T?(r=n,n=0):r=Ze(r)||0,e=e===T?r>n?1:-1:Ze(e)||0;var u=-1;r=Nu(Uu((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function wr(t,n,r,e,u,o,i,f,c,a){var l=8&n;f=f?er(f):T;var s=l?i:T;i=l?T:i;var h=l?o:T;return o=l?T:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(T,n),
|
||||
Tr(t)&&bo(r,n),r.placeholder=e,r}function Ar(t){var n=su[t];return function(t,r){if(t=Ze(t),r=Ne(r)){var e=(Te(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(Te(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Or(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new pu("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Nu(Ne(i),0),f=f===T?f:Ne(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:vo(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],
|
||||
n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?nr(e,r,h[4]):er(r),o[4]=e?F(o[3],"__lodash_placeholder__"):er(h[4])),(r=h[5])&&(e=o[5],o[5]=e?rr(e,r,h[6]):er(r),o[6]=e?F(o[5],"__lodash_placeholder__"):er(h[6])),(r=h[7])&&(o[7]=er(r)),128&t&&(o[8]=null==o[8]?h[8]:Pu(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Nu(o[9]-a,0),
|
||||
!f&&24&n&&(n&=-25),(h?po:bo)(n&&1!=n?8==n||16==n?vr(t,n,f):32!=n&&33!=n||u.length?dr.apply(T,o):jr(t,n,r,e):sr(t,n,r),o)}function kr(t,n,r,e,u,o){var i=-1,f=2&u,c=1&u,a=t.length,l=n.length;if(!(a==l||f&&l>a))return false;if(l=o.get(t))return l==n;for(l=true,o.set(t,n);++i<a;){var s=t[i],h=n[i];if(e)var _=f?e(h,s,i,n,t,o):e(s,h,i,t,n,o);if(_!==T){if(_)continue;l=false;break}if(c){if(!p(n,function(t){return s===t||r(s,t,e,u,o)})){l=false;break}}else if(s!==h&&!r(s,h,e,u,o)){l=false;break}}return o["delete"](t),l}
|
||||
function Er(t,n,r,e,u,o,i){switch(r){case"[object DataView]":if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)break;t=t.buffer,n=n.buffer;case"[object ArrayBuffer]":if(t.byteLength!=n.byteLength||!e(new ku(t),new ku(n)))break;return true;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object Error]":return t.name==n.name&&t.message==n.message;case"[object Number]":return t!=+t?n!=+n:t==+n;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var f=D;case"[object Set]":
|
||||
if(f||(f=N),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),kr(f(t),f(n),e,u,o,i));case"[object Symbol]":if(fo)return fo.call(t)==fo.call(n)}return false}function Ir(t){for(var n=t.name+"",r=to[n],e=du.call(to,n)?r.length:0;e--;){var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function Sr(){var t=xt.iteratee||ou,t=t===ou?En:t;return arguments.length?t(arguments[0],arguments[1]):t}function Rr(t){t=He(t);for(var n=t.length;n--;){var r=t[n][1];t[n][2]=r===r&&!Re(r)}return t;
|
||||
}function Wr(t,n){var r=t[n];return Be(r)?r:T}function Br(t){return(du.call(xt,"placeholder")?xt:t).placeholder}function Cr(t){return Su(Object(t))}function zr(t){return xu.call(t)}function Ur(t,n,r){n=Zr(n,t)?[n]:un(n);for(var e,u=-1,o=n.length;++u<o;){var i=n[u];if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&Se(o)&&L(i,o)&&(ti(t)||Me(t)||we(t)))}function Mr(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&du.call(t,"index")&&(r.index=t.index,r.input=t.input),
|
||||
r}function Lr(t){return typeof t.constructor!="function"||Vr(t)?{}:an(Lu(Object(t)))}function $r(r,e,u,o){var i=r.constructor;switch(e){case"[object ArrayBuffer]":return tr(r);case"[object Boolean]":case"[object Date]":return new i(+r);case"[object DataView]":return e=o?tr(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":
|
||||
case"[object Uint16Array]":case"[object Uint32Array]":return e=o?tr(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);case"[object Map]":return e=o?u(D(r),true):D(r),s(e,t,new r.constructor);case"[object Number]":case"[object String]":return new i(r);case"[object RegExp]":return e=new r.constructor(r.source,_t.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=o?u(N(r),true):N(r),s(e,n,new r.constructor);case"[object Symbol]":return fo?Object(fo.call(r)):{}}}function Dr(t){var n=t?t.length:T;
|
||||
return Se(n)&&(ti(t)||Me(t)||we(t))?w(n,String):null}function Fr(t){return Oe(t)&&(ti(t)||we(t))}function Nr(t){return ti(t)&&!(2==t.length&&!Ee(t[0]))}function Pr(t,n,r){if(!Re(r))return false;var e=typeof n;return("number"==e?Ae(r)&&L(n,r.length):"string"==e&&n in r)?je(r[n],t):false}function Zr(t,n){var r=typeof t;return"number"==r||"symbol"==r?true:!ti(t)&&(Le(t)||ot.test(t)||!ut.test(t)||null!=n&&t in Object(n))}function qr(t){var n=typeof t;return"number"==n||"boolean"==n||"string"==n&&"__proto__"!=t||null==t;
|
||||
}function Tr(t){var n=Ir(t),r=xt[n];return typeof r=="function"&&n in kt.prototype?t===r?true:(n=vo(r),!!n&&t===n[0]):false}function Vr(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||vu)}function Kr(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function Gr(t,n,r,e,u,o){return Re(t)&&Re(n)&&Bn(t,n,T,Gr,o.set(n,t)),t}function Jr(t,n){return 1==n.length?t:yn(t,Zn(n,0,-1))}function Yr(t){if(null!=t){try{return gu.call(t)}catch(n){}return t+""}return"";
|
||||
}function Hr(t){if(t instanceof kt)return t.clone();var n=new Ot(t.__wrapped__,t.__chain__);return n.__actions__=er(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function Qr(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ne(n),Zn(t,0>n?0:n,e)):[]}function Xr(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ne(n),n=e-n,Zn(t,0,0>n?0:n)):[]}function te(t){return t?t[0]:T}function ne(t){var n=t?t.length:0;return n?t[n-1]:T}function re(t,n){return t&&t.length&&n&&n.length?$n(t,n):t;
|
||||
}function ee(t){return t?Tu.call(t):t}function ue(t){if(!t||!t.length)return[];var n=0;return t=i(t,function(t){return Oe(t)?(n=Nu(t.length,n),true):void 0}),w(n,function(n){return a(t,Mn(n))})}function oe(t,n){if(!t||!t.length)return[];var e=ue(t);return null==n?e:a(e,function(t){return r(n,T,t)})}function ie(t){return t=xt(t),t.__chain__=true,t}function fe(t,n){return n(t)}function ce(){return this}function ae(t,n){return typeof n=="function"&&ti(t)?u(t,n):ao(t,Sr(n))}function le(t,n){var r;if(typeof n=="function"&&ti(t)){
|
||||
for(r=t.length;r--&&false!==n(t[r],r,t););r=t}else r=lo(t,Sr(n));return r}function se(t,n){return(ti(t)?a:Sn)(t,Sr(n,3))}function he(t,n,r){var e=-1,u=Fe(t),o=u.length,i=o-1;for(n=(r?Pr(t,n,r):n===T)?1:on(Ne(n),0,o);++e<n;)t=Fn(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,u}function pe(t,n,r){return n=r?T:n,n=t&&null==n?t.length:n,Or(t,128,T,T,T,T,n)}function _e(t,n){var r;if(typeof n!="function")throw new pu("Expected a function");return t=Ne(t),function(){return 0<--t&&(r=n.apply(this,arguments)),
|
||||
1>=t&&(n=T),r}}function ve(t,n,r){return n=r?T:n,t=Or(t,8,T,T,T,T,T,n),t.placeholder=ve.placeholder,t}function ge(t,n,r){return n=r?T:n,t=Or(t,16,T,T,T,T,T,n),t.placeholder=ge.placeholder,t}function de(t,n,r){function e(n){var r=c,e=a;return c=a=T,p=n,l=t.apply(e,r)}function u(t){var r=t-h;return t-=p,!h||r>=n||0>r||false!==v&&t>=v}function o(){var t=To();if(u(t))return i(t);var r;r=t-p,t=n-(t-h),r=false===v?t:Pu(t,v-r),s=Cu(o,r)}function i(t){return Eu(s),s=T,g&&c?e(t):(c=a=T,l)}function f(){var t=To(),r=u(t);
|
||||
return c=arguments,a=this,h=t,r?s===T?(p=t=h,s=Cu(o,n),_?e(t):l):(Eu(s),s=Cu(o,n),e(h)):l}var c,a,l,s,h=0,p=0,_=false,v=false,g=true;if(typeof t!="function")throw new pu("Expected a function");return n=Ze(n)||0,Re(r)&&(_=!!r.leading,v="maxWait"in r&&Nu(Ze(r.maxWait)||0,n),g="trailing"in r?!!r.trailing:g),f.cancel=function(){s!==T&&Eu(s),h=p=0,c=a=s=T},f.flush=function(){return s===T?l:i(To())},f}function ye(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),
|
||||
r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new pu("Expected a function");return r.cache=new(ye.Cache||Lt),r}function be(t,n){if(typeof t!="function")throw new pu("Expected a function");return n=Nu(n===T?t.length-1:Ne(n),0),function(){for(var e=arguments,u=-1,o=Nu(e.length-n,0),i=Array(o);++u<o;)i[u]=e[n+u];switch(n){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}for(o=Array(n+1),u=-1;++u<n;)o[u]=e[u];return o[n]=i,
|
||||
r(t,this,o)}}function xe(){if(!arguments.length)return[];var t=arguments[0];return ti(t)?t:[t]}function je(t,n){return t===n||t!==t&&n!==n}function me(t,n){return t>n}function we(t){return Oe(t)&&du.call(t,"callee")&&(!Bu.call(t,"callee")||"[object Arguments]"==xu.call(t))}function Ae(t){return null!=t&&Se(go(t))&&!Ee(t)}function Oe(t){return We(t)&&Ae(t)}function ke(t){return We(t)?"[object Error]"==xu.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Ee(t){return t=Re(t)?xu.call(t):"",
|
||||
"[object Function]"==t||"[object GeneratorFunction]"==t}function Ie(t){return typeof t=="number"&&t==Ne(t)}function Se(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t}function Re(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function We(t){return!!t&&typeof t=="object"}function Be(t){return Re(t)?(Ee(t)||M(t)?mu:yt).test(Yr(t)):false}function Ce(t){return typeof t=="number"||We(t)&&"[object Number]"==xu.call(t)}function ze(t){return!We(t)||"[object Object]"!=xu.call(t)||M(t)?false:(t=Lu(Object(t)),
|
||||
null===t?true:(t=du.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&gu.call(t)==bu))}function Ue(t){return Re(t)&&"[object RegExp]"==xu.call(t)}function Me(t){return typeof t=="string"||!ti(t)&&We(t)&&"[object String]"==xu.call(t)}function Le(t){return typeof t=="symbol"||We(t)&&"[object Symbol]"==xu.call(t)}function $e(t){return We(t)&&Se(t.length)&&!!zt[xu.call(t)]}function De(t,n){return n>t}function Fe(t){if(!t)return[];if(Ae(t))return Me(t)?t.match(It):er(t);if(Ru&&t[Ru])return $(t[Ru]());
|
||||
var n=zr(t);return("[object Map]"==n?D:"[object Set]"==n?N:Xe)(t)}function Ne(t){if(!t)return 0===t?t:0;if(t=Ze(t),t===V||t===-V)return 1.7976931348623157e308*(0>t?-1:1);var n=t%1;return t===t?n?t-n:t:0}function Pe(t){return t?on(Ne(t),0,4294967295):0}function Ze(t){if(typeof t=="number")return t;if(Le(t))return K;if(Re(t)&&(t=Ee(t.valueOf)?t.valueOf():t,t=Re(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(at,"");var n=dt.test(t);return n||bt.test(t)?Pt(t.slice(2),n?2:8):gt.test(t)?K:+t;
|
||||
}function qe(t){return ur(t,Ye(t))}function Te(t){if(typeof t=="string")return t;if(null==t)return"";if(Le(t))return co?co.call(t):"";var n=t+"";return"0"==n&&1/t==-V?"-0":n}function Ve(t,n,r){return t=null==t?T:yn(t,n),t===T?r:t}function Ke(t,n){return null!=t&&Ur(t,n,xn)}function Ge(t,n){return null!=t&&Ur(t,n,jn)}function Je(t){var n=Vr(t);if(!n&&!Ae(t))return Fu(Object(t));var r,e=Dr(t),u=!!e,e=e||[],o=e.length;for(r in t)!xn(t,r)||u&&("length"==r||L(r,o))||n&&"constructor"==r||e.push(r);return e;
|
||||
}function Ye(t){for(var n=-1,r=Vr(t),e=In(t),u=e.length,o=Dr(t),i=!!o,o=o||[],f=o.length;++n<u;){var c=e[n];i&&("length"==c||L(c,f))||"constructor"==c&&(r||!du.call(t,c))||o.push(c)}return o}function He(t){return A(t,Je(t))}function Qe(t){return A(t,Ye(t))}function Xe(t){return t?k(t,Je(t)):[]}function tu(t){return wi(Te(t).toLowerCase())}function nu(t){return(t=Te(t))&&t.replace(jt,B).replace(Et,"")}function ru(t,n,r){return t=Te(t),n=r?T:n,n===T&&(n=Bt.test(t)?Wt:Rt),t.match(n)||[]}function eu(t){
|
||||
return function(){return t}}function uu(t){return t}function ou(t){return En(typeof t=="function"?t:fn(t,true))}function iu(t,n,r){var e=Je(n),o=dn(n,e);null!=r||Re(n)&&(o.length||!e.length)||(r=n,n=t,t=this,o=dn(n,Je(n)));var i=Re(r)&&"chain"in r?r.chain:true,f=Ee(t);return u(o,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){var n=this.__chain__;if(i||n){var r=t(this.__wrapped__);return(r.__actions__=er(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,l([this.value()],arguments));
|
||||
})}),t}function fu(){}function cu(t){return Zr(t)?Mn(t):Ln(t)}S=S?Yt.defaults({},S,Yt.pick(Jt,Ct)):Jt;var au=S.Date,lu=S.Error,su=S.Math,hu=S.RegExp,pu=S.TypeError,_u=S.Array.prototype,vu=S.Object.prototype,gu=S.Function.prototype.toString,du=vu.hasOwnProperty,yu=0,bu=gu.call(Object),xu=vu.toString,ju=Jt._,mu=hu("^"+gu.call(du).replace(ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wu=Tt?S.Buffer:T,Au=S.Reflect,Ou=S.Symbol,ku=S.Uint8Array,Eu=S.clearTimeout,Iu=Au?Au.f:T,Su=Object.getOwnPropertySymbols,Ru=typeof(Ru=Ou&&Ou.iterator)=="symbol"?Ru:T,Wu=Object.create,Bu=vu.propertyIsEnumerable,Cu=S.setTimeout,zu=_u.splice,Uu=su.ceil,Mu=su.floor,Lu=Object.getPrototypeOf,$u=S.isFinite,Du=_u.join,Fu=Object.keys,Nu=su.max,Pu=su.min,Zu=S.parseInt,qu=su.random,Tu=_u.reverse,Vu=Wr(S,"DataView"),Ku=Wr(S,"Map"),Gu=Wr(S,"Promise"),Ju=Wr(S,"Set"),Yu=Wr(S,"WeakMap"),Hu=Wr(Object,"create"),Qu=Yu&&new Yu,Xu=!Bu.call({
|
||||
valueOf:1},"valueOf"),to={},no=Yr(Vu),ro=Yr(Ku),eo=Yr(Gu),uo=Yr(Ju),oo=Yr(Yu),io=Ou?Ou.prototype:T,fo=io?io.valueOf:T,co=io?io.toString:T;xt.templateSettings={escape:nt,evaluate:rt,interpolate:et,variable:"",imports:{_:xt}},xt.prototype=At.prototype,xt.prototype.constructor=xt,Ot.prototype=an(At.prototype),Ot.prototype.constructor=Ot,kt.prototype=an(At.prototype),kt.prototype.constructor=kt,Mt.prototype=Hu?Hu(null):vu,Lt.prototype.clear=function(){this.__data__={hash:new Mt,map:Ku?new Ku:[],string:new Mt
|
||||
}},Lt.prototype["delete"]=function(t){var n=this.__data__;return qr(t)?(n=typeof t=="string"?n.string:n.hash,t=(Hu?n[t]!==T:du.call(n,t))&&delete n[t]):t=Ku?n.map["delete"](t):Zt(n.map,t),t},Lt.prototype.get=function(t){var n=this.__data__;return qr(t)?(n=typeof t=="string"?n.string:n.hash,Hu?(t=n[t],t="__lodash_hash_undefined__"===t?T:t):t=du.call(n,t)?n[t]:T):t=Ku?n.map.get(t):qt(n.map,t),t},Lt.prototype.has=function(t){var n=this.__data__;return qr(t)?(n=typeof t=="string"?n.string:n.hash,t=Hu?n[t]!==T:du.call(n,t)):t=Ku?n.map.has(t):-1<Vt(n.map,t),
|
||||
t},Lt.prototype.set=function(t,n){var r=this.__data__;return qr(t)?(typeof t=="string"?r.string:r.hash)[t]=Hu&&n===T?"__lodash_hash_undefined__":n:Ku?r.map.set(t,n):Kt(r.map,t,n),this},$t.prototype.push=function(t){var n=this.__data__;qr(t)?(n=n.__data__,(typeof t=="string"?n.string:n.hash)[t]="__lodash_hash_undefined__"):n.set(t,"__lodash_hash_undefined__")},Ft.prototype.clear=function(){this.__data__={array:[],map:null}},Ft.prototype["delete"]=function(t){var n=this.__data__,r=n.array;return r?Zt(r,t):n.map["delete"](t);
|
||||
},Ft.prototype.get=function(t){var n=this.__data__,r=n.array;return r?qt(r,t):n.map.get(t)},Ft.prototype.has=function(t){var n=this.__data__,r=n.array;return r?-1<Vt(r,t):n.map.has(t)},Ft.prototype.set=function(t,n){var r=this.__data__,e=r.array;return e&&(199>e.length?Kt(e,t,n):(r.array=null,r.map=new Lt(e))),(r=r.map)&&r.set(t,n),this};var ao=ar(vn),lo=ar(gn,true),so=lr(),ho=lr(true);Iu&&!Bu.call({valueOf:1},"valueOf")&&(In=function(t){return $(Iu(t))});var po=Qu?function(t,n){return Qu.set(t,n),t}:uu,_o=Ju&&2===new Ju([1,2]).size?function(t){
|
||||
return new Ju(t)}:fu,vo=Qu?function(t){return Qu.get(t)}:fu,go=Mn("length");Su||(Cr=function(){return[]});var yo=Su?function(t){for(var n=[];t;)l(n,Cr(t)),t=Lu(Object(t));return n}:Cr;(Vu&&"[object DataView]"!=zr(new Vu(new ArrayBuffer(1)))||Ku&&"[object Map]"!=zr(new Ku)||Gu&&"[object Promise]"!=zr(Gu.resolve())||Ju&&"[object Set]"!=zr(new Ju)||Yu&&"[object WeakMap]"!=zr(new Yu))&&(zr=function(t){var n=xu.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?Yr(t):T)switch(t){case no:return"[object DataView]";
|
||||
case ro:return"[object Map]";case eo:return"[object Promise]";case uo:return"[object Set]";case oo:return"[object WeakMap]"}return n});var bo=function(){var t=0,n=0;return function(r,e){var u=To(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return po(r,e)}}(),xo=ye(function(t){var n=[];return Te(t).replace(it,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}),n}),jo=be(function(t,n){return Oe(t)?sn(t,_n(n,1,Oe,true)):[]}),mo=be(function(t,n){var r=ne(n);return Oe(r)&&(r=T),Oe(t)?sn(t,_n(n,1,Oe,true),Sr(r)):[];
|
||||
}),wo=be(function(t,n){var r=ne(n);return Oe(r)&&(r=T),Oe(t)?sn(t,_n(n,1,Oe,true),T,r):[]}),Ao=be(function(t){var n=a(t,rn);return n.length&&n[0]===t[0]?mn(n):[]}),Oo=be(function(t){var n=ne(t),r=a(t,rn);return n===ne(r)?n=T:r.pop(),r.length&&r[0]===t[0]?mn(r,Sr(n)):[]}),ko=be(function(t){var n=ne(t),r=a(t,rn);return n===ne(r)?n=T:r.pop(),r.length&&r[0]===t[0]?mn(r,T,n):[]}),Eo=be(re),Io=be(function(t,n){n=a(_n(n,1),String);var r=nn(t,n);return Dn(t,n.sort(R)),r}),So=be(function(t){return Gn(_n(t,1,Oe,true));
|
||||
}),Ro=be(function(t){var n=ne(t);return Oe(n)&&(n=T),Gn(_n(t,1,Oe,true),Sr(n))}),Wo=be(function(t){var n=ne(t);return Oe(n)&&(n=T),Gn(_n(t,1,Oe,true),T,n)}),Bo=be(function(t,n){return Oe(t)?sn(t,n):[]}),Co=be(function(t){return Hn(i(t,Oe))}),zo=be(function(t){var n=ne(t);return Oe(n)&&(n=T),Hn(i(t,Oe),Sr(n))}),Uo=be(function(t){var n=ne(t);return Oe(n)&&(n=T),Hn(i(t,Oe),T,n)}),Mo=be(ue),Lo=be(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return oe(t,n)}),$o=be(function(t){
|
||||
function n(n){return nn(n,t)}t=_n(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof kt&&L(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:fe,args:[n],thisArg:T}),new Ot(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),Do=fr(function(t,n,r){du.call(t,r)?++t[r]:t[r]=1}),Fo=fr(function(t,n,r){du.call(t,r)?t[r].push(n):t[r]=[n]}),No=be(function(t,n,e){var u=-1,o=typeof n=="function",i=Zr(n),f=Ae(t)?Array(t.length):[];
|
||||
return ao(t,function(t){var c=o?n:i&&null!=t?t[n]:T;f[++u]=c?r(c,t,e):An(t,n,e)}),f}),Po=fr(function(t,n,r){t[r]=n}),Zo=fr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),qo=be(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Pr(t,n[0],n[1])?n=[]:r>2&&Pr(n[0],n[1],n[2])&&(n.length=1),Cn(t,_n(n,1),[])}),To=au.now,Vo=be(function(t,n,r){var e=1;if(r.length)var u=F(r,Br(Vo)),e=32|e;return Or(t,e,n,r,u)}),Ko=be(function(t,n,r){var e=3;if(r.length)var u=F(r,Br(Ko)),e=32|e;return Or(n,e,t,r,u);
|
||||
}),Go=be(function(t,n){return ln(t,1,n)}),Jo=be(function(t,n,r){return ln(t,Ze(n)||0,r)});ye.Cache=Lt;var Yo=be(function(t,n){n=a(_n(n,1,Nr),Sr());var e=n.length;return be(function(u){for(var o=-1,i=Pu(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]);return r(t,this,u)})}),Ho=be(function(t,n){var r=F(n,Br(Ho));return Or(t,32,T,n,r)}),Qo=be(function(t,n){var r=F(n,Br(Qo));return Or(t,64,T,n,r)}),Xo=be(function(t,n){return Or(t,256,T,T,T,_n(n,1))}),ti=Array.isArray,ni=wu?function(t){return t instanceof wu;
|
||||
}:eu(false),ri=cr(function(t,n){if(Xu||Vr(n)||Ae(n))ur(n,Je(n),t);else for(var r in n)du.call(n,r)&&Qt(t,r,n[r])}),ei=cr(function(t,n){if(Xu||Vr(n)||Ae(n))ur(n,Ye(n),t);else for(var r in n)Qt(t,r,n[r])}),ui=cr(function(t,n,r,e){or(n,Ye(n),t,e)}),oi=cr(function(t,n,r,e){or(n,Je(n),t,e)}),ii=be(function(t,n){return nn(t,_n(n,1))}),fi=be(function(t){return t.push(T,Gt),r(ui,T,t)}),ci=be(function(t){return t.push(T,Gr),r(pi,T,t)}),ai=yr(function(t,n,r){t[n]=r},eu(uu)),li=yr(function(t,n,r){du.call(t,n)?t[n].push(r):t[n]=[r];
|
||||
},Sr),si=be(An),hi=cr(function(t,n,r){Bn(t,n,r)}),pi=cr(function(t,n,r,e){Bn(t,n,r,e)}),_i=be(function(t,n){return null==t?{}:(n=a(_n(n,1),en),zn(t,sn(bn(t,Ye,yo),n)))}),vi=be(function(t,n){return null==t?{}:zn(t,_n(n,1))}),gi=pr(function(t,n,r){return n=n.toLowerCase(),t+(r?tu(n):n)}),di=pr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),yi=pr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),bi=hr("toLowerCase"),xi=pr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),ji=pr(function(t,n,r){
|
||||
return t+(r?" ":"")+wi(n)}),mi=pr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),wi=hr("toUpperCase"),Ai=be(function(t,n){try{return r(t,T,n)}catch(e){return ke(e)?e:new lu(e)}}),Oi=be(function(t,n){return u(_n(n,1),function(n){t[n]=Vo(t[n],t)}),t}),ki=gr(),Ei=gr(true),Ii=be(function(t,n){return function(r){return An(r,t,n)}}),Si=be(function(t,n){return function(r){return An(t,r,n)}}),Ri=br(a),Wi=br(o),Bi=br(p),Ci=mr(),zi=mr(true),Ui=W(function(t,n){return t+n}),Mi=Ar("ceil"),Li=W(function(t,n){
|
||||
return t/n}),$i=Ar("floor"),Di=W(function(t,n){return t*n}),Fi=Ar("round"),Ni=W(function(t,n){return t-n});return xt.after=function(t,n){if(typeof n!="function")throw new pu("Expected a function");return t=Ne(t),function(){return 1>--t?n.apply(this,arguments):void 0}},xt.ary=pe,xt.assign=ri,xt.assignIn=ei,xt.assignInWith=ui,xt.assignWith=oi,xt.at=ii,xt.before=_e,xt.bind=Vo,xt.bindAll=Oi,xt.bindKey=Ko,xt.castArray=xe,xt.chain=ie,xt.chunk=function(t,n,r){if(n=(r?Pr(t,n,r):n===T)?1:Nu(Ne(n),0),r=t?t.length:0,
|
||||
!r||1>n)return[];for(var e=0,u=0,o=Array(Uu(r/n));r>e;)o[u++]=Zn(t,e,e+=n);return o},xt.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++n<r;){var o=t[n];o&&(u[e++]=o)}return u},xt.concat=function(){var t=arguments.length,n=xe(arguments[0]);if(2>t)return t?er(n):[];for(var r=Array(t-1);t--;)r[t-1]=arguments[t];for(var t=_n(r,1),r=-1,e=n.length,u=-1,o=t.length,i=Array(e+o);++r<e;)i[r]=n[r];for(;++u<o;)i[r++]=t[u];return i},xt.cond=function(t){var n=t?t.length:0,e=Sr();return t=n?a(t,function(t){
|
||||
if("function"!=typeof t[1])throw new pu("Expected a function");return[e(t[0]),t[1]]}):[],be(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e)}})},xt.conforms=function(t){return cn(fn(t,true))},xt.constant=eu,xt.countBy=Do,xt.create=function(t,n){var r=an(t);return n?tn(r,n):r},xt.curry=ve,xt.curryRight=ge,xt.debounce=de,xt.defaults=fi,xt.defaultsDeep=ci,xt.defer=Go,xt.delay=Jo,xt.difference=jo,xt.differenceBy=mo,xt.differenceWith=wo,xt.drop=Qr,xt.dropRight=Xr,xt.dropRightWhile=function(t,n){
|
||||
return t&&t.length?Jn(t,Sr(n,3),true,true):[]},xt.dropWhile=function(t,n){return t&&t.length?Jn(t,Sr(n,3),true):[]},xt.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&Pr(t,n,r)&&(r=0,e=u),u=t.length,r=Ne(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Ne(e),0>e&&(e+=u),e=r>e?0:Pe(e);e>r;)t[r++]=n;return t},xt.filter=function(t,n){return(ti(t)?i:pn)(t,Sr(n,3))},xt.flatMap=function(t,n){return _n(se(t,n),1)},xt.flatMapDeep=function(t,n){return _n(se(t,n),V)},xt.flatMapDepth=function(t,n,r){
|
||||
return r=r===T?1:Ne(r),_n(se(t,n),r)},xt.flatten=function(t){return t&&t.length?_n(t,1):[]},xt.flattenDeep=function(t){return t&&t.length?_n(t,V):[]},xt.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Ne(n),_n(t,n)):[]},xt.flip=function(t){return Or(t,512)},xt.flow=ki,xt.flowRight=Ei,xt.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n<r;){var u=t[n];e[u[0]]=u[1]}return e},xt.functions=function(t){return null==t?[]:dn(t,Je(t))},xt.functionsIn=function(t){return null==t?[]:dn(t,Ye(t));
|
||||
},xt.groupBy=Fo,xt.initial=function(t){return Xr(t,1)},xt.intersection=Ao,xt.intersectionBy=Oo,xt.intersectionWith=ko,xt.invert=ai,xt.invertBy=li,xt.invokeMap=No,xt.iteratee=ou,xt.keyBy=Po,xt.keys=Je,xt.keysIn=Ye,xt.map=se,xt.mapKeys=function(t,n){var r={};return n=Sr(n,3),vn(t,function(t,e,u){r[n(t,e,u)]=t}),r},xt.mapValues=function(t,n){var r={};return n=Sr(n,3),vn(t,function(t,e,u){r[e]=n(t,e,u)}),r},xt.matches=function(t){return Rn(fn(t,true))},xt.matchesProperty=function(t,n){return Wn(t,fn(n,true));
|
||||
},xt.memoize=ye,xt.merge=hi,xt.mergeWith=pi,xt.method=Ii,xt.methodOf=Si,xt.mixin=iu,xt.negate=function(t){if(typeof t!="function")throw new pu("Expected a function");return function(){return!t.apply(this,arguments)}},xt.nthArg=function(t){return t=Ne(t),function(){return arguments[t]}},xt.omit=_i,xt.omitBy=function(t,n){return n=Sr(n),Un(t,function(t,r){return!n(t,r)})},xt.once=function(t){return _e(2,t)},xt.orderBy=function(t,n,r,e){return null==t?[]:(ti(n)||(n=null==n?[]:[n]),r=e?T:r,ti(r)||(r=null==r?[]:[r]),
|
||||
Cn(t,n,r))},xt.over=Ri,xt.overArgs=Yo,xt.overEvery=Wi,xt.overSome=Bi,xt.partial=Ho,xt.partialRight=Qo,xt.partition=Zo,xt.pick=vi,xt.pickBy=function(t,n){return null==t?{}:Un(t,Sr(n))},xt.property=cu,xt.propertyOf=function(t){return function(n){return null==t?T:yn(t,n)}},xt.pull=Eo,xt.pullAll=re,xt.pullAllBy=function(t,n,r){return t&&t.length&&n&&n.length?$n(t,n,Sr(r)):t},xt.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?$n(t,n,T,r):t},xt.pullAt=Io,xt.range=Ci,xt.rangeRight=zi,xt.rearg=Xo,
|
||||
xt.reject=function(t,n){var r=ti(t)?i:pn;return n=Sr(n,3),r(t,function(t,r,e){return!n(t,r,e)})},xt.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=Sr(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i),u.push(e))}return Dn(t,u),r},xt.rest=be,xt.reverse=ee,xt.sampleSize=he,xt.set=function(t,n,r){return null==t?t:Pn(t,n,r)},xt.setWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null==t?t:Pn(t,n,r,e)},xt.shuffle=function(t){return he(t,4294967295)},xt.slice=function(t,n,r){
|
||||
var e=t?t.length:0;return e?(r&&typeof r!="number"&&Pr(t,n,r)?(n=0,r=e):(n=null==n?0:Ne(n),r=r===T?e:Ne(r)),Zn(t,n,r)):[]},xt.sortBy=qo,xt.sortedUniq=function(t){return t&&t.length?Kn(t):[]},xt.sortedUniqBy=function(t,n){return t&&t.length?Kn(t,Sr(n)):[]},xt.split=function(t,n,r){return(t=Te(t))&&(typeof n=="string"||null!=n&&!Ue(n))&&(n+="",""==n&&St.test(t))?(t=t.match(It),r===T?t:t.slice(0,0>r?0:r)):t.split(n,r)},xt.spread=function(t,n){if(typeof t!="function")throw new pu("Expected a function");
|
||||
return n=n===T?0:Nu(Ne(n),0),be(function(e){var u=e[n];return e=e.slice(0,n),u&&l(e,u),r(t,this,e)})},xt.tail=function(t){return Qr(t,1)},xt.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Ne(n),Zn(t,0,0>n?0:n)):[]},xt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ne(n),n=e-n,Zn(t,0>n?0:n,e)):[]},xt.takeRightWhile=function(t,n){return t&&t.length?Jn(t,Sr(n,3),false,true):[]},xt.takeWhile=function(t,n){return t&&t.length?Jn(t,Sr(n,3)):[]},xt.tap=function(t,n){return n(t),t},
|
||||
xt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new pu("Expected a function");return Re(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),de(t,n,{leading:e,maxWait:n,trailing:u})},xt.thru=fe,xt.toArray=Fe,xt.toPairs=He,xt.toPairsIn=Qe,xt.toPath=function(t){return ti(t)?a(t,en):Le(t)?[t]:er(xo(t))},xt.toPlainObject=qe,xt.transform=function(t,n,r){var e=ti(t)||$e(t);if(n=Sr(n,4),null==r)if(e||Re(t)){var o=t.constructor;r=e?ti(t)?new o:[]:Ee(o)?an(Lu(Object(t))):{};
|
||||
}else r={};return(e?u:vn)(t,function(t,e,u){return n(r,t,e,u)}),r},xt.unary=function(t){return pe(t,1)},xt.union=So,xt.unionBy=Ro,xt.unionWith=Wo,xt.uniq=function(t){return t&&t.length?Gn(t):[]},xt.uniqBy=function(t,n){return t&&t.length?Gn(t,Sr(n)):[]},xt.uniqWith=function(t,n){return t&&t.length?Gn(t,T,n):[]},xt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Zr(e,r)?[e]:un(e);r=Jr(r,e),e=ne(e),r=null!=r&&Ke(r,e)?delete r[e]:true}return r},xt.unzip=ue,xt.unzipWith=oe,xt.update=function(t,n,r){
|
||||
return null==t?t:Pn(t,n,(typeof r=="function"?r:uu)(yn(t,n)),void 0)},xt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Pn(t,n,(typeof r=="function"?r:uu)(yn(t,n)),e)),t},xt.values=Xe,xt.valuesIn=function(t){return null==t?[]:k(t,Ye(t))},xt.without=Bo,xt.words=ru,xt.wrap=function(t,n){return n=null==n?uu:n,Ho(n,t)},xt.xor=Co,xt.xorBy=zo,xt.xorWith=Uo,xt.zip=Mo,xt.zipObject=function(t,n){return Qn(t||[],n||[],Qt)},xt.zipObjectDeep=function(t,n){return Qn(t||[],n||[],Pn);
|
||||
},xt.zipWith=Lo,xt.entries=He,xt.entriesIn=Qe,xt.extend=ei,xt.extendWith=ui,iu(xt,xt),xt.add=Ui,xt.attempt=Ai,xt.camelCase=gi,xt.capitalize=tu,xt.ceil=Mi,xt.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=Ze(r),r=r===r?r:0),n!==T&&(n=Ze(n),n=n===n?n:0),on(Ze(t),n,r)},xt.clone=function(t){return fn(t,false,true)},xt.cloneDeep=function(t){return fn(t,true,true)},xt.cloneDeepWith=function(t,n){return fn(t,true,true,n)},xt.cloneWith=function(t,n){return fn(t,false,true,n)},xt.deburr=nu,xt.divide=Li,xt.endsWith=function(t,n,r){
|
||||
t=Te(t),n=typeof n=="string"?n:n+"";var e=t.length;return r=r===T?e:on(Ne(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},xt.eq=je,xt.escape=function(t){return(t=Te(t))&&tt.test(t)?t.replace(Q,C):t},xt.escapeRegExp=function(t){return(t=Te(t))&&ct.test(t)?t.replace(ft,"\\$&"):t},xt.every=function(t,n,r){var e=ti(t)?o:hn;return r&&Pr(t,n,r)&&(n=T),e(t,Sr(n,3))},xt.find=function(t,n){if(n=Sr(n,3),ti(t)){var r=g(t,n);return r>-1?t[r]:T}return v(t,n,ao)},xt.findIndex=function(t,n){return t&&t.length?g(t,Sr(n,3)):-1;
|
||||
},xt.findKey=function(t,n){return v(t,Sr(n,3),vn,true)},xt.findLast=function(t,n){if(n=Sr(n,3),ti(t)){var r=g(t,n,true);return r>-1?t[r]:T}return v(t,n,lo)},xt.findLastIndex=function(t,n){return t&&t.length?g(t,Sr(n,3),true):-1},xt.findLastKey=function(t,n){return v(t,Sr(n,3),gn,true)},xt.floor=$i,xt.forEach=ae,xt.forEachRight=le,xt.forIn=function(t,n){return null==t?t:so(t,Sr(n),Ye)},xt.forInRight=function(t,n){return null==t?t:ho(t,Sr(n),Ye)},xt.forOwn=function(t,n){return t&&vn(t,Sr(n))},xt.forOwnRight=function(t,n){
|
||||
return t&&gn(t,Sr(n))},xt.get=Ve,xt.gt=me,xt.gte=function(t,n){return t>=n},xt.has=Ke,xt.hasIn=Ge,xt.head=te,xt.identity=uu,xt.includes=function(t,n,r,e){return t=Ae(t)?t:Xe(t),r=r&&!e?Ne(r):0,e=t.length,0>r&&(r=Nu(e+r,0)),Me(t)?e>=r&&-1<t.indexOf(n,r):!!e&&-1<d(t,n,r)},xt.indexOf=function(t,n,r){var e=t?t.length:0;return e?(r=Ne(r),0>r&&(r=Nu(e+r,0)),d(t,n,r)):-1},xt.inRange=function(t,n,r){return n=Ze(n)||0,r===T?(r=n,n=0):r=Ze(r)||0,t=Ze(t),t>=Pu(n,r)&&t<Nu(n,r)},xt.invoke=si,xt.isArguments=we,
|
||||
xt.isArray=ti,xt.isArrayBuffer=function(t){return We(t)&&"[object ArrayBuffer]"==xu.call(t)},xt.isArrayLike=Ae,xt.isArrayLikeObject=Oe,xt.isBoolean=function(t){return true===t||false===t||We(t)&&"[object Boolean]"==xu.call(t)},xt.isBuffer=ni,xt.isDate=function(t){return We(t)&&"[object Date]"==xu.call(t)},xt.isElement=function(t){return!!t&&1===t.nodeType&&We(t)&&!ze(t)},xt.isEmpty=function(t){if(Ae(t)&&(ti(t)||Me(t)||Ee(t.splice)||we(t)||ni(t)))return!t.length;if(We(t)){var n=zr(t);if("[object Map]"==n||"[object Set]"==n)return!t.size;
|
||||
}for(var r in t)if(du.call(t,r))return false;return!(Xu&&Je(t).length)},xt.isEqual=function(t,n){return On(t,n)},xt.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:T)?r(t,n):T;return e===T?On(t,n,r):!!e},xt.isError=ke,xt.isFinite=function(t){return typeof t=="number"&&$u(t)},xt.isFunction=Ee,xt.isInteger=Ie,xt.isLength=Se,xt.isMap=function(t){return We(t)&&"[object Map]"==zr(t)},xt.isMatch=function(t,n){return t===n||kn(t,n,Rr(n))},xt.isMatchWith=function(t,n,r){return r=typeof r=="function"?r:T,
|
||||
kn(t,n,Rr(n),r)},xt.isNaN=function(t){return Ce(t)&&t!=+t},xt.isNative=Be,xt.isNil=function(t){return null==t},xt.isNull=function(t){return null===t},xt.isNumber=Ce,xt.isObject=Re,xt.isObjectLike=We,xt.isPlainObject=ze,xt.isRegExp=Ue,xt.isSafeInteger=function(t){return Ie(t)&&t>=-9007199254740991&&9007199254740991>=t},xt.isSet=function(t){return We(t)&&"[object Set]"==zr(t)},xt.isString=Me,xt.isSymbol=Le,xt.isTypedArray=$e,xt.isUndefined=function(t){return t===T},xt.isWeakMap=function(t){return We(t)&&"[object WeakMap]"==zr(t);
|
||||
},xt.isWeakSet=function(t){return We(t)&&"[object WeakSet]"==xu.call(t)},xt.join=function(t,n){return t?Du.call(t,n):""},xt.kebabCase=di,xt.last=ne,xt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==T&&(u=Ne(r),u=(0>u?Nu(e+u,0):Pu(u,e-1))+1),n!==n)return U(t,u,true);for(;u--;)if(t[u]===n)return u;return-1},xt.lowerCase=yi,xt.lowerFirst=bi,xt.lt=De,xt.lte=function(t,n){return n>=t},xt.max=function(t){return t&&t.length?_(t,uu,me):T},xt.maxBy=function(t,n){return t&&t.length?_(t,Sr(n),me):T;
|
||||
},xt.mean=function(t){return b(t,uu)},xt.meanBy=function(t,n){return b(t,Sr(n))},xt.min=function(t){return t&&t.length?_(t,uu,De):T},xt.minBy=function(t,n){return t&&t.length?_(t,Sr(n),De):T},xt.multiply=Di,xt.noConflict=function(){return Jt._===this&&(Jt._=ju),this},xt.noop=fu,xt.now=To,xt.pad=function(t,n,r){t=Te(t);var e=(n=Ne(n))?P(t):0;return n&&n>e?(n=(n-e)/2,xr(Mu(n),r)+t+xr(Uu(n),r)):t},xt.padEnd=function(t,n,r){t=Te(t);var e=(n=Ne(n))?P(t):0;return n&&n>e?t+xr(n-e,r):t},xt.padStart=function(t,n,r){
|
||||
t=Te(t);var e=(n=Ne(n))?P(t):0;return n&&n>e?xr(n-e,r)+t:t},xt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=Te(t).replace(at,""),Zu(t,n||(vt.test(t)?16:10))},xt.random=function(t,n,r){if(r&&typeof r!="boolean"&&Pr(t,n,r)&&(n=r=T),r===T&&(typeof n=="boolean"?(r=n,n=T):typeof t=="boolean"&&(r=t,t=T)),t===T&&n===T?(t=0,n=1):(t=Ze(t)||0,n===T?(n=t,t=0):n=Ze(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=qu(),Pu(t+r*(n-t+Nt("1e-"+((r+"").length-1))),n)):Fn(t,n)},xt.reduce=function(t,n,r){
|
||||
var e=ti(t)?s:x,u=3>arguments.length;return e(t,Sr(n,4),r,u,ao)},xt.reduceRight=function(t,n,r){var e=ti(t)?h:x,u=3>arguments.length;return e(t,Sr(n,4),r,u,lo)},xt.repeat=function(t,n,r){return n=(r?Pr(t,n,r):n===T)?1:Ne(n),Nn(Te(t),n)},xt.replace=function(){var t=arguments,n=Te(t[0]);return 3>t.length?n:n.replace(t[1],t[2])},xt.result=function(t,n,r){n=Zr(n,t)?[n]:un(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e<u;){var o=null==t?T:t[n[e]];o===T&&(e=u,o=r),t=Ee(o)?o.call(t):o}return t},xt.round=Fi,
|
||||
xt.runInContext=q,xt.sample=function(t){t=Ae(t)?t:Xe(t);var n=t.length;return n>0?t[Fn(0,n-1)]:T},xt.size=function(t){if(null==t)return 0;if(Ae(t)){var n=t.length;return n&&Me(t)?P(t):n}return We(t)&&(n=zr(t),"[object Map]"==n||"[object Set]"==n)?t.size:Je(t).length},xt.snakeCase=xi,xt.some=function(t,n,r){var e=ti(t)?p:qn;return r&&Pr(t,n,r)&&(n=T),e(t,Sr(n,3))},xt.sortedIndex=function(t,n){return Tn(t,n)},xt.sortedIndexBy=function(t,n,r){return Vn(t,n,Sr(r))},xt.sortedIndexOf=function(t,n){var r=t?t.length:0;
|
||||
if(r){var e=Tn(t,n);if(r>e&&je(t[e],n))return e}return-1},xt.sortedLastIndex=function(t,n){return Tn(t,n,true)},xt.sortedLastIndexBy=function(t,n,r){return Vn(t,n,Sr(r),true)},xt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(je(t[r],n))return r}return-1},xt.startCase=ji,xt.startsWith=function(t,n,r){return t=Te(t),r=on(Ne(r),0,t.length),t.lastIndexOf(n,r)==r},xt.subtract=Ni,xt.sum=function(t){return t&&t.length?m(t,uu):0},xt.sumBy=function(t,n){return t&&t.length?m(t,Sr(n)):0},
|
||||
xt.template=function(t,n,r){var e=xt.templateSettings;r&&Pr(t,n,r)&&(n=T),t=Te(t),n=ui({},n,e,Gt),r=ui({},n.imports,e.imports,Gt);var u,o,i=Je(r),f=k(r,i),c=0;r=n.interpolate||mt;var a="__p+='";r=hu((n.escape||mt).source+"|"+r.source+"|"+(r===et?pt:mt).source+"|"+(n.evaluate||mt).source+"|$","g");var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(wt,z),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),
|
||||
e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(G,""):a).replace(J,"$1").replace(Y,"$1;"),a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",n=Ai(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,ke(n))throw n;return n},xt.times=function(t,n){if(t=Ne(t),1>t||t>9007199254740991)return[];
|
||||
var r=4294967295,e=Pu(t,4294967295);for(n=Sr(n),t-=4294967295,e=w(e,n);++r<t;)n(r);return e},xt.toInteger=Ne,xt.toLength=Pe,xt.toLower=function(t){return Te(t).toLowerCase()},xt.toNumber=Ze,xt.toSafeInteger=function(t){return on(Ne(t),-9007199254740991,9007199254740991)},xt.toString=Te,xt.toUpper=function(t){return Te(t).toUpperCase()},xt.trim=function(t,n,r){return(t=Te(t))?r||n===T?t.replace(at,""):(n+="")?(t=t.match(It),n=n.match(It),t.slice(E(t,n),I(t,n)+1).join("")):t:t},xt.trimEnd=function(t,n,r){
|
||||
return(t=Te(t))?r||n===T?t.replace(st,""):(n+="")?(t=t.match(It),t.slice(0,I(t,n.match(It))+1).join("")):t:t},xt.trimStart=function(t,n,r){return(t=Te(t))?r||n===T?t.replace(lt,""):(n+="")?(t=t.match(It),t.slice(E(t,n.match(It))).join("")):t:t},xt.truncate=function(t,n){var r=30,e="...";if(Re(n))var u="separator"in n?n.separator:u,r="length"in n?Ne(n.length):r,e="omission"in n?Te(n.omission):e;t=Te(t);var o=t.length;if(St.test(t))var i=t.match(It),o=i.length;if(r>=o)return t;if(o=r-P(e),1>o)return e;
|
||||
if(r=i?i.slice(0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Ue(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=hu(u.source,Te(_t.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===T?o:c)}}else t.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},xt.unescape=function(t){return(t=Te(t))&&X.test(t)?t.replace(H,Z):t},xt.uniqueId=function(t){var n=++yu;return Te(t)+n},xt.upperCase=mi,xt.upperFirst=wi,xt.each=ae,xt.eachRight=le,xt.first=te,
|
||||
iu(xt,function(){var t={};return vn(xt,function(n,r){du.call(xt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),xt.VERSION="4.9.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){xt[t].placeholder=xt}),u(["drop","take"],function(t,n){kt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new kt(this);r=r===T?1:Nu(Ne(r),0);var u=this.clone();return e?u.__takeCount__=Pu(r,u.__takeCount__):u.__views__.push({size:Pu(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),
|
||||
u},kt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;kt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Sr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");kt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");kt.prototype[t]=function(){return this.__filtered__?new kt(this):this[r](1);
|
||||
}}),kt.prototype.compact=function(){return this.filter(uu)},kt.prototype.find=function(t){return this.filter(t).head()},kt.prototype.findLast=function(t){return this.reverse().find(t)},kt.prototype.invokeMap=be(function(t,n){return typeof t=="function"?new kt(this):this.map(function(r){return An(r,t,n)})}),kt.prototype.reject=function(t){return t=Sr(t,3),this.filter(function(n){return!t(n)})},kt.prototype.slice=function(t,n){t=Ne(t);var r=this;return r.__filtered__&&(t>0||0>n)?new kt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),
|
||||
n!==T&&(n=Ne(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},kt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},kt.prototype.toArray=function(){return this.take(4294967295)},vn(kt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=xt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(xt.prototype[n]=function(){function n(t){return t=u.apply(xt,l([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof kt,a=f[0],s=c||ti(i);
|
||||
s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new kt(this),i=t.apply(i,f),i.__actions__.push({func:fe,args:[n],thisArg:T}),new Ot(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=_u[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);xt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){
|
||||
var u=this.value();return n.apply(ti(u)?u:[],t)}return this[r](function(r){return n.apply(ti(r)?r:[],t)})}}),vn(kt.prototype,function(t,n){var r=xt[n];if(r){var e=r.name+"";(to[e]||(to[e]=[])).push({name:n,func:r})}}),to[dr(T,2).name]=[{name:"wrapper",func:T}],kt.prototype.clone=function(){var t=new kt(this.__wrapped__);return t.__actions__=er(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=er(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=er(this.__views__),
|
||||
t},kt.prototype.reverse=function(){if(this.__filtered__){var t=new kt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},kt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=ti(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++c<a;){var l=i[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":t-=s;break;case"take":t=Pu(t,f+s);break;case"takeRight":f=Nu(f,t-s)}}if(t={start:f,end:t},i=t.start,f=t.end,t=f-i,
|
||||
u=u?f:i-1,i=this.__iteratees__,f=i.length,c=0,a=Pu(t,this.__takeCount__),!e||200>o||o==t&&a==t)return Yn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o<f;){var h=i[o],s=h.type,h=(0,h.iteratee)(l);if(2==s)l=h;else if(!h){if(1==s)continue t;break t}}e[c++]=l}return e},xt.prototype.at=$o,xt.prototype.chain=function(){return ie(this)},xt.prototype.commit=function(){return new Ot(this.value(),this.__chain__)},xt.prototype.next=function(){this.__values__===T&&(this.__values__=Fe(this.value()));
|
||||
var t=this.__index__>=this.__values__.length,n=t?T:this.__values__[this.__index__++];return{done:t,value:n}},xt.prototype.plant=function(t){for(var n,r=this;r instanceof At;){var e=Hr(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},xt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof kt?(this.__actions__.length&&(t=new kt(this)),t=t.reverse(),t.__actions__.push({func:fe,args:[ee],thisArg:T}),new Ot(t,this.__chain__)):this.thru(ee);
|
||||
},xt.prototype.toJSON=xt.prototype.valueOf=xt.prototype.value=function(){return Yn(this.__wrapped__,this.__actions__)},Ru&&(xt.prototype[Ru]=ce),xt}var T,V=1/0,K=NaN,G=/\b__p\+='';/g,J=/\b(__p\+=)''\+/g,Y=/(__e\(.*?\)|\b__t\))\+'';/g,H=/&(?:amp|lt|gt|quot|#39|#96);/g,Q=/[&<>"'`]/g,X=RegExp(H.source),tt=RegExp(Q.source),nt=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ot=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,ft=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ft.source),at=/^\s+|\s+$/g,lt=/^\s+/,st=/\s+$/,ht=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,vt=/^0x/i,gt=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,jt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,mt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,At="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",Ot="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+At,kt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",Et=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),It=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kt+At,"g"),St=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Rt=/[a-zA-Z0-9]+/g,Wt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|\\d+",Ot].join("|"),"g"),Bt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ct="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),zt={};
|
||||
zt["[object Float32Array]"]=zt["[object Float64Array]"]=zt["[object Int8Array]"]=zt["[object Int16Array]"]=zt["[object Int32Array]"]=zt["[object Uint8Array]"]=zt["[object Uint8ClampedArray]"]=zt["[object Uint16Array]"]=zt["[object Uint32Array]"]=true,zt["[object Arguments]"]=zt["[object Array]"]=zt["[object ArrayBuffer]"]=zt["[object Boolean]"]=zt["[object DataView]"]=zt["[object Date]"]=zt["[object Error]"]=zt["[object Function]"]=zt["[object Map]"]=zt["[object Number]"]=zt["[object Object]"]=zt["[object RegExp]"]=zt["[object Set]"]=zt["[object String]"]=zt["[object WeakMap]"]=false;
|
||||
var Ut={};Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object DataView]"]=Ut["[object Boolean]"]=Ut["[object Date]"]=Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object Symbol]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=true,
|
||||
Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object WeakMap]"]=false;var Mt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O",
|
||||
"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Lt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Dt={"function":true,object:true},Ft={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"
|
||||
},Nt=parseFloat,Pt=parseInt,Zt=Dt[typeof exports]&&exports&&!exports.nodeType?exports:T,qt=Dt[typeof module]&&module&&!module.nodeType?module:T,Tt=qt&&qt.exports===Zt?Zt:T,Vt=S(Dt[typeof self]&&self),Kt=S(Dt[typeof window]&&window),Gt=S(Dt[typeof this]&&this),Jt=S(Zt&&qt&&typeof global=="object"&&global)||Kt!==(Gt&&Gt.window)&&Kt||Vt||Gt||Function("return this")(),Yt=q();(Kt||Vt||{})._=Yt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Yt}):Zt&&qt?(Tt&&((qt.exports=Yt)._=Yt),
|
||||
Zt._=Yt):Jt._=Yt}).call(this);
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.k,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.k,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=!0
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.l,r=t.l;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.m-t.m}function o(n){var t=-1,r=n.length,u=n[0],o=n[0|r/2],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return!1;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=f(),o.b=n,o.k=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+U[n]}function i(){return g.pop()||[]}function f(){return y.pop()||{b:null,k:null,configurable:!1,l:null,enumerable:!1,"false":!1,m:0,leading:!1,maxWait:0,"null":!1,number:null,z:null,push:null,string:null,trailing:!1,"true":!1,undefined:!1,n:null,writable:!1}
|
||||
}function l(){}function c(n){n.length=0,g.length<d&&g.push(n)}function p(n){var t=n.k;t&&p(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=null,y.length<d&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(e){function g(n){if(!n||_e.call(n)!=q)return!1;var t=n.valueOf,e=typeof t=="function"&&(e=se(t))&&se(e);return e?n==e||se(n)==e:lt(n)}function y(n,t,e){if(!n||!M[typeof n])return n;t=t&&typeof e=="undefined"?t:nt(t,e,3);
|
||||
for(var r=-1,u=M[typeof n]&&We(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function d(n,t,e){var r;if(!n||!M[typeof n])return n;t=t&&typeof e=="undefined"?t:nt(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function U(n,t,e){var r,u=n,o=u;if(!u)return o;for(var a=arguments,i=0,f=typeof e=="number"?2:a.length;++i<f;)if((u=a[i])&&M[typeof u])for(var l=-1,c=M[typeof u]&&We(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);return o}function G(n,t,e){var r,u=n,o=u;
|
||||
if(!u)return o;var a=arguments,i=0,f=typeof e=="number"?2:a.length;if(3<f&&"function"==typeof a[f-2])var l=nt(a[--f-1],a[f--],2);else 2<f&&"function"==typeof a[f-1]&&(l=a[--f]);for(;++i<f;)if((u=a[i])&&M[typeof u])for(var c=-1,p=M[typeof u]&&We(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function H(n){var t,e=[];if(!n||!M[typeof n])return e;for(t in n)ve.call(n,t)&&e.push(t);return e}function Q(n){return n&&typeof n=="object"&&!ze(n)&&ve.call(n,"__wrapped__")?n:new Y(n)}function Y(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function Z(n,t,e,r,u){var o=n;if(e){if(o=e(o),typeof o!="undefined")return o;o=n}var a=yt(o);if(a){var f=_e.call(o);if(!L[f])return o;var l=ze(o)}if(!a||!t)return a?l?s(o):G({},o):o;switch(a=$e[f],f){case F:case T:return new a(+o);case W:case K:return new a(o);case P:return a(o.source,O.exec(o))}f=!r,r||(r=i()),u||(u=i());for(var p=r.length;p--;)if(r[p]==n)return u[p];return o=l?a(o.length):{},l&&(ve.call(n,"index")&&(o.index=n.index),ve.call(n,"input")&&(o.input=n.input)),r.push(n),u.push(o),(l?xt:y)(n,function(n,a){o[a]=Z(n,t,e,r,u)
|
||||
}),f&&(c(r),c(u)),o}function nt(n,t,e){if(typeof n!="function")return Mt;if(typeof t=="undefined")return n;var r=n.__bindData__||Fe.funcNames&&!n.name;if(typeof r=="undefined"){var u=R&&pe.call(n);Fe.funcNames||!u||N.test(u)||(r=!0),(Fe.funcNames||!r)&&(r=!Fe.funcDecomp||R.test(u),Te(n,r))}if(true!==r&&r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)
|
||||
}}return Pt(n,t)}function tt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(ze(a)||pt(a))){t||(a=tt(a,t,e));var i=-1,f=a.length,l=o.length;for(o.length+=f;++i<f;)o[l++]=a[i]}else e||o.push(a)}return o}function et(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&M[typeof n]||t&&M[typeof t]))return!1;if(null==n||null==t)return n===t;var f=_e.call(n),l=_e.call(t);
|
||||
if(f==B&&(f=q),l==B&&(l=q),f!=l)return!1;switch(f){case F:case T:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case P:case K:return n==ee(t)}if(l=f==$,!l){if(ve.call(n,"__wrapped__")||ve.call(t,"__wrapped__"))return et(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(f!=q)return!1;var f=n.constructor,p=t.constructor;if(f!=p&&!(gt(f)&&f instanceof f&>(p)&&p instanceof p))return!1}for(p=!u,u||(u=i()),o||(o=i()),f=u.length;f--;)if(u[f]==n)return o[f]==t;var s=0,a=!0;if(u.push(n),o.push(t),l){if(f=n.length,s=t.length,a=s==n.length,!a&&!r)return a;
|
||||
for(;s--;)if(l=f,p=t[s],r)for(;l--&&!(a=et(n[l],p,e,r,u,o)););else if(!(a=et(n[s],p,e,r,u,o)))break;return a}return d(t,function(t,i,f){return ve.call(f,i)?(s++,a=ve.call(n,i)&&et(n[i],t,e,r,u,o)):void 0}),a&&!r&&d(n,function(n,t,e){return ve.call(e,t)?a=-1<--s:void 0}),p&&(c(u),c(o)),a}function rt(n,t,e,r,u){(ze(t)?xt:y)(t,function(t,o){var a,i,f=t,l=n[o];if(t&&((i=ze(t))||g(t))){for(f=r.length;f--;)if(a=r[f]==t){l=u[f];break}if(!a){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=i?ze(l)?l:[]:g(l)?l:{}),r.push(t),u.push(l),c||rt(l,t,e,r,u)
|
||||
}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function ut(e,r,u){var a=-1,f=ft(),l=e?e.length:0,s=[],v=!r&&l>=_&&f===n,h=u||v?i():s;if(v){var g=o(h);g?(f=t,h=g):(v=!1,h=u?h:(c(h),s))}for(;++a<l;){var g=e[a],y=u?u(g,a,e):g;(r?!a||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(c(h.b),p(h)):u&&c(h),s}function ot(n){return function(t,e,r){var u={};e=Q.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var a=t[r];
|
||||
n(u,a,e(a,r,t),t)}else y(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function at(n,t,e,r,u,o){var a=1&t,i=2&t,f=4&t,l=8&t,c=16&t,p=32&t,s=n;if(!i&&!gt(n))throw new re;c&&!e.length&&(t&=-17,c=e=!1),p&&!r.length&&(t&=-33,p=r=!1);var v=n&&n.__bindData__;if(v)return!a||1&v[1]||(v[4]=u),!a&&1&v[1]&&(t|=8),!f||4&v[1]||(v[5]=o),c&&ge.apply(v[2]||(v[2]=[]),e),p&&ge.apply(v[3]||(v[3]=[]),r),v[1]|=t,at.apply(null,v);if(!a||i||f||p||!(Fe.fastBind||je&&c))g=function(){var v=arguments,h=a?u:this;return(f||c||p)&&(v=Ae.call(v),c&&de.apply(v,e),p&&ge.apply(v,r),f&&v.length<o)?(t|=16,at(n,l?t:-4&t,v,null,u,o)):(i&&(n=h[s]),this instanceof g?(h=yt(n.prototype)?ke(n.prototype):{},v=n.apply(h,v),yt(v)?v:h):n.apply(h,v))
|
||||
};else{if(c){var h=[u];ge.apply(h,e)}var g=c?je.apply(n,h):je.call(n,u)}return Te(g,Ae.call(arguments)),g}function it(n){return qe[n]}function ft(){var t=(t=Q.indexOf)===$t?n:t;return t}function lt(n){var t,e;return n&&_e.call(n)==q&&(t=n.constructor,!gt(t)||t instanceof t)?(d(n,function(n,t){e=t}),typeof e=="undefined"||ve.call(n,e)):!1}function ct(n){return Pe[n]}function pt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&_e.call(n)==B||!1}function st(n,t,e){var r=We(n),u=r.length;for(t=nt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n
|
||||
}function vt(n){var t=[];return d(n,function(n,e){gt(n)&&t.push(e)}),t.sort()}function ht(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function gt(n){return typeof n=="function"}function yt(n){return!(!n||!M[typeof n])}function mt(n){return typeof n=="number"||_e.call(n)==W}function bt(n){return typeof n=="string"||_e.call(n)==K}function _t(n){for(var t=-1,e=We(n),r=e.length,u=Ht(r);++t<r;)u[t]=n[e[t]];return u}function dt(n,t,e){var r=-1,u=ft(),o=n?n.length:0,a=!1;return e=(0>e?Ee(0,o+e):e)||0,ze(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(bt(n)?n.indexOf(t,e):u(n,t,e)):y(n,function(n){return++r<e?void 0:!(a=n===t)
|
||||
}),a}function wt(n,t,e){var r=!0;t=Q.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else y(n,function(n,e,u){return r=!!t(n,e,u)});return r}function jt(n,t,e){var r=[];t=Q.createCallback(t,e,3),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 y(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function kt(n,t,e){t=Q.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return y(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 xt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:nt(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else y(n,t);return n}function Ct(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:nt(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=We(n),r=u.length;y(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function Ot(n,t,e){var r=-1,u=n?n.length:0;if(t=Q.createCallback(t,e,3),typeof u=="number")for(var o=Ht(u);++r<u;)o[r]=t(n[r],r,n);
|
||||
else o=[],y(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Nt(n,t,e){var u=-1/0,o=u;if(!t&&ze(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&bt(n)?r:Q.createCallback(t,e,3),xt(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Et(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Ht(r);++e<r;)u[e]=n[e][t];return u||Ot(n,t)}function It(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=nt(t,r,4);var o=-1,a=n.length;if(typeof a=="number")for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n);
|
||||
else y(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)});return e}function St(n,t,e,r){var u=3>arguments.length;return t=nt(t,r,4),Ct(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Rt(n){var t=-1,e=n?n.length:0,r=Ht(typeof e=="number"?e:0);return xt(n,function(n){var e=Vt(++t);r[t]=r[e],r[e]=n}),r}function At(n,t,e){var r;t=Q.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else y(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Dt(e){var r=-1,u=ft(),a=e?e.length:0,i=tt(arguments,!0,!0,1),f=[],l=a>=_&&u===n;
|
||||
if(l){var c=o(i);c?(u=t,i=c):l=!1}for(;++r<a;)c=e[r],0>u(i,c)&&f.push(c);return l&&p(i),f}function Bt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Q.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Ie(Ee(0,r),u))}function $t(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ee(0,u+r):r||0}else if(r)return r=Tt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Ft(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
|
||||
for(t=Q.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ee(0,t);return s(n,r)}function Tt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Q.createCallback(e,r,1):Mt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function zt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(e=Q.createCallback(e,r,3)),ut(n,t,e)}function Wt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Nt(Et(n,"length")):0,r=Ht(0>e?0:e);++t<e;)r[t]=Et(n,t);return r}function qt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];
|
||||
t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Pt(n,t){return 2<arguments.length?at(n,17,Ae.call(arguments,2),null,t):at(n,1,null,null,t)}function Kt(n,t,e){function r(){c&&le(c),a=c=p=h,(g||v!==t)&&(s=he(),i=n.apply(l,o))}function u(){var e=t-(he()-f);0<e?c=me(u,e):(a&&le(a),e=p,a=c=p=h,e&&(s=he(),i=n.apply(l,o)))}var o,a,i,f,l,c,p,s=0,v=!1,g=!0;if(!gt(n))throw new re;if(t=Ee(0,t)||0,true===e)var y=!0,g=!1;else yt(e)&&(y=e.leading,v="maxWait"in e&&(Ee(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);
|
||||
return function(){if(o=arguments,f=he(),l=this,p=g&&(c||!y),false===v)var e=y&&!c;else{a||y||(s=f);var h=v-(f-s);0<h?a||(a=me(r,h)):(a&&(a=le(a)),s=f,i=n.apply(l,o))}return c||t===v||(c=me(u,t)),e&&(i=n.apply(l,o)),i}}function Lt(n){if(!gt(n))throw new re;var t=Ae.call(arguments,1);return me(function(){n.apply(h,t)},1)}function Mt(n){return n}function Ut(n,t){var e=n,r=!t||gt(e);t||(e=Y,t=n,n=Q),xt(vt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return ge.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:new e(r)
|
||||
})})}function Vt(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r=Re(),e||n%1||t%1?n+Ie(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+ce(r*(t-n+1))}function Gt(){return this.__wrapped__}e=e?X.defaults(V.Object(),e,X.pick(V,D)):V;var Ht=e.Array,Jt=e.Boolean,Qt=e.Date,Xt=e.Function,Yt=e.Math,Zt=e.Number,ne=e.Object,te=e.RegExp,ee=e.String,re=e.TypeError,ue=[],oe=ne.prototype,ae=e._,ie=te("^"+ee(oe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),fe=Yt.ceil,le=e.clearTimeout,ce=Yt.floor,pe=Xt.prototype.toString,se=ie.test(se=ne.getPrototypeOf)&&se,ve=oe.hasOwnProperty,he=ie.test(he=Qt.now)&&he||function(){return+new Qt
|
||||
},ge=ue.push,ye=e.setImmediate,me=e.setTimeout,be=ue.splice,_e=oe.toString,de=ue.unshift,we=function(){try{var n={},t=ie.test(t=ne.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),je=ie.test(je=_e.bind)&&je,ke=ie.test(ke=ne.create)&&ke,xe=ie.test(xe=Ht.isArray)&&xe,Ce=e.isFinite,Oe=e.isNaN,Ne=ie.test(Ne=ne.keys)&&Ne,Ee=Yt.max,Ie=Yt.min,Se=e.parseInt,Re=Yt.random,Ae=ue.slice,De=ie.test(e.attachEvent),Be=je&&!/\n|true/.test(je+De),$e={};$e[$]=Ht,$e[F]=Jt,$e[T]=Qt,$e[z]=Xt,$e[q]=ne,$e[W]=Zt,$e[P]=te,$e[K]=ee,Y.prototype=Q.prototype;
|
||||
var Fe=Q.support={};Fe.fastBind=je&&!Be,Fe.funcDecomp=!ie.test(e.a)&&R.test(v),Fe.funcNames=typeof Xt.name=="string",Q.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:Q}};var Te=we?function(n,t){var e=f();e.value=t,we(n,"__bindData__",e),p(e)}:l,ze=xe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&_e.call(n)==$||!1},We=Ne?function(n){return yt(n)?Ne(n):[]}:H,qe={"&":"&","<":"<",">":">",'"':""","'":"'"},Pe=ht(qe),Ke=te("("+We(Pe).join("|")+")","g"),Le=te("["+We(qe).join("")+"]","g"),Me=ot(function(n,t,e){ve.call(n,e)?n[e]++:n[e]=1
|
||||
}),Ue=ot(function(n,t,e){(ve.call(n,e)?n[e]:n[e]=[]).push(t)}),Ve=ot(function(n,t,e){n[e]=t});Be&&J&&typeof ye=="function"&&(Lt=function(n){if(!gt(n))throw new re;return ye.apply(e,arguments)});var Ge=8==Se(w+"08")?Se:function(n,t){return Se(bt(n)?n.replace(I,""):n,t||0)};return Q.after=function(n,t){if(!gt(t))throw new re;return function(){return 1>--n?t.apply(this,arguments):void 0}},Q.assign=G,Q.at=function(n){for(var t=arguments,e=-1,r=tt(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Ht(t);++e<t;)u[e]=n[r[e]];
|
||||
return u},Q.bind=Pt,Q.bindAll=function(n){for(var t=1<arguments.length?tt(arguments,!0,!1,1):vt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=at(n[u],1,null,null,n)}return n},Q.bindKey=function(n,t){return 2<arguments.length?at(t,19,Ae.call(arguments,2),null,n):at(t,3,null,null,n)},Q.chain=function(n){return n=new Y(n),n.__chain__=!0,n},Q.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},Q.compose=function(){for(var n=arguments,t=n.length;t--;)if(!gt(n[t]))throw new re;
|
||||
return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Q.countBy=Me,Q.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return nt(n,t,e);if("object"!=r)return function(t){return t[n]};var u=We(n),o=u[0],a=n[o];return 1!=u.length||a!==a||yt(a)?function(t){for(var e=u.length,r=!1;e--&&(r=et(t[u[e]],n[u[e]],null,!0)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},Q.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,at(n,4,null,null,null,t)
|
||||
},Q.debounce=Kt,Q.defaults=U,Q.defer=Lt,Q.delay=function(n,t){if(!gt(n))throw new re;var e=Ae.call(arguments,2);return me(function(){n.apply(h,e)},t)},Q.difference=Dt,Q.filter=jt,Q.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(n=Ot(n,e,r)),tt(n,t)},Q.forEach=xt,Q.forEachRight=Ct,Q.forIn=d,Q.forInRight=function(n,t,e){var r=[];d(n,function(n,t){r.push(t,n)});var u=r.length;for(t=nt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},Q.forOwn=y,Q.forOwnRight=st,Q.functions=vt,Q.groupBy=Ue,Q.indexBy=Ve,Q.initial=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Q.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Ie(Ee(0,u-r),u))},Q.intersection=function(e){for(var r=arguments,u=r.length,a=-1,f=i(),l=-1,s=ft(),v=e?e.length:0,h=[],g=i();++a<u;){var y=r[a];f[a]=s===n&&(y?y.length:0)>=_&&o(a?r[a]:g)}n:for(;++l<v;){var m=f[0],y=e[l];if(0>(m?t(m,y):s(g,y))){for(a=u,(m||g).push(y);--a;)if(m=f[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&p(m);return c(f),c(g),h},Q.invert=ht,Q.invoke=function(n,t){var e=Ae.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Ht(typeof o=="number"?o:0);
|
||||
return xt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},Q.keys=We,Q.map=Ot,Q.max=Nt,Q.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return ve.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!gt(n))throw new re;return e.cache={},e},Q.merge=function(n){var t=arguments,e=2;if(!yt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=nt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Ae.call(arguments,1,e),u=-1,o=i(),a=i();++u<e;)rt(n,t[u],r,o,a);
|
||||
return c(o),c(a),n},Q.min=function(n,t,e){var u=1/0,o=u;if(!t&&ze(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&bt(n)?r:Q.createCallback(t,e,3),xt(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},Q.omit=function(n,t,e){var r=ft(),u=typeof t=="function",o={};if(u)t=Q.createCallback(t,e,3);else var a=tt(arguments,!0,!1,1);return d(n,function(n,e,i){(u?!t(n,e,i):0>r(a,e))&&(o[e]=n)}),o},Q.once=function(n){var t,e;if(!gt(n))throw new re;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)
|
||||
}},Q.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Ht(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Q.partial=function(n){return at(n,16,Ae.call(arguments,1))},Q.partialRight=function(n){return at(n,32,null,Ae.call(arguments,1))},Q.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=tt(arguments,!0,!1,1),a=yt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=Q.createCallback(t,e,3),d(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Q.pluck=Et,Q.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(be.call(n,o--,1),u--);
|
||||
return n},Q.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ee(0,fe((t-n)/(e||1)));for(var u=Ht(t);++r<t;)u[r]=n,n+=e;return u},Q.reject=function(n,t,e){return t=Q.createCallback(t,e,3),jt(n,function(n,e,r){return!t(n,e,r)})},Q.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=Q.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),be.call(n,r--,1),u--);return o},Q.rest=Ft,Q.shuffle=Rt,Q.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=Ht(typeof o=="number"?o:0);
|
||||
for(t=Q.createCallback(t,e,3),xt(n,function(n,e,u){var o=a[++r]=f();o.l=t(n,e,u),o.m=r,o.n=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.n,p(n);return a},Q.tap=function(n,t){return t(n),n},Q.throttle=function(n,t,e){var r=!0,u=!0;if(!gt(n))throw new re;return false===e?r=!1:yt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=f(),e.leading=r,e.maxWait=t,e.trailing=u,n=Kt(n,t,e),p(e),n},Q.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ht(n);for(t=nt(t,e,1);++r<n;)u[r]=t(r);return u},Q.toArray=function(n){return n&&typeof n.length=="number"?s(n):_t(n)
|
||||
},Q.transform=function(n,t,e,r){var u=ze(n);return t=nt(t,r,4),null==e&&(u?e=[]:(r=n&&n.constructor,e=yt(r&&r.prototype)?ke(r&&r.prototype):{})),(u?xt:y)(n,function(n,r,u){return t(e,n,r,u)}),e},Q.union=function(){return ut(tt(arguments,!0,!0))},Q.uniq=zt,Q.values=_t,Q.where=jt,Q.without=function(n){return Dt(n,Ae.call(arguments,1))},Q.wrap=function(n,t){if(!gt(t))throw new re;return function(){var e=[n];return ge.apply(e,arguments),t.apply(this,e)}},Q.zip=Wt,Q.zipObject=qt,Q.collect=Ot,Q.drop=Ft,Q.each=xt,Q.c=Ct,Q.extend=G,Q.methods=vt,Q.object=qt,Q.select=jt,Q.tail=Ft,Q.unique=zt,Q.unzip=Wt,Ut(Q),Q.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),Z(n,t,typeof e=="function"&&nt(e,r,1))
|
||||
},Q.cloneDeep=function(n,t,e){return Z(n,!0,typeof t=="function"&&nt(t,e,1))},Q.contains=dt,Q.escape=function(n){return null==n?"":ee(n).replace(Le,it)},Q.every=wt,Q.find=kt,Q.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Q.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Q.findKey=function(n,t,e){var r;return t=Q.createCallback(t,e,3),y(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},Q.findLast=function(n,t,e){var r;return t=Q.createCallback(t,e,3),Ct(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0
|
||||
}),r},Q.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Q.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Q.findLastKey=function(n,t,e){var r;return t=Q.createCallback(t,e,3),st(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},Q.has=function(n,t){return n?ve.call(n,t):!1},Q.identity=Mt,Q.indexOf=$t,Q.isArguments=pt,Q.isArray=ze,Q.isBoolean=function(n){return true===n||false===n||_e.call(n)==F},Q.isDate=function(n){return n?typeof n=="object"&&_e.call(n)==T:!1},Q.isElement=function(n){return n?1===n.nodeType:!1
|
||||
},Q.isEmpty=function(n){var t=!0;if(!n)return t;var e=_e.call(n),r=n.length;return e==$||e==K||e==B||e==q&&typeof r=="number"&>(n.splice)?!r:(y(n,function(){return t=!1}),t)},Q.isEqual=function(n,t,e,r){return et(n,t,typeof e=="function"&&nt(e,r,2))},Q.isFinite=function(n){return Ce(n)&&!Oe(parseFloat(n))},Q.isFunction=gt,Q.isNaN=function(n){return mt(n)&&n!=+n},Q.isNull=function(n){return null===n},Q.isNumber=mt,Q.isObject=yt,Q.isPlainObject=g,Q.isRegExp=function(n){return n?typeof n=="object"&&_e.call(n)==P:!1
|
||||
},Q.isString=bt,Q.isUndefined=function(n){return typeof n=="undefined"},Q.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ee(0,r+e):Ie(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Q.mixin=Ut,Q.noConflict=function(){return e._=ae,this},Q.parseInt=Ge,Q.random=Vt,Q.reduce=It,Q.reduceRight=St,Q.result=function(n,t){if(n){var e=n[t];return gt(e)?n[t]():e}},Q.runInContext=v,Q.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},Q.some=At,Q.sortedIndex=Tt,Q.template=function(n,t,e){var r=Q.templateSettings;
|
||||
n||(n=""),e=U({},e,r);var u,o=U({},e.imports,r.imports),r=We(o),o=_t(o),i=0,f=e.interpolate||S,l="__p+='",f=te((e.escape||S).source+"|"+f.source+"|"+(f===E?C:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(i,c).replace(A,a),e&&(l+="'+__e("+e+")+'"),f&&(u=!0,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(k,"$1").replace(x,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";
|
||||
try{var c=Xt(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Q.unescape=function(n){return null==n?"":ee(n).replace(Ke,ct)},Q.uniqueId=function(n){var t=++m;return ee(null==n?"":n)+t},Q.all=wt,Q.any=At,Q.detect=kt,Q.findWhere=kt,Q.foldl=It,Q.foldr=St,Q.include=dt,Q.inject=It,y(Q,function(n,t){Q.prototype[t]||(Q.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return ge.apply(t,arguments),t=n.apply(Q,t),e?new Y(t,e):t})}),Q.first=Bt,Q.last=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Q.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Ee(0,u-r))},Q.sample=function(n,t,e){var r=n?n.length:0;return typeof r!="number"&&(n=_t(n)),null==t||e?n?n[Vt(r-1)]:h:(n=Rt(n),n.length=Ie(Ee(0,t),n.length),n)},Q.take=Bt,Q.head=Bt,y(Q,function(n,t){var e="sample"!==t;Q.prototype[t]||(Q.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new Y(o,u):o
|
||||
})}),Q.VERSION="2.1.0",Q.prototype.chain=function(){return this.__chain__=!0,this},Q.prototype.toString=function(){return ee(this.__wrapped__)},Q.prototype.value=Gt,Q.prototype.valueOf=Gt,xt(["join","pop","shift"],function(n){var t=ue[n];Q.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new Y(e,n):e}}),xt(["push","reverse","sort","unshift"],function(n){var t=ue[n];Q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),xt(["concat","slice","splice"],function(n){var t=ue[n];
|
||||
Q.prototype[n]=function(){return new Y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Q}var h,g=[],y=[],m=0,b=+new Date+"",_=75,d=40,w=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,x=/(__e\(.*?\)|\b__t\))\+'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,N=/^function[ \n\r\t]+\w/,E=/<%=([\s\S]+?)%>/g,I=RegExp("^["+w+"]*0+(?=.$)"),S=/($^)/,R=/\bthis\b/,A=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),B="[object Arguments]",$="[object Array]",F="[object Boolean]",T="[object Date]",z="[object Function]",W="[object Number]",q="[object Object]",P="[object RegExp]",K="[object String]",L={};
|
||||
L[z]=!1,L[B]=L[$]=L[F]=L[T]=L[W]=L[q]=L[P]=L[K]=!0;var M={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},V=M[typeof window]&&window||this,G=M[typeof exports]&&exports&&!exports.nodeType&&exports,H=M[typeof module]&&module&&!module.nodeType&&module,J=H&&H.exports===G&&G,Q=M[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(V=Q);var X=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(V._=X, define(function(){return X
|
||||
})):G&&H?J?(H.exports=X)._=X:G._=X:V._=X}).call(this);
|
||||
4778
dist/lodash.underscore.js
vendored
Normal file
38
dist/lodash.underscore.min.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.1.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
*/
|
||||
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){var t=n.l,e=r.l;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.m-r.m}function t(n){return"\\"+gr[n]}function e(){}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n}function i(n,r,t){if(typeof n!="function")return Q;if(typeof r=="undefined")return n;switch(t){case 1:return function(t){return n.call(r,t)
|
||||
};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return J(n,r)}function f(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Vr(i)||y(i))){r||(i=f(i,r,t));var a=-1,l=i.length,c=o.length;for(o.length+=l;++a<l;)o[c++]=i[a]}else t||o.push(i)}return o}function a(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&vr[typeof n]||r&&vr[typeof r]))return!1;
|
||||
if(null==n||null==r)return n===r;var o=Sr.call(n),i=Sr.call(r);if(o!=i)return!1;switch(o){case ar:case lr:return+n==+r;case cr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case sr:case hr:return n==r+""}if(i=o==fr,!i){if(Or.call(n,"__wrapped__")||r instanceof u)return a(n.__wrapped__||n,r.__wrapped__||r,t,e);if(o!=pr)return!1;var o=n.constructor,f=r.constructor;if(o!=f&&!(j(o)&&o instanceof o&&j(f)&&f instanceof f))return!1}for(t||(t=[]),e||(e=[]),o=t.length;o--;)if(t[o]==n)return e[o]==r;var l=!0,c=0;
|
||||
if(t.push(n),e.push(r),i){if(c=r.length,l=c==n.length)for(;c--&&(l=a(n[c],r[c],t,e)););return l}return Xr(r,function(r,u,o){return Or.call(o,u)?(c++,!(l=Or.call(n,u)&&a(n[u],r,t,e))&&rr):void 0}),l&&Xr(n,function(n,r,t){return Or.call(t,r)?!(l=-1<--c)&&rr:void 0}),l}function l(n,r,t){for(var e=-1,u=v(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function c(n){return function(r,t,e){var u={};t=K(t,e,3),e=-1;var o=r?r.length:0;
|
||||
if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Yr(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function p(n,r,t,e,u,o){var i=1&r,f=2&r,a=4&r,l=8&r,c=16&r,h=32&r,v=n;if(!f&&!j(n))throw new TypeError;if(c&&!t.length&&(r&=-17,c=t=!1),h&&!e.length&&(r&=-33,h=e=!1),!i||f||a||h||!(Ur.fastBind||Dr&&c))y=function(){var g=arguments,m=i?u:this;return(a||c||h)&&(g=zr.call(g),c&&Br.apply(g,t),h&&Rr.apply(g,e),a&&g.length<o)?(r|=16,p(n,l?r:-4&r,g,null,u,o)):(f&&(n=m[v]),this instanceof y?(m=s(n.prototype),g=n.apply(m,g),x(g)?g:m):n.apply(m,g))
|
||||
};else{if(c){var g=[u];Rr.apply(g,t)}var y=c?Dr.apply(n,g):Dr.call(n,u)}return y}function s(n){return x(n)?Nr(n):{}}function h(n){return Jr[n]}function v(){var r=(r=u.indexOf)===U?n:r;return r}function g(n){return Kr[n]}function y(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n)==ir||!1}function m(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 _(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)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function d(n){var r=[];return Xr(n,function(n,t){j(n)&&r.push(t)}),r.sort()}function b(n){for(var r=-1,t=Hr(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function w(n){if(!n)return!0;if(Vr(n)||T(n))return!n.length;for(var r in n)if(Or.call(n,r))return!1;return!0}function j(n){return typeof n=="function"}function x(n){return!(!n||!vr[typeof n])}function E(n){return typeof n=="number"||Sr.call(n)==cr}function T(n){return typeof n=="string"||Sr.call(n)==hr
|
||||
}function A(n){for(var r=-1,t=Hr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function O(n,r){var t=v(),e=n?n.length:0,u=!1;return e&&typeof e=="number"?u=-1<t(n,r):Yr(n,function(n){return(u=n===r)&&rr}),u}function R(n,r,t){var e=!0;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Yr(n,function(n,t,u){return!(e=!!r(n,t,u))&&rr});return e}function S(n,r,t){var e=[];r=K(r,t,3),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 Yr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function B(n,r,t){r=K(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Yr(n,function(n,t,e){return r(n,t,e)?(u=n,rr):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:i(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==rr;);else Yr(n,r)}function N(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Hr(n),t=e.length;
|
||||
Yr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&rr})}}function k(n,r,t){var e=-1,u=n?n.length:0;if(r=K(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Yr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function F(n,r,t){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=K(r,t,3),D(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 q(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||k(n,r)}function M(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=i(r,e,4);var o=-1,f=n.length;if(typeof f=="number")for(u&&(t=n[++o]);++o<f;)t=r(t,n[o],o,n);else Yr(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function W(n,r,t,e){var u=3>arguments.length;return r=i(r,e,4),N(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function $(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return D(n,function(n){var t=Y(++r);e[r]=e[t],e[t]=n}),e}function I(n,r,t){var e;r=K(r,t,3),t=-1;
|
||||
var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Yr(n,function(n,t,u){return(e=r(n,t,u))&&rr});return!!e}function z(n,r,t){return t&&w(r)?Z:(t?B:S)(n,r)}function C(n){for(var r=-1,t=v(),e=n.length,u=f(arguments,!0,!0,1),o=[];++r<e;){var i=n[r];0>t(u,i)&&o.push(i)}return o}function P(n,r,t){var e=0,u=n?n.length:0;if(typeof r!="number"&&null!=r){var o=-1;for(r=K(r,t,3);++o<u&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[0]:Z;return zr.call(n,0,$r(Wr(0,e),u))}function U(r,t,e){if(typeof e=="number"){var u=r?r.length:0;
|
||||
e=0>e?Wr(0,u+e):e||0}else if(e)return e=G(r,t),r[e]===t?e:-1;return n(r,t,e)}function V(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=K(r,t,3);++u<o&&r(n[u],u,n);)e++}else e=null==r||t?1:Wr(0,r);return zr.call(n,e)}function G(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?K(t,e,1):Q,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function H(n,r,t,e){return typeof r!="boolean"&&null!=r&&(t=(e=t)&&e[r]===n?null:r,r=!1),null!=t&&(t=K(t,e,3)),l(n,r,t)}function J(n,r){return 2<arguments.length?p(n,17,zr.call(arguments,2),null,r):p(n,1,null,null,r)
|
||||
}function K(n,r,t){var e=typeof n;if(null==n||"function"==e)return i(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Hr(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e}}function L(n,r,t){var e,u,o,i,f,a,l,c=0,p=!1,s=!0;if(!j(n))throw new TypeError;if(r=Wr(0,r)||0,true===t)var h=!0,s=!1;else x(t)&&(h=t.leading,p="maxWait"in t&&(Wr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var v=function(){var t=r-(new Date-i);0<t?a=setTimeout(v,t):(u&&clearTimeout(u),t=l,u=a=l=Z,t&&(c=+new Date,o=n.apply(f,e)))
|
||||
},g=function(){a&&clearTimeout(a),u=a=l=Z,(s||p!==r)&&(c=+new Date,o=n.apply(f,e))};return function(){if(e=arguments,i=+new Date,f=this,l=s&&(a||!h),false===p)var t=h&&!a;else{u||h||(c=i);var y=p-(i-c);0<y?u||(u=setTimeout(g,y)):(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e))}return a||r===p||(a=setTimeout(v,r)),t&&(o=n.apply(f,e)),o}}function Q(n){return n}function X(n){D(d(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__&&(n=new o(n),n.__chain__=!0),n
|
||||
}})}function Y(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Ar(Ir()*(r-n+1))}var Z,nr=0,rr={},tr=+new Date+"",er=/($^)/,ur=/\bthis\b/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",hr="[object String]",vr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},gr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=vr[typeof window]&&window||this,mr=vr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=vr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=vr[typeof global]&&global;
|
||||
!br||br.global!==br&&br.window!==br||(yr=br);var wr=[],jr=Object.prototype,xr=yr._,Er=RegExp("^"+(jr.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Tr=Math.ceil,Ar=Math.floor,Or=jr.hasOwnProperty,Rr=wr.push,Sr=jr.toString,Br=wr.unshift,Dr=Er.test(Dr=Sr.bind)&&Dr,Nr=Er.test(Nr=Object.create)&&Nr,kr=Er.test(kr=Array.isArray)&&kr,Fr=yr.isFinite,qr=yr.isNaN,Mr=Er.test(Mr=Object.keys)&&Mr,Wr=Math.max,$r=Math.min,Ir=Math.random,zr=wr.slice,Cr=Er.test(yr.attachEvent),Pr=Dr&&!/\n|true/.test(Dr+Cr);
|
||||
o.prototype=u.prototype;var Ur={};!function(){var n={0:1,length:1};Ur.fastBind=Dr&&!Pr,Ur.funcDecomp=!Er.test(yr.WinRTError)&&ur.test(function(){return this}),Ur.spliceObjects=(wr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Nr||(s=function(n){if(x(n)){e.prototype=n;var r=new e;e.prototype=null}return r||{}}),y(arguments)||(y=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Or.call(n,"callee")||!1
|
||||
});var Vr=kr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n)==fr||!1},Gr=function(n){var r,t=[];if(!n||!vr[typeof n])return t;for(r in n)Or.call(n,r)&&t.push(r);return t},Hr=Mr?function(n){return x(n)?Mr(n):[]}:Gr,Jr={"&":"&","<":"<",">":">",'"':""","'":"'"},Kr=b(Jr),Lr=RegExp("("+Hr(Kr).join("|")+")","g"),Qr=RegExp("["+Hr(Jr).join("")+"]","g"),Xr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(r(n[t],t,n)===rr)break;return n},Yr=function(n,r){var t;
|
||||
if(!n||!vr[typeof n])return n;for(t in n)if(Or.call(n,t)&&r(n[t],t,n)===rr)break;return n};j(/x/)&&(j=function(n){return typeof n=="function"&&"[object Function]"==Sr.call(n)});var Zr=c(function(n,r,t){Or.call(n,t)?n[t]++:n[t]=1}),nt=c(function(n,r,t){(Or.call(n,t)?n[t]:n[t]=[]).push(r)}),rt=c(function(n,r,t){n[t]=r});u.after=function(n,r){if(!j(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=J,u.bindAll=function(n){for(var r=1<arguments.length?f(arguments,!0,!1,1):d(n),t=-1,e=r.length;++t<e;){var u=r[t];
|
||||
n[u]=p(n[u],1,null,null,n)}return n},u.chain=function(n){return n=new o(n),n.__chain__=!0,n},u.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},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!j(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Zr,u.debounce=L,u.defaults=_,u.defer=function(n){if(!j(n))throw new TypeError;var r=zr.call(arguments,1);return setTimeout(function(){n.apply(Z,r)
|
||||
},1)},u.delay=function(n,r){if(!j(n))throw new TypeError;var t=zr.call(arguments,2);return setTimeout(function(){n.apply(Z,t)},r)},u.difference=C,u.filter=S,u.flatten=function(n,r){return f(n,r)},u.forEach=D,u.functions=d,u.groupBy=nt,u.indexBy=rt,u.initial=function(n,r,t){var e=0,u=n?n.length:0;if(typeof r!="number"&&null!=r){var o=u;for(r=K(r,t,3);o--&&r(n[o],o,n);)e++}else e=null==r||t?1:r||e;return zr.call(n,0,$r(Wr(0,u-e),u))},u.intersection=function(n){var r=arguments,t=r.length,e=-1,u=v(),o=n?n.length:0,i=[];
|
||||
n:for(;++e<o;){var f=n[e];if(0>u(i,f)){for(var a=t;--a;)if(0>u(r[a],f))continue n;i.push(f)}}return i},u.invert=b,u.invoke=function(n,r){var t=zr.call(arguments,2),e=-1,u=typeof r=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return D(n,function(n){i[++e]=(u?r:n[r]).apply(n,t)}),i},u.keys=Hr,u.map=k,u.max=F,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):tr+arguments[0];return Or.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e,o=-1,i=n?n.length:0;
|
||||
if(r||typeof i!="number")r=K(r,t,3),D(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},u.omit=function(n){var r=v(),t=f(arguments,!0,!1,1),e={};return Xr(n,function(n,u){0>r(t,u)&&(e[u]=n)}),e},u.once=function(n){var r,t;if(!j(n))throw new TypeError;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},u.pairs=function(n){for(var r=-1,t=Hr(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return p(n,16,zr.call(arguments,1))
|
||||
},u.pick=function(n){for(var r=-1,t=f(arguments,!0,!1,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=q,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Wr(0,Tr((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=K(r,t,3),S(n,function(n,t,e){return!r(n,t,e)})},u.rest=V,u.shuffle=$,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=K(t,e,3),D(n,function(n,r,e){i[++u]={l:t(n,r,e),m:u,n:n}
|
||||
}),o=i.length,i.sort(r);o--;)i[o]=i[o].n;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=!0,u=!0;if(!j(n))throw new TypeError;return false===t?e=!1:x(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;var e=-1,u=Array(n);for(r=i(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Vr(n)?zr.call(n):n&&typeof n.length=="number"?k(n):A(n)},u.union=function(){return l(f(arguments,!0,!0))
|
||||
},u.uniq=H,u.values=A,u.where=z,u.without=function(n){return C(n,zr.call(arguments,1))},u.wrap=function(n,r){if(!j(r))throw new TypeError;return function(){var t=[n];return Rr.apply(t,arguments),r.apply(this,t)}},u.zip=function(){for(var n=-1,r=F(q(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=q(arguments,n);return t},u.collect=k,u.drop=V,u.each=D,u.extend=m,u.methods=d,u.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]:o&&(u[o[0]]=o[1])}return u},u.select=S,u.tail=V,u.unique=H,u.clone=function(n){return x(n)?Vr(n)?zr.call(n):m({},n):n
|
||||
},u.contains=O,u.escape=function(n){return null==n?"":(n+"").replace(Qr,h)},u.every=R,u.find=B,u.has=function(n,r){return n?Or.call(n,r):!1},u.identity=Q,u.indexOf=U,u.isArguments=y,u.isArray=Vr,u.isBoolean=function(n){return true===n||false===n||Sr.call(n)==ar},u.isDate=function(n){return n?typeof n=="object"&&Sr.call(n)==lr:!1},u.isElement=function(n){return n?1===n.nodeType:!1},u.isEmpty=w,u.isEqual=function(n,r){return a(n,r)},u.isFinite=function(n){return Fr(n)&&!qr(parseFloat(n))},u.isFunction=j,u.isNaN=function(n){return E(n)&&n!=+n
|
||||
},u.isNull=function(n){return null===n},u.isNumber=E,u.isObject=x,u.isRegExp=function(n){return n&&vr[typeof n]?Sr.call(n)==sr:!1},u.isString=T,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Wr(0,e+t):$r(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=X,u.noConflict=function(){return yr._=xr,this},u.random=Y,u.reduce=M,u.reduceRight=W,u.result=function(n,r){if(n){var t=n[r];return j(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;
|
||||
return typeof r=="number"?r:Hr(n).length},u.some=I,u.sortedIndex=G,u.template=function(n,r,e){var o=u,i=o.templateSettings;n||(n=""),e=_({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||er).source+"|"+(e.interpolate||er).source+"|"+(e.evaluate||er).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(or,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r}),a+="';\n",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";
|
||||
try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Lr,g)},u.uniqueId=function(n){var r=++nr+"";return n?n+r:r},u.all=R,u.any=I,u.detect=B,u.findWhere=function(n,r){return z(n,r,!0)},u.foldl=M,u.foldr=W,u.include=O,u.inject=M,u.first=P,u.last=function(n,r,t){var e=0,u=n?n.length:0;if(typeof r!="number"&&null!=r){var o=u;for(r=K(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:Z;
|
||||
return zr.call(n,Wr(0,u-e))},u.sample=function(n,r,t){var e=n?n.length:0;return typeof e!="number"&&(n=A(n)),null==r||t?n?n[Y(e-1)]:Z:(n=$(n),n.length=$r(Wr(0,r),n.length),n)},u.take=P,u.head=P,X(u),u.VERSION="2.1.0",u.prototype.chain=function(){return this.__chain__=!0,this},u.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var r=wr[n];u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Ur.spliceObjects||0!==n.length||delete n[0],this
|
||||
}}),D(["concat","join","slice"],function(n){var r=wr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yr._=u, define(function(){return u})):mr&&_r?dr?(_r.exports=u)._=u:mr._=u:yr._=u}).call(this);
|
||||
349
dist/mapping.fp.js
vendored
@@ -1,349 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["mapping"] = factory();
|
||||
else
|
||||
root["mapping"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'mapObj': 'mapValues',
|
||||
'omitAll': 'omit',
|
||||
'nAry': 'ary',
|
||||
'path': 'get',
|
||||
'pathEq': 'matchesProperty',
|
||||
'pathOr': 'getOr',
|
||||
'pickAll': 'pick',
|
||||
'pipe': 'flow',
|
||||
'prop': 'get',
|
||||
'propOf': 'propertyOf',
|
||||
'propOr': 'getOr',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy',
|
||||
'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight',
|
||||
'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range',
|
||||
'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result',
|
||||
'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex',
|
||||
'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith',
|
||||
'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap',
|
||||
'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart',
|
||||
'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without',
|
||||
'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
11723
doc/README.md
36
doc/parse.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// cleanup requested filepath
|
||||
$file = isset($_GET['f']) ? $_GET['f'] : 'lodash';
|
||||
$file = preg_replace('#(\.*[\/])+#', '', $file);
|
||||
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js';
|
||||
|
||||
// output filename
|
||||
if (isset($_GET['o'])) {
|
||||
$output = $_GET['o'];
|
||||
} else if (isset($_SERVER['argv'][1])) {
|
||||
$output = $_SERVER['argv'][1];
|
||||
} else {
|
||||
$output = basename($file);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
require('../vendor/docdown/docdown.php');
|
||||
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <span>v2.1.0</span>',
|
||||
'toc' => 'categories',
|
||||
'url' => 'https://github.com/lodash/lodash/blob/2.1.0/lodash.js'
|
||||
));
|
||||
|
||||
// save to a .md file
|
||||
file_put_contents($output . '.md', $markdown);
|
||||
|
||||
// print
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
echo $markdown . PHP_EOL;
|
||||
|
||||
?>
|
||||
@@ -1,469 +0,0 @@
|
||||
var mapping = require('./_mapping'),
|
||||
mutateMap = mapping.mutate,
|
||||
fallbackHolder = require('./placeholder');
|
||||
|
||||
/**
|
||||
* Creates a function, with an arity of `n`, that invokes `func` with the
|
||||
* arguments it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} n The arity of the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseArity(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func.apply(undefined, arguments); }
|
||||
: function(a) { return func.apply(undefined, arguments); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
|
||||
* any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseAry(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func(a, b); }
|
||||
: function(a) { return func(a); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to clone.
|
||||
* @returns {Array} Returns the cloned array.
|
||||
*/
|
||||
function cloneArray(array) {
|
||||
var length = array ? array.length : 0,
|
||||
result = Array(length);
|
||||
|
||||
while (length--) {
|
||||
result[length] = array[length];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that clones a given object using the assignment `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The assignment function.
|
||||
* @returns {Function} Returns the new cloner function.
|
||||
*/
|
||||
function createCloner(func) {
|
||||
return function(object) {
|
||||
return func({}, object);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and uses `cloner` to clone the first
|
||||
* argument it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {Function} cloner The function to clone arguments.
|
||||
* @returns {Function} Returns the new immutable function.
|
||||
*/
|
||||
function immutWrap(func, cloner) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var result = args[0] = cloner.apply(undefined, args);
|
||||
func.apply(undefined, args);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `convert` which accepts a `util` object of methods
|
||||
* required to perform conversions.
|
||||
*
|
||||
* @param {Object} util The util object.
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||
* @param {boolean} [options.curry=true] Specify currying.
|
||||
* @param {boolean} [options.fixed=true] Specify fixed arity.
|
||||
* @param {boolean} [options.immutable=true] Specify immutable operations.
|
||||
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function baseConvert(util, name, func, options) {
|
||||
var setPlaceholder,
|
||||
isLib = typeof name == 'function',
|
||||
isObj = name === Object(name);
|
||||
|
||||
if (isObj) {
|
||||
options = func;
|
||||
func = name;
|
||||
name = undefined;
|
||||
}
|
||||
if (func == null) {
|
||||
throw new TypeError;
|
||||
}
|
||||
options || (options = {});
|
||||
|
||||
var config = {
|
||||
'cap': 'cap' in options ? options.cap : true,
|
||||
'curry': 'curry' in options ? options.curry : true,
|
||||
'fixed': 'fixed' in options ? options.fixed : true,
|
||||
'immutable': 'immutable' in options ? options.immutable : true,
|
||||
'rearg': 'rearg' in options ? options.rearg : true
|
||||
};
|
||||
|
||||
var forceCurry = ('curry' in options) && options.curry,
|
||||
forceFixed = ('fixed' in options) && options.fixed,
|
||||
forceRearg = ('rearg' in options) && options.rearg,
|
||||
placeholder = isLib ? func : fallbackHolder,
|
||||
pristine = isLib ? func.runInContext() : undefined;
|
||||
|
||||
var helpers = isLib ? func : {
|
||||
'ary': util.ary,
|
||||
'assign': util.assign,
|
||||
'clone': util.clone,
|
||||
'curry': util.curry,
|
||||
'forEach': util.forEach,
|
||||
'isArray': util.isArray,
|
||||
'isFunction': util.isFunction,
|
||||
'iteratee': util.iteratee,
|
||||
'keys': util.keys,
|
||||
'rearg': util.rearg,
|
||||
'spread': util.spread,
|
||||
'toPath': util.toPath
|
||||
};
|
||||
|
||||
var ary = helpers.ary,
|
||||
assign = helpers.assign,
|
||||
clone = helpers.clone,
|
||||
curry = helpers.curry,
|
||||
each = helpers.forEach,
|
||||
isArray = helpers.isArray,
|
||||
isFunction = helpers.isFunction,
|
||||
keys = helpers.keys,
|
||||
rearg = helpers.rearg,
|
||||
spread = helpers.spread,
|
||||
toPath = helpers.toPath;
|
||||
|
||||
var aryMethodKeys = keys(mapping.aryMethod);
|
||||
|
||||
var wrappers = {
|
||||
'castArray': function(castArray) {
|
||||
return function() {
|
||||
var value = arguments[0];
|
||||
return isArray(value)
|
||||
? castArray(cloneArray(value))
|
||||
: castArray.apply(undefined, arguments);
|
||||
};
|
||||
},
|
||||
'iteratee': function(iteratee) {
|
||||
return function() {
|
||||
var func = arguments[0],
|
||||
arity = arguments[1],
|
||||
result = iteratee(func, arity),
|
||||
length = result.length;
|
||||
|
||||
if (config.cap && typeof arity == 'number') {
|
||||
arity = arity > 2 ? (arity - 2) : 1;
|
||||
return (length && length <= arity) ? result : baseAry(result, arity);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
},
|
||||
'mixin': function(mixin) {
|
||||
return function(source) {
|
||||
var func = this;
|
||||
if (!isFunction(func)) {
|
||||
return mixin(func, Object(source));
|
||||
}
|
||||
var methods = [],
|
||||
methodNames = [];
|
||||
|
||||
each(keys(source), function(key) {
|
||||
var value = source[key];
|
||||
if (isFunction(value)) {
|
||||
methodNames.push(key);
|
||||
methods.push(func.prototype[key]);
|
||||
}
|
||||
});
|
||||
|
||||
mixin(func, Object(source));
|
||||
|
||||
each(methodNames, function(methodName, index) {
|
||||
var method = methods[index];
|
||||
if (isFunction(method)) {
|
||||
func.prototype[methodName] = method;
|
||||
} else {
|
||||
delete func.prototype[methodName];
|
||||
}
|
||||
});
|
||||
return func;
|
||||
};
|
||||
},
|
||||
'runInContext': function(runInContext) {
|
||||
return function(context) {
|
||||
return baseConvert(util, runInContext(context), options);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a clone of `object` by `path`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to clone.
|
||||
* @param {Array|string} path The path to clone by.
|
||||
* @returns {Object} Returns the cloned object.
|
||||
*/
|
||||
function cloneByPath(object, path) {
|
||||
path = toPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
result = clone(Object(object)),
|
||||
nested = result;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = path[index],
|
||||
value = nested[key];
|
||||
|
||||
if (value != null) {
|
||||
nested[key] = clone(Object(value));
|
||||
}
|
||||
nested = nested[key];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function convertLib(options) {
|
||||
return _.runInContext.convert(options)(undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a converter function for `func` of `name`.
|
||||
*
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @returns {Function} Returns the new converter function.
|
||||
*/
|
||||
function createConverter(name, func) {
|
||||
var oldOptions = options;
|
||||
return function(options) {
|
||||
var newUtil = isLib ? pristine : helpers,
|
||||
newFunc = isLib ? pristine[name] : func,
|
||||
newOptions = assign(assign({}, oldOptions), options);
|
||||
|
||||
return baseConvert(newUtil, name, newFunc, newOptions);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
|
||||
* arguments, ignoring any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap iteratee arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeAry(func, n) {
|
||||
return overArg(func, function(func) {
|
||||
return typeof func == 'function' ? baseAry(func, n) : func;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee with arguments
|
||||
* arranged according to the specified `indexes` where the argument value at
|
||||
* the first index is provided as the first argument, the argument value at
|
||||
* the second index is provided as the second argument, and so on.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to rearrange iteratee arguments for.
|
||||
* @param {number[]} indexes The arranged argument indexes.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeRearg(func, indexes) {
|
||||
return overArg(func, function(func) {
|
||||
var n = indexes.length;
|
||||
return baseArity(rearg(baseAry(func, n), indexes), n);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with its first argument passed
|
||||
* thru `transform`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...Function} transform The functions to transform the first argument.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function overArg(func, transform) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return func();
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var index = config.rearg ? 0 : (length - 1);
|
||||
args[index] = transform(args[index]);
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and applys the conversions
|
||||
* rules by `name`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} func The function to wrap.
|
||||
* @returns {Function} Returns the converted function.
|
||||
*/
|
||||
function wrap(name, func) {
|
||||
name = mapping.aliasToReal[name] || name;
|
||||
|
||||
var result,
|
||||
wrapped = func,
|
||||
wrapper = wrappers[name];
|
||||
|
||||
if (wrapper) {
|
||||
wrapped = wrapper(func);
|
||||
}
|
||||
else if (config.immutable) {
|
||||
if (mutateMap.array[name]) {
|
||||
wrapped = immutWrap(func, cloneArray);
|
||||
}
|
||||
else if (mutateMap.object[name]) {
|
||||
wrapped = immutWrap(func, createCloner(func));
|
||||
}
|
||||
else if (mutateMap.set[name]) {
|
||||
wrapped = immutWrap(func, cloneByPath);
|
||||
}
|
||||
}
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(otherName) {
|
||||
if (name == otherName) {
|
||||
var aryN = !isLib && mapping.iterateeAry[name],
|
||||
reargIndexes = mapping.iterateeRearg[name],
|
||||
spreadStart = mapping.methodSpread[name];
|
||||
|
||||
result = wrapped;
|
||||
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||
result = spreadStart === undefined
|
||||
? ary(result, aryKey)
|
||||
: spread(result, spreadStart);
|
||||
}
|
||||
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
|
||||
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
|
||||
}
|
||||
if (config.cap) {
|
||||
if (reargIndexes) {
|
||||
result = iterateeRearg(result, reargIndexes);
|
||||
} else if (aryN) {
|
||||
result = iterateeAry(result, aryN);
|
||||
}
|
||||
}
|
||||
if (forceCurry || (config.curry && aryKey > 1)) {
|
||||
forceCurry && console.log(forceCurry, name);
|
||||
result = curry(result, aryKey);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
result || (result = wrapped);
|
||||
if (result == func) {
|
||||
result = forceCurry ? curry(result, 1) : function() {
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
result.convert = createConverter(name, func);
|
||||
if (mapping.placeholder[name]) {
|
||||
setPlaceholder = true;
|
||||
result.placeholder = func.placeholder = placeholder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (!isObj) {
|
||||
return wrap(name, func);
|
||||
}
|
||||
var _ = func;
|
||||
|
||||
// Convert methods by ary cap.
|
||||
var pairs = [];
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(key) {
|
||||
var func = _[mapping.remap[key] || key];
|
||||
if (func) {
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Convert remaining methods.
|
||||
each(keys(_), function(key) {
|
||||
var func = _[key];
|
||||
if (typeof func == 'function') {
|
||||
var length = pairs.length;
|
||||
while (length--) {
|
||||
if (pairs[length][0] == key) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
func.convert = createConverter(key, func);
|
||||
pairs.push([key, func]);
|
||||
}
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
_.convert = convertLib;
|
||||
if (setPlaceholder) {
|
||||
_.placeholder = placeholder;
|
||||
}
|
||||
// Assign aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.realToAlias[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
module.exports = baseConvert;
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert');
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Function} lodash The lodash function to convert.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function browserConvert(lodash, options) {
|
||||
return baseConvert(lodash, lodash, options);
|
||||
}
|
||||
|
||||
if (typeof _ == 'function') {
|
||||
_ = browserConvert(_.runInContext());
|
||||
}
|
||||
module.exports = browserConvert;
|
||||
287
fp/_mapping.js
@@ -1,287 +0,0 @@
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'mapObj': 'mapValues',
|
||||
'omitAll': 'omit',
|
||||
'nAry': 'ary',
|
||||
'path': 'get',
|
||||
'pathEq': 'matchesProperty',
|
||||
'pathOr': 'getOr',
|
||||
'pickAll': 'pick',
|
||||
'pipe': 'flow',
|
||||
'prop': 'get',
|
||||
'propOf': 'propertyOf',
|
||||
'propOr': 'getOr',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy',
|
||||
'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight',
|
||||
'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range',
|
||||
'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result',
|
||||
'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex',
|
||||
'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith',
|
||||
'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap',
|
||||
'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart',
|
||||
'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without',
|
||||
'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* The default argument placeholder value for methods.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = {};
|
||||
1
index.js
Executable file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/lodash.compat.js');
|
||||
@@ -1,36 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
glob = require('glob'),
|
||||
path = require('path');
|
||||
|
||||
var minify = require('../common/minify.js');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function copy(srcPath, destPath) {
|
||||
return _.partial(fs.copy, srcPath, destPath);
|
||||
}
|
||||
|
||||
function globTemplate(pattern) {
|
||||
return _.transform(glob.sync(pattern), function(result, filePath) {
|
||||
var key = path.basename(filePath, path.extname(filePath));
|
||||
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
|
||||
}, {});
|
||||
}
|
||||
|
||||
function min(srcPath, destPath) {
|
||||
return _.partial(minify, srcPath, destPath);
|
||||
}
|
||||
|
||||
function write(filePath, data) {
|
||||
return _.partial(fs.writeFile, filePath, data);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
'copy': copy,
|
||||
'globTemplate': globTemplate,
|
||||
'min': min,
|
||||
'write': write
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _mapping = require('../../fp/_mapping'),
|
||||
util = require('./util'),
|
||||
Hash = util.Hash;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
module.exports = new Hash(_mapping);
|
||||
@@ -1,26 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
uglify = require('uglify-js');
|
||||
|
||||
var uglifyOptions = require('./uglify.options');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function minify(srcPath, destPath, callback, options) {
|
||||
if (_.isFunction(destPath)) {
|
||||
if (_.isObject(callback)) {
|
||||
options = callback;
|
||||
}
|
||||
callback = destPath;
|
||||
destPath = undefined;
|
||||
}
|
||||
if (!destPath) {
|
||||
destPath = srcPath.replace(/(?=\.js$)/, '.min');
|
||||
}
|
||||
var output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
|
||||
fs.writeFile(destPath, output.code, 'utf-8', callback);
|
||||
}
|
||||
|
||||
module.exports = minify;
|
||||
@@ -1,18 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
'compress': {
|
||||
'pure_getters': true,
|
||||
'unsafe': true,
|
||||
'unsafe_comps': true,
|
||||
'warnings': false
|
||||
},
|
||||
'mangle': {
|
||||
'except': ['define']
|
||||
},
|
||||
'output': {
|
||||
'ascii_only': true,
|
||||
'comments': /^!|@cc_on|@license|@preserve/i,
|
||||
'max_line_len': 500
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a hash object. If a `properties` object is provided, its own
|
||||
* enumerable properties are assigned to the created object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @param {Object} [properties] The properties to assign to the object.
|
||||
* @returns {Object} Returns the new hash object.
|
||||
*/
|
||||
function Hash(properties) {
|
||||
return _.transform(properties, function(result, value, key) {
|
||||
result[key] = (_.isPlainObject(value) && !(value instanceof Hash))
|
||||
? new Hash(value)
|
||||
: value;
|
||||
}, this);
|
||||
}
|
||||
|
||||
Hash.prototype = Object.create(null);
|
||||
|
||||
module.exports = {
|
||||
'Hash': Hash
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
path = require('path'),
|
||||
webpack = require('webpack');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist'),
|
||||
fpPath = path.join(basePath, 'fp'),
|
||||
filename = 'lodash.fp.js';
|
||||
|
||||
var fpConfig = {
|
||||
'entry': path.join(fpPath, '_convertBrowser.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': filename,
|
||||
'library': 'fp',
|
||||
'libraryTarget': 'umd'
|
||||
},
|
||||
'plugins': [
|
||||
new webpack.optimize.OccurenceOrderPlugin,
|
||||
new webpack.optimize.DedupePlugin
|
||||
]
|
||||
};
|
||||
|
||||
var mappingConfig = {
|
||||
'entry': path.join(fpPath, '_mapping.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': 'mapping.fp.js',
|
||||
'library': 'mapping',
|
||||
'libraryTarget': 'umd'
|
||||
}
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build() {
|
||||
async.series([
|
||||
_.partial(webpack, mappingConfig),
|
||||
_.partial(webpack, fpConfig),
|
||||
file.min(path.join(distPath, filename))
|
||||
], onComplete);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,65 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file'),
|
||||
mapping = require('../common/mapping');
|
||||
|
||||
var templatePath = path.join(__dirname, 'template/doc'),
|
||||
template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
var argNames = ['a', 'b', 'c', 'd'];
|
||||
|
||||
var templateData = {
|
||||
'mapping': mapping,
|
||||
'toArgOrder': toArgOrder,
|
||||
'toFuncList': toFuncList
|
||||
};
|
||||
|
||||
function toArgOrder(array) {
|
||||
var reordered = [];
|
||||
_.each(array, function(newIndex, index) {
|
||||
reordered[newIndex] = argNames[index];
|
||||
});
|
||||
return '`(' + reordered.join(', ') + ')`';
|
||||
}
|
||||
|
||||
function toFuncList(array) {
|
||||
var chunks = _.chunk(array.slice().sort(), 5),
|
||||
lastChunk = _.last(chunks),
|
||||
last = lastChunk ? lastChunk.pop() : undefined;
|
||||
|
||||
chunks = _.reject(chunks, _.isEmpty);
|
||||
lastChunk = _.last(chunks);
|
||||
|
||||
var result = '`' + _.map(chunks, function(chunk) {
|
||||
return chunk.join('`, `') + '`';
|
||||
}).join(',\n`');
|
||||
|
||||
if (last == null) {
|
||||
return result;
|
||||
}
|
||||
if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
|
||||
result += ',';
|
||||
}
|
||||
result += ' &';
|
||||
result += _.size(lastChunk) < 5 ? ' ' : '\n';
|
||||
return result + '`' + last + '`';
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
target = path.resolve(target);
|
||||
fs.writeFile(target, template.wiki(templateData), onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,120 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
glob = require('glob'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file'),
|
||||
mapping = require('../common/mapping');
|
||||
|
||||
var templatePath = path.join(__dirname, 'template/modules'),
|
||||
template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
var aryMethods = _.union(
|
||||
mapping.aryMethod[1],
|
||||
mapping.aryMethod[2],
|
||||
mapping.aryMethod[3],
|
||||
mapping.aryMethod[4]
|
||||
);
|
||||
|
||||
var categories = [
|
||||
'array',
|
||||
'collection',
|
||||
'date',
|
||||
'function',
|
||||
'lang',
|
||||
'math',
|
||||
'number',
|
||||
'object',
|
||||
'seq',
|
||||
'string',
|
||||
'util'
|
||||
];
|
||||
|
||||
var ignored = [
|
||||
'_*.js',
|
||||
'core.js',
|
||||
'core.min.js',
|
||||
'fp.js',
|
||||
'index.js',
|
||||
'lodash.js',
|
||||
'lodash.min.js'
|
||||
];
|
||||
|
||||
function isAlias(funcName) {
|
||||
return _.has(mapping.aliasToReal, funcName);
|
||||
}
|
||||
|
||||
function isCategory(funcName) {
|
||||
return _.includes(categories, funcName);
|
||||
}
|
||||
|
||||
function isThru(funcName) {
|
||||
return !_.includes(aryMethods, funcName);
|
||||
}
|
||||
|
||||
function getTemplate(moduleName) {
|
||||
var data = {
|
||||
'name': _.result(mapping.aliasToReal, moduleName, moduleName),
|
||||
'mapping': mapping
|
||||
};
|
||||
|
||||
if (isAlias(moduleName)) {
|
||||
return template.alias(data);
|
||||
}
|
||||
if (isCategory(moduleName)) {
|
||||
return template.category(data);
|
||||
}
|
||||
if (isThru(moduleName)) {
|
||||
return template.thru(data);
|
||||
}
|
||||
return template.module(data);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
target = path.resolve(target);
|
||||
|
||||
var fpPath = path.join(target, 'fp');
|
||||
|
||||
// Glob existing lodash module paths.
|
||||
var modulePaths = glob.sync(path.join(target, '*.js'), {
|
||||
'nodir': true,
|
||||
'ignore': ignored.map(function(filename) {
|
||||
return path.join(target, filename);
|
||||
})
|
||||
});
|
||||
|
||||
// Add FP alias and remapped module paths.
|
||||
_.each([mapping.aliasToReal, mapping.remap], function(data) {
|
||||
_.forOwn(data, function(realName, alias) {
|
||||
var modulePath = path.join(target, alias + '.js');
|
||||
if (!_.includes(modulePaths, modulePath)) {
|
||||
modulePaths.push(modulePath);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var actions = modulePaths.map(function(modulePath) {
|
||||
var moduleName = path.basename(modulePath, '.js');
|
||||
return file.write(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
||||
});
|
||||
|
||||
actions.unshift(file.copy(path.join(__dirname, '../../fp'), fpPath));
|
||||
actions.push(file.write(path.join(fpPath, '_falseOptions.js'), template._falseOptions()));
|
||||
actions.push(file.write(path.join(fpPath, '_util.js'), template._util()));
|
||||
actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
|
||||
actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
|
||||
|
||||
async.series(actions, onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,220 +0,0 @@
|
||||
## lodash/fp
|
||||
|
||||
The `lodash/fp` module is an instance of `lodash` with its methods wrapped to
|
||||
produce immutable auto-curried iteratee-first data-last methods.
|
||||
|
||||
## Installation
|
||||
|
||||
In a browser:
|
||||
```html
|
||||
<script src='path/to/lodash.js'></script>
|
||||
<script src='path/to/lodash.fp.js'></script>
|
||||
<script>
|
||||
// Loading `lodash.fp.js` converts `_` to its fp variant.
|
||||
_.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
|
||||
// Use `noConflict` to restore the pre-fp variant.
|
||||
var fp = _.noConflict();
|
||||
|
||||
_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
</script>
|
||||
```
|
||||
|
||||
In Node.js:
|
||||
```js
|
||||
// Load the fp build.
|
||||
var fp = require('lodash/fp');
|
||||
|
||||
// Load a method category.
|
||||
var object = require('lodash/fp/object');
|
||||
|
||||
// Load a single method for smaller builds with browserify/rollup/webpack.
|
||||
var extend = require('lodash/fp/extend');
|
||||
```
|
||||
|
||||
## Mapping
|
||||
|
||||
Immutable auto-curried iteratee-first data-last methods sound great, but what
|
||||
does that really mean for each method? Below is a breakdown of the mapping used
|
||||
to convert each method.
|
||||
|
||||
#### Capped Iteratee Arguments
|
||||
|
||||
Iteratee arguments are capped to avoid gotchas with variadic iteratees.
|
||||
```js
|
||||
// The `lodash/map` iteratee receives three arguments:
|
||||
// (value, index|key, collection)
|
||||
_.map(['6', '8', '10'], parseInt);
|
||||
// → [6, NaN, 2]
|
||||
|
||||
// The `lodash/fp/map` iteratee is capped at one argument:
|
||||
// (value)
|
||||
fp.map(parseInt)(['6', '8', '10']);
|
||||
// → [6, 8, 10]
|
||||
```
|
||||
|
||||
Methods that cap iteratees to one argument:<br>
|
||||
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 1)))) %>
|
||||
|
||||
Methods that cap iteratees to two arguments:<br>
|
||||
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 2)))) %>
|
||||
|
||||
The iteratee of `mapKeys` is invoked with one argument: (key)
|
||||
|
||||
#### Fixed Arity
|
||||
|
||||
Methods have fixed arities to support auto-currying.
|
||||
```js
|
||||
// `lodash/padStart` accepts an optional `chars` param.
|
||||
_.padStart('a', 3, '-')
|
||||
// → '--a'
|
||||
|
||||
// `lodash/fp/padStart` does not.
|
||||
fp.padStart(3)('a');
|
||||
// → ' a'
|
||||
fp.padCharsStart('-')(3)('a');
|
||||
// → '--a'
|
||||
```
|
||||
|
||||
Methods with a fixed arity of one:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[1], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of two:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[2], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of three:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[3], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of four:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[4], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
#### Rearranged Arguments
|
||||
|
||||
Method arguments are rearranged to make composition easier.
|
||||
```js
|
||||
// `lodash/filter` is data-first iteratee-last:
|
||||
// (collection, iteratee)
|
||||
var compact = _.partial(_.filter, _, Boolean);
|
||||
compact(['a', null, 'c']);
|
||||
// → ['a', 'c']
|
||||
|
||||
// `lodash/fp/filter` is iteratee-first data-last:
|
||||
// (iteratee, collection)
|
||||
var compact = fp.filter(Boolean);
|
||||
compact(['a', null, 'c']);
|
||||
// → ['a', 'c']
|
||||
```
|
||||
|
||||
##### Most methods follow these rules
|
||||
|
||||
A fixed arity of two has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[2]) %>
|
||||
|
||||
A fixed arity of three has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[3]) %>
|
||||
|
||||
A fixed arity of four has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[4]) %>
|
||||
|
||||
##### Exceptions to the rules
|
||||
|
||||
Methods that accept an array of arguments as their second parameter:<br>
|
||||
<%= toFuncList(_.keys(mapping.methodSpread)) %>
|
||||
|
||||
Methods with unchanged argument orders:<br>
|
||||
<%= toFuncList(_.keys(mapping.skipRearg)) %>
|
||||
|
||||
Methods with custom argument orders:<br>
|
||||
<%= _.map(_.keys(mapping.methodRearg), function(methodName) {
|
||||
var orders = mapping.methodRearg[methodName];
|
||||
return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
|
||||
}).join('\n') %>
|
||||
|
||||
#### New Methods
|
||||
|
||||
Not all variadic methods have corresponding new method variants. Feel free to
|
||||
[request](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md#feature-requests)
|
||||
any additions.
|
||||
|
||||
Methods created to accommodate Lodash’s variadic methods:<br>
|
||||
<%= toFuncList(_.keys(mapping.remap)) %>
|
||||
|
||||
#### Aliases
|
||||
|
||||
There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
|
||||
<%= _.map(_.keys(mapping.aliasToReal).sort(), function(alias) {
|
||||
var realName = mapping.aliasToReal[alias];
|
||||
return ' * `_.' + alias + '` is an alias of `_.' + realName + '`';
|
||||
}).join('\n') %>
|
||||
|
||||
## Placeholders
|
||||
|
||||
The placeholder argument, which defaults to `_`, may be used to fill in method
|
||||
arguments in a different order. Placeholders are filled by the first available
|
||||
arguments of the curried returned function.
|
||||
```js
|
||||
// The equivalent of `2 > 5`.
|
||||
_.gt(2)(5);
|
||||
// → false
|
||||
|
||||
// The equivalent of `_.gt(5, 2)` or `5 > 2`.
|
||||
_.gt(_, 2)(5);
|
||||
// → true
|
||||
```
|
||||
|
||||
## Chaining
|
||||
|
||||
The `lodash/fp` module **does not** convert chain sequence methods. See
|
||||
[Izaak Schroeder’s article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
|
||||
on using functional composition as an alternative to method chaining.
|
||||
|
||||
## Convert
|
||||
|
||||
Although `lodash/fp` & its method modules come pre-converted, there are times
|
||||
when you may want to customize the conversion. That’s when the `convert` method
|
||||
comes in handy.
|
||||
```js
|
||||
// Every option is `true` by default.
|
||||
var _fp = fp.convert({
|
||||
// Specify capping iteratee arguments.
|
||||
'cap': true,
|
||||
// Specify currying.
|
||||
'curry': true,
|
||||
// Specify fixed arity.
|
||||
'fixed': true,
|
||||
// Specify immutable operations.
|
||||
'immutable': true,
|
||||
// Specify rearranging arguments.
|
||||
'rearg': true
|
||||
});
|
||||
|
||||
// The `convert` method is available on each method too.
|
||||
var mapValuesWithKey = fp.mapValues.convert({ 'cap': false });
|
||||
|
||||
// Here’s an example of disabling iteratee argument caps to access the `key` param.
|
||||
mapValuesWithKey(function(value, key) {
|
||||
return key == 'a' ? -1 : value;
|
||||
})({ 'a': 1, 'b': 1 });
|
||||
// => { 'a': -1, 'b': 1 }
|
||||
```
|
||||
|
||||
Manual conversions are also possible with the `convert` module.
|
||||
```js
|
||||
var convert = require('lodash/fp/convert');
|
||||
|
||||
// Convert by name.
|
||||
var assign = convert('assign', require('lodash.assign'));
|
||||
|
||||
// Convert by object.
|
||||
var fp = convert({
|
||||
'assign': require('lodash.assign'),
|
||||
'chunk': require('lodash.chunk')
|
||||
});
|
||||
|
||||
// Convert by `lodash` instance.
|
||||
var fp = convert(lodash.runInContext());
|
||||
```
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
'cap': false,
|
||||
'curry': false,
|
||||
'fixed': false,
|
||||
'immutable': false,
|
||||
'rearg': false
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
'ary': require('../ary'),
|
||||
'assign': require('../_baseAssign'),
|
||||
'clone': require('../clone'),
|
||||
'curry': require('../curry'),
|
||||
'forEach': require('../_arrayEach'),
|
||||
'isArray': require('../isArray'),
|
||||
'isFunction': require('../isFunction'),
|
||||
'iteratee': require('../iteratee'),
|
||||
'keys': require('../_baseKeys'),
|
||||
'rearg': require('../rearg'),
|
||||
'spread': require('../spread'),
|
||||
'toPath': require('../toPath')
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('./<%= name %>');
|
||||
@@ -1,2 +0,0 @@
|
||||
var convert = require('./convert');
|
||||
module.exports = convert(require('../<%= name %>'));
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert'),
|
||||
util = require('./_util');
|
||||
|
||||
/**
|
||||
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied. If `name` is an object its methods
|
||||
* will be converted.
|
||||
*
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} [func] The function to wrap.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function convert(name, func, options) {
|
||||
return baseConvert(util, name, func, options);
|
||||
}
|
||||
|
||||
module.exports = convert;
|
||||
@@ -1,2 +0,0 @@
|
||||
var _ = require('./lodash.min').runInContext();
|
||||
module.exports = require('./fp/_baseConvert')(_, _);
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist'),
|
||||
filename = 'lodash.js';
|
||||
|
||||
var baseLodash = path.join(basePath, filename),
|
||||
distLodash = path.join(distPath, filename);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build() {
|
||||
async.series([
|
||||
file.copy(baseLodash, distLodash),
|
||||
file.min(distLodash)
|
||||
], onComplete);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,60 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
docdown = require('docdown'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
docPath = path.join(basePath, 'doc'),
|
||||
readmePath = path.join(docPath, 'README.md');
|
||||
|
||||
var pkg = require('../../package.json'),
|
||||
version = pkg.version;
|
||||
|
||||
var config = {
|
||||
'base': {
|
||||
'entryLinks': [
|
||||
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
|
||||
'print("[Ⓝ](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' +
|
||||
'} %>'
|
||||
],
|
||||
'path': path.join(basePath, 'lodash.js'),
|
||||
'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
|
||||
'toc': 'categories',
|
||||
'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
|
||||
},
|
||||
'github': {
|
||||
'hash': 'github'
|
||||
},
|
||||
'site': {
|
||||
'tocLink': '#docs'
|
||||
}
|
||||
};
|
||||
|
||||
function postprocess(string) {
|
||||
// Fix docdown bugs.
|
||||
return string
|
||||
// Repair the default value of `chars`.
|
||||
// See https://github.com/eslint/doctrine/issues/157 for more details.
|
||||
.replace(/\bchars=''/g, "chars=' '")
|
||||
// Wrap symbol property identifiers in brackets.
|
||||
.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(type) {
|
||||
var options = _.defaults({}, config.base, config[type]),
|
||||
markdown = docdown(options);
|
||||
|
||||
fs.writeFile(readmePath, postprocess(markdown), onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,34 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist');
|
||||
|
||||
var filePairs = [
|
||||
[path.join(distPath, 'lodash.core.js'), 'core.js'],
|
||||
[path.join(distPath, 'lodash.core.min.js'), 'core.min.js'],
|
||||
[path.join(distPath, 'lodash.min.js'), 'lodash.min.js']
|
||||
];
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
var actions = _.map(filePairs, function(pair) {
|
||||
return file.copy(pair[0], path.join(target, pair[1]));
|
||||
});
|
||||
|
||||
async.series(actions, onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
102
package.json
@@ -1,52 +1,62 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "4.9.0",
|
||||
"version": "2.1.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"homepage": "http://lodash.com/",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"main": "lodash.js",
|
||||
"devDependencies": {
|
||||
"async": "^1.5.2",
|
||||
"benchmark": "^2.1.0",
|
||||
"chalk": "^1.1.3",
|
||||
"codecov.io": "~0.1.6",
|
||||
"coveralls": "^2.11.9",
|
||||
"curl-amd": "~0.8.12",
|
||||
"docdown": "~0.5.1",
|
||||
"dojo": "^1.11.1",
|
||||
"ecstatic": "^1.4.0",
|
||||
"fs-extra": "~0.26.7",
|
||||
"glob": "^7.0.3",
|
||||
"istanbul": "0.4.3",
|
||||
"jquery": "^2.2.3",
|
||||
"jscs": "^2.11.0",
|
||||
"lodash": "4.8.2",
|
||||
"platform": "^1.3.1",
|
||||
"qunit-extras": "^1.5.0",
|
||||
"qunitjs": "~1.23.0",
|
||||
"request": "^2.69.0",
|
||||
"requirejs": "^2.2.0",
|
||||
"sauce-tunnel": "^2.4.0",
|
||||
"uglify-js": "2.6.2",
|
||||
"webpack": "^1.12.14"
|
||||
"main": "dist/lodash.js",
|
||||
"keywords": ["amd", "browser", "client", "customize", "functional", "performance", "server", "speed", "util"],
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"contributors": [
|
||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
|
||||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||
],
|
||||
"bugs": "https://github.com/lodash/lodash/issues",
|
||||
"repository": { "type": "git", "url": "https://github.com/lodash/lodash.git" },
|
||||
"engines": ["node", "rhino"],
|
||||
"files": [
|
||||
"LICENSE.txt",
|
||||
"lodash.js",
|
||||
"dist/lodash.js",
|
||||
"dist/lodash.min.js",
|
||||
"dist/lodash.compat.js",
|
||||
"dist/lodash.compat.min.js",
|
||||
"dist/lodash.underscore.js",
|
||||
"dist/lodash.underscore.min.js"
|
||||
],
|
||||
"jam": {
|
||||
"main": "dist/lodash.compat.js",
|
||||
"include": [
|
||||
"LICENSE.txt",
|
||||
"dist/lodash.js",
|
||||
"dist/lodash.min.js",
|
||||
"dist/lodash.compat.js",
|
||||
"dist/lodash.compat.min.js",
|
||||
"dist/lodash.underscore.js",
|
||||
"dist/lodash.underscore.min.js"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build:main && npm run build:fp",
|
||||
"build:fp": "node lib/fp/build-dist.js",
|
||||
"build:fp-modules": "node lib/fp/build-modules.js",
|
||||
"build:main": "node lib/main/build-dist.js",
|
||||
"build:main-modules": "node lib/main/build-modules.js",
|
||||
"doc": "node lib/main/build-doc github",
|
||||
"doc:fp": "node lib/fp/build-doc",
|
||||
"doc:site": "node lib/main/build-doc site",
|
||||
"pretest": "npm run build",
|
||||
"style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test",
|
||||
"style:fp": "jscs fp/*.js lib/**/*.js",
|
||||
"style:main": "jscs lodash.js",
|
||||
"style:perf": "jscs perf/*.js perf/**/*.js",
|
||||
"style:test": "jscs test/*.js test/**/*.js",
|
||||
"test": "npm run test:main && npm run test:fp",
|
||||
"test:fp": "node test/test-fp",
|
||||
"test:main": "node test/test",
|
||||
"validate": "npm run style && npm run test"
|
||||
"volo": {
|
||||
"type": "directory",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.min.*",
|
||||
"*.template.*",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"lodash.js",
|
||||
"index.js",
|
||||
"bower.json",
|
||||
"component.json",
|
||||
"doc",
|
||||
"modularize",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
137
perf/index.html
@@ -1,69 +1,82 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>lodash Performance Suite</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
#FirebugUI {
|
||||
top: 2em;
|
||||
}
|
||||
#perf-toolbar {
|
||||
background-color: #EEE;
|
||||
color: #5E740B;
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
font-size: small;
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="perf-toolbar"></div>
|
||||
<script src="../lodash.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="../node_modules/benchmark/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="./asset/perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var measured,
|
||||
perfNow,
|
||||
begin = new Date;
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Lo-Dash Performance Suite</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
applet {
|
||||
position: absolute;
|
||||
left: -9999em;
|
||||
}
|
||||
#FirebugUI {
|
||||
top: 2em;
|
||||
}
|
||||
#perf-toolbar {
|
||||
background-color: #EEE;
|
||||
color: #5E740B;
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
font-size: small;
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="perf-toolbar"></div>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script src="../vendor/benchmark.js/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var measured,
|
||||
perfNow,
|
||||
begin = new Date;
|
||||
|
||||
function init() {
|
||||
var fbUI = document.getElementById('FirebugUI'),
|
||||
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
|
||||
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
|
||||
function init() {
|
||||
var fbUI = document.getElementById('FirebugUI'),
|
||||
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
|
||||
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
|
||||
|
||||
if (!fbCommandLine) {
|
||||
return setTimeout(init, 15);
|
||||
}
|
||||
fbUI.style.height = (
|
||||
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
|
||||
document.getElementById('perf-toolbar').clientHeight
|
||||
) + 'px';
|
||||
if (!fbCommandLine) {
|
||||
return setTimeout(init, 15);
|
||||
}
|
||||
fbUI.style.height = (
|
||||
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
|
||||
document.getElementById('perf-toolbar').clientHeight
|
||||
) + 'px';
|
||||
|
||||
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
|
||||
setTimeout(run, 15);
|
||||
}
|
||||
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
|
||||
setTimeout(run, 15);
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
// is the applet permitted?
|
||||
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
||||
// is the applet really needed?
|
||||
while (!(measured = new Date - begin)) { }
|
||||
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
|
||||
// load applet
|
||||
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
|
||||
}
|
||||
}
|
||||
window.onload = init;
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the lodash builds. */
|
||||
/** The base path of the builds */
|
||||
var basePath = '../';
|
||||
|
||||
/** The lodash build to load. */
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The other library to load. */
|
||||
/** The other library to load */
|
||||
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
|
||||
|
||||
/** The `ui` object. */
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -34,7 +34,49 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// Initialize controls.
|
||||
// expose `ui.urlParams` properties
|
||||
ui.urlParams = {
|
||||
'build': build,
|
||||
'other': other
|
||||
};
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case 'lodash-modern':
|
||||
case null: result = 'dist/lodash.min.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose other library file path
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||
case 'underscore':
|
||||
case null: result = 'vendor/underscore/underscore-min.js'; break;
|
||||
default: return other;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
@@ -58,7 +100,13 @@
|
||||
span1.innerHTML =
|
||||
'<label for="perf-build">Build: </label>' +
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash">lodash</option>' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
@@ -68,7 +116,13 @@
|
||||
'<select id="perf-other">' +
|
||||
'<option value="underscore-dev">Underscore (development)</option>' +
|
||||
'<option value="underscore">Underscore (production)</option>' +
|
||||
'<option value="lodash">lodash</option>' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
@@ -80,8 +134,14 @@
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash':
|
||||
case null: return 0;
|
||||
case 'lodash-compat': return 0;
|
||||
case 'lodash-legacy': return 1;
|
||||
case 'lodash-mobile': return 2;
|
||||
case 'lodash-underscore': return 4;
|
||||
case 'lodash-custom-dev': return 5;
|
||||
case 'lodash-custom': return 6;
|
||||
case 'lodash-modern':
|
||||
case null: return 3;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
@@ -89,7 +149,13 @@
|
||||
otherList.selectedIndex = (function() {
|
||||
switch (other) {
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash': return 2;
|
||||
case 'lodash-compat': return 2;
|
||||
case 'lodash-legacy': return 3;
|
||||
case 'lodash-mobile': return 4;
|
||||
case 'lodash-modern': return 5;
|
||||
case 'lodash-underscore': return 6;
|
||||
case 'lodash-custom-dev': return 7;
|
||||
case 'lodash-custom': return 8;
|
||||
case 'underscore':
|
||||
case null: return 1;
|
||||
}
|
||||
@@ -100,32 +166,7 @@
|
||||
addListener(otherList, 'change', eventHandler);
|
||||
});
|
||||
|
||||
// The lodash build file path.
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case null: build = 'lodash';
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// The other library file path.
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||
case null: other = 'underscore';
|
||||
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
|
||||
default: return other;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
ui.urlParams = { 'build': build, 'other': other };
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
1189
perf/perf.js
14
perf/run-perf.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "Running performance suite in node..."
|
||||
node perf.js ../dist/lodash.js && node perf.js ../dist/lodash.min.js
|
||||
|
||||
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||
echo ""
|
||||
echo "Running performance suite in $cmd..."
|
||||
$cmd perf.js ../dist/lodash.compat.js && $cmd perf.js ../dist/lodash.compat.min.js
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Running performance suite in a browser..."
|
||||
open index.html
|
||||
@@ -1,170 +0,0 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the lodash builds. */
|
||||
var basePath = '../';
|
||||
|
||||
/** The lodash build to load. */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The module loader to use. */
|
||||
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
|
||||
|
||||
/** The `ui` object. */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {string} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// Initialize controls.
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
loaderIndex = loaderList.selectedIndex,
|
||||
search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
|
||||
'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
|
||||
}
|
||||
|
||||
function init() {
|
||||
var toolbar = document.getElementById('qunit-testrunner-toolbar');
|
||||
if (!toolbar) {
|
||||
setTimeout(init, 15);
|
||||
return;
|
||||
}
|
||||
toolbar.appendChild(span1);
|
||||
toolbar.appendChild(span2);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash': return 1;
|
||||
case 'lodash-core-dev': return 2;
|
||||
case 'lodash-core': return 3;
|
||||
case 'lodash-dev':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
loaderList.selectedIndex = (function() {
|
||||
switch (loader) {
|
||||
case 'curl': return 1;
|
||||
case 'dojo': return 2;
|
||||
case 'requirejs': return 3;
|
||||
case 'none':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(loaderList, 'change', eventHandler);
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="qunit-build">Build: </label>' +
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-dev">lodash (development)</option>' +
|
||||
'<option value="lodash">lodash (production)</option>' +
|
||||
'<option value="lodash-core-dev">lodash-core (development)</option>' +
|
||||
'<option value="lodash-core">lodash-core (production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="qunit-loader">Loader: </label>' +
|
||||
'<select id="qunit-loader">' +
|
||||
'<option value="none">None</option>' +
|
||||
'<option value="curl">Curl</option>' +
|
||||
'<option value="dojo">Dojo</option>' +
|
||||
'<option value="requirejs">RequireJS</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
loaderList = span2.lastChild;
|
||||
|
||||
setTimeout(function() {
|
||||
ui.timing.loadEventEnd = +new Date;
|
||||
}, 1);
|
||||
|
||||
init();
|
||||
});
|
||||
|
||||
// The lodash build file path.
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
case 'lodash-core-dev': result = 'dist/lodash.core.js'; break;
|
||||
case 'lodash-core': result = 'dist/lodash.core.min.js'; break;
|
||||
case null: build = 'lodash-dev';
|
||||
case 'lodash-dev': result = 'lodash.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// The module loader file path.
|
||||
ui.loaderPath = (function() {
|
||||
var result;
|
||||
switch (loader) {
|
||||
case 'curl': result = 'node_modules/curl-amd/dist/curl-kitchen-sink/curl.js'; break;
|
||||
case 'dojo': result = 'node_modules/dojo/dojo.js'; break;
|
||||
case 'requirejs': result = 'node_modules/requirejs/require.js'; break;
|
||||
case null: loader = 'none'; return '';
|
||||
default: return loader;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// Used to indicate testing a core build.
|
||||
ui.isCore = /\bcore(\.min)?\.js\b/.test(ui.buildPath);
|
||||
|
||||
// Used to indicate testing a foreign file.
|
||||
ui.isForeign = RegExp('^(\\w+:)?//').test(build);
|
||||
|
||||
// Used to indicate testing a modularized build.
|
||||
ui.isModularize = /\b(?:amd|commonjs|es|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
|
||||
|
||||
// Used to indicate testing in Sauce Labs' automated test cloud.
|
||||
ui.isSauceLabs = location.port == '9001';
|
||||
|
||||
// Used to indicate that lodash is in strict mode.
|
||||
ui.isStrict = /\bes\b/.test([location.pathname, location.search]);
|
||||
|
||||
ui.urlParams = { 'build': build, 'loader': loader };
|
||||
ui.timing = { 'loadEventEnd': 0 };
|
||||
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
@@ -1,15 +0,0 @@
|
||||
self.console || (self.console = { 'log': function() {} });
|
||||
|
||||
addEventListener('message', function(e) {
|
||||
if (e.data) {
|
||||
try {
|
||||
importScripts('../' + e.data);
|
||||
} catch (e) {
|
||||
var lineNumber = e.lineNumber,
|
||||
message = (lineNumber == null ? '' : (lineNumber + ': ')) + e.message;
|
||||
|
||||
self._ = { 'VERSION': message };
|
||||
}
|
||||
postMessage(_.VERSION);
|
||||
}
|
||||
}, false);
|
||||
@@ -1,170 +1,47 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Backbone Test Suite</title>
|
||||
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// Avoid reporting tests to Sauce Labs when script errors occur.
|
||||
if (location.port == '9001') {
|
||||
window.onerror = function(message) {
|
||||
if (window.QUnit) {
|
||||
QUnit.config.done.length = 0;
|
||||
}
|
||||
global_test_results = { 'message': message };
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
|
||||
<script src="../vendor/json-js/json2.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
QUnit.config.asyncRetries = 10;
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
var mixinPrereqs = (function() {
|
||||
var aliasToReal = {
|
||||
'indexBy': 'keyBy',
|
||||
'invoke': 'invokeMap'
|
||||
};
|
||||
|
||||
var keyMap = {
|
||||
'rest': 'tail'
|
||||
};
|
||||
|
||||
var lodash = _.noConflict();
|
||||
|
||||
return function(_) {
|
||||
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
|
||||
lodash.mixin(_, lodash.pick(lodash, lodash.difference([
|
||||
'countBy',
|
||||
'debounce',
|
||||
'difference',
|
||||
'find',
|
||||
'findIndex',
|
||||
'findLastIndex',
|
||||
'groupBy',
|
||||
'includes',
|
||||
'invert',
|
||||
'invokeMap',
|
||||
'keyBy',
|
||||
'omit',
|
||||
'partition',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
'sample',
|
||||
'without'
|
||||
], lodash.functions(_))));
|
||||
|
||||
lodash.forOwn(keyMap, function(realName, otherName) {
|
||||
_[otherName] = lodash[realName];
|
||||
_.prototype[otherName] = lodash.prototype[realName];
|
||||
});
|
||||
|
||||
lodash.forOwn(aliasToReal, function(realName, alias) {
|
||||
_[alias] = _[realName];
|
||||
_.prototype[alias] = _.prototype[realName];
|
||||
});
|
||||
};
|
||||
}());
|
||||
|
||||
// Load prerequisite scripts.
|
||||
document.write(ui.urlParams.loader == 'none'
|
||||
? '<script src="' + ui.buildPath + '"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
if (ui.urlParams.loader == 'none') {
|
||||
mixinPrereqs(_);
|
||||
document.write([
|
||||
'<script src="../node_modules/jquery/dist/jquery.js"><\/script>',
|
||||
'<script src="../vendor/backbone/backbone.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/setup/dom-setup.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/setup/environment.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/noconflict.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/events.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/model.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/collection.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/router.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/view.js"><\/script>',
|
||||
'<script src="../vendor/backbone/test/sync.js"><\/script>'
|
||||
].join('\n'));
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
return;
|
||||
}
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0],
|
||||
uid = +new Date;
|
||||
|
||||
function getConfig() {
|
||||
var result = {
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + uid++,
|
||||
'waitSeconds': 0,
|
||||
'paths': {
|
||||
'backbone': '../vendor/backbone/backbone',
|
||||
'jquery': '../node_modules/jquery/dist/jquery'
|
||||
},
|
||||
'packages': [{
|
||||
'name': 'test',
|
||||
'location': '../vendor/backbone/test',
|
||||
'config': {
|
||||
// Work around no global being exported.
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
if (ui.isModularize) {
|
||||
result.packages.push({
|
||||
'name': 'underscore',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
});
|
||||
} else {
|
||||
result.paths.underscore = modulePath;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
require(getConfig(), ['underscore'], function(lodash) {
|
||||
mixinPrereqs(lodash);
|
||||
require(getConfig(), ['backbone'], function() {
|
||||
require(getConfig(), [
|
||||
'test/setup/dom-setup',
|
||||
'test/setup/environment',
|
||||
'test/noconflict',
|
||||
'test/events',
|
||||
'test/model',
|
||||
'test/collection',
|
||||
'test/router',
|
||||
'test/view',
|
||||
'test/sync'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Backbone Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
body > #qunit-header {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<h1 id="qunit-header"></h1>
|
||||
<div id="qunit-fixture">
|
||||
<div id='testElement'>
|
||||
<h1>Test</h1>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../vendor/json-js/json2.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
_.mixin({
|
||||
'debounce': _.debounce || lodash.debounce,
|
||||
'defer': _.defer || lodash.defer
|
||||
});
|
||||
</script>
|
||||
<script src="../vendor/backbone/backbone.js"></script>
|
||||
<script src="../vendor/backbone/test/environment.js"></script>
|
||||
<script src="../vendor/backbone/test/noconflict.js"></script>
|
||||
<script src="../vendor/backbone/test/events.js"></script>
|
||||
<script src="../vendor/backbone/test/model.js"></script>
|
||||
<script src="../vendor/backbone/test/collection.js"></script>
|
||||
<script src="../vendor/backbone/test/router.js"></script>
|
||||
<script src="../vendor/backbone/test/view.js"></script>
|
||||
<script src="../vendor/backbone/test/sync.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
41
test/fp.html
@@ -1,41 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>lodash-fp Test Suite</title>
|
||||
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// Avoid reporting tests to Sauce Labs when script errors occur.
|
||||
if (location.port == '9001') {
|
||||
window.onerror = function(message) {
|
||||
if (window.QUnit) {
|
||||
QUnit.config.done.length = 0;
|
||||
}
|
||||
global_test_results = { 'message': message };
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script src="../dist/lodash.fp.js"></script>
|
||||
<script src="../dist/mapping.fp.js"></script>
|
||||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="./test-fp.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<script>
|
||||
// Set a more readable browser name.
|
||||
window.onload = function() {
|
||||
var timeoutId = setInterval(function() {
|
||||
var ua = document.getElementById('qunit-userAgent');
|
||||
if (ua) {
|
||||
ua.innerHTML = platform;
|
||||
clearInterval(timeoutId);
|
||||
}
|
||||
}, 16);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
489
test/index.html
@@ -1,351 +1,166 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>lodash Test Suite</title>
|
||||
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||
<style>
|
||||
#exports, #module {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// Avoid reporting tests to Sauce Labs when script errors occur.
|
||||
if (location.port == '9001') {
|
||||
window.onerror = function(message) {
|
||||
if (window.QUnit) {
|
||||
QUnit.config.done.length = 0;
|
||||
}
|
||||
global_test_results = { 'message': message };
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<script src="../node_modules/lodash/lodash.js"></script>
|
||||
<script>var lodashStable = _.noConflict();</script>
|
||||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<div id="exports"></div>
|
||||
<div id="module"></div>
|
||||
<script>
|
||||
function setProperty(object, key, value) {
|
||||
try {
|
||||
Object.defineProperty(object, key, {
|
||||
'configurable': true,
|
||||
'enumerable': false,
|
||||
'writable': true,
|
||||
'value': value
|
||||
});
|
||||
} catch (e) {
|
||||
object[key] = value;
|
||||
}
|
||||
return object;
|
||||
}
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Lo-Dash Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
#exports {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<div id="exports"></div>
|
||||
<script>
|
||||
// set bad shims
|
||||
Array._isArray = Array.isArray;
|
||||
Array.isArray = function() { return false; };
|
||||
|
||||
function addBizarroMethods() {
|
||||
var funcProto = Function.prototype,
|
||||
objectProto = Object.prototype;
|
||||
Function.prototype._bind = Function.prototype.bind;
|
||||
Function.prototype.bind = function() { return function() {}; };
|
||||
|
||||
var hasOwnProperty = objectProto.hasOwnProperty,
|
||||
fnToString = funcProto.toString,
|
||||
nativeString = fnToString.call(objectProto.toString),
|
||||
noop = function() {},
|
||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||
reToString = /toString/g;
|
||||
Object._defineProperty = Object.defineProperty;
|
||||
Object.defineProperty = function() {};
|
||||
|
||||
function constant(value) {
|
||||
return function() {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
Object._keys = Object.keys;
|
||||
Object.keys = function() { return []; };
|
||||
|
||||
function createToString(funcName) {
|
||||
return constant(nativeString.replace(reToString, funcName));
|
||||
}
|
||||
// load Lo-Dash and expose it to the bad `Object.keys` shim
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
// store Lo-Dash to test for bad shim detection
|
||||
var lodashBadShim = window._;
|
||||
|
||||
// Allow bypassing native checks.
|
||||
setProperty(funcProto, 'toString', (function() {
|
||||
function wrapper() {
|
||||
setProperty(funcProto, 'toString', fnToString);
|
||||
var result = hasOwnProperty.call(this, 'toString') ? this.toString() : fnToString.call(this);
|
||||
setProperty(funcProto, 'toString', wrapper);
|
||||
return result;
|
||||
}
|
||||
return wrapper;
|
||||
}()));
|
||||
// restore native methods
|
||||
if (Array._isArray) {
|
||||
Array.isArray = Array._isArray;
|
||||
} else {
|
||||
delete Array.isArray;
|
||||
}
|
||||
if (Function.prototype._bind) {
|
||||
Function.prototype.bind = Function.prototype._bind;
|
||||
} else {
|
||||
delete Function.prototype.bind;
|
||||
}
|
||||
if (Object._defineProperty) {
|
||||
Object.defineProperty = Object._defineProperty;
|
||||
} else {
|
||||
delete Object.defineProperty;
|
||||
}
|
||||
if (Object._keys) {
|
||||
Object.keys = Object._keys;
|
||||
} else {
|
||||
delete Object.keys;
|
||||
}
|
||||
delete Array._isArray;
|
||||
delete Function.prototype._bind;
|
||||
delete Object._defineProperty;
|
||||
delete Object._keys;
|
||||
|
||||
// Add prototype extensions.
|
||||
funcProto._method = noop;
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
|
||||
// Set bad shims.
|
||||
setProperty(Object, '_create', Object.create);
|
||||
setProperty(Object, 'create', (function() {
|
||||
function object() {}
|
||||
return function(prototype) {
|
||||
if (prototype === Object(prototype)) {
|
||||
object.prototype = prototype;
|
||||
var result = new object;
|
||||
object.prototype = undefined;
|
||||
}
|
||||
return result || {};
|
||||
};
|
||||
}()));
|
||||
// load test.js if not using require.js
|
||||
document.write(ui.urlParams.loader == 'none'
|
||||
? '<script src="test.js"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
var lodashModule,
|
||||
shimmedModule,
|
||||
underscoreModule;
|
||||
|
||||
setProperty(Object, '_getOwnPropertySymbols', Object.getOwnPropertySymbols);
|
||||
setProperty(Object, 'getOwnPropertySymbols', undefined);
|
||||
(function() {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
return;
|
||||
}
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0];
|
||||
|
||||
setProperty(objectProto, '_propertyIsEnumerable', propertyIsEnumerable);
|
||||
setProperty(objectProto, 'propertyIsEnumerable', function(key) {
|
||||
return !(key == 'valueOf' && this && this.valueOf === 1) && _propertyIsEnumerable.call(this, key);
|
||||
});
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
setProperty(window, '_Map', window.Map);
|
||||
if (_Map) {
|
||||
setProperty(window, 'Map', (function(Map) {
|
||||
var count = 0;
|
||||
return function() {
|
||||
if (count++) {
|
||||
return new Map;
|
||||
}
|
||||
var result = {};
|
||||
setProperty(window, 'Map', Map);
|
||||
return result;
|
||||
};
|
||||
}(_Map)));
|
||||
// load Lo-Dash as a module
|
||||
require({
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'packages': [
|
||||
{
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'shimmed',
|
||||
'location': './abc/../' + locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'underscore',
|
||||
'location': './xyz/../' + locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'test',
|
||||
'location': basePath + '/test',
|
||||
'main': 'test',
|
||||
'config': {
|
||||
// work around no global being exported
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}
|
||||
],
|
||||
'shim': {
|
||||
'shimmed': {
|
||||
'exports': '_'
|
||||
}
|
||||
}
|
||||
},
|
||||
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||
if (shimmed && shimmed.noConflict) {
|
||||
shimmedModule = shimmed.noConflict();
|
||||
shimmedModule.moduleName = 'shimmed';
|
||||
}
|
||||
if (underscore && underscore.noConflict) {
|
||||
underscoreModule = underscore.noConflict();
|
||||
underscoreModule.moduleName = 'underscore';
|
||||
}
|
||||
if (lodash && lodash.noConflict) {
|
||||
lodashModule = lodash.noConflict();
|
||||
lodashModule.moduleName = 'lodash';
|
||||
}
|
||||
if (ui.isModularize) {
|
||||
window._ = lodash;
|
||||
}
|
||||
require(['test'], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
setProperty(Map, 'toString', createToString('Map'));
|
||||
}
|
||||
setProperty(window, '_Promise', window.Promise);
|
||||
setProperty(window, 'Promise', noop);
|
||||
|
||||
setProperty(window, '_Set', window.Set);
|
||||
setProperty(window, 'Set', noop);
|
||||
|
||||
setProperty(window, '_Symbol', window.Symbol);
|
||||
setProperty(window, 'Symbol', undefined);
|
||||
|
||||
setProperty(window, '_WeakMap', window.WeakMap);
|
||||
setProperty(window, 'WeakMap', noop);
|
||||
|
||||
// Fake `WinRTError`.
|
||||
setProperty(window, 'WinRTError', Error);
|
||||
|
||||
// Fake free variable `global`.
|
||||
setProperty(window, 'exports', window);
|
||||
setProperty(window, 'global', window);
|
||||
setProperty(window, 'module', {});
|
||||
}
|
||||
|
||||
function removeBizarroMethods() {
|
||||
var funcProto = Function.prototype,
|
||||
objectProto = Object.prototype;
|
||||
|
||||
setProperty(objectProto, 'propertyIsEnumerable', objectProto._propertyIsEnumerable);
|
||||
|
||||
if (Object._create) {
|
||||
Object.create = Object._create;
|
||||
} else {
|
||||
delete Object.create;
|
||||
}
|
||||
if (Object._getOwnPropertySymbols) {
|
||||
Object.getOwnPropertySymbols = Object._getOwnPropertySymbols;
|
||||
} else {
|
||||
delete Object.getOwnPropertySymbols;
|
||||
}
|
||||
if (_Map) {
|
||||
Map = _Map;
|
||||
} else {
|
||||
setProperty(window, 'Map', undefined);
|
||||
}
|
||||
if (_Promise) {
|
||||
Promise = _Promise;
|
||||
} else {
|
||||
setProperty(window, 'Promise', undefined);
|
||||
}
|
||||
if (_Set) {
|
||||
Set = _Set;
|
||||
} else {
|
||||
setProperty(window, 'Set', undefined);
|
||||
}
|
||||
if (_Symbol) {
|
||||
Symbol = _Symbol;
|
||||
}
|
||||
if (_WeakMap) {
|
||||
WeakMap = _WeakMap;
|
||||
} else {
|
||||
setProperty(window, 'WeakMap', undefined);
|
||||
}
|
||||
setProperty(window, '_Map', undefined);
|
||||
setProperty(window, '_Promise', undefined);
|
||||
setProperty(window, '_Set', undefined);
|
||||
setProperty(window, '_Symbol', undefined);
|
||||
setProperty(window, '_WeakMap', undefined);
|
||||
|
||||
setProperty(window, 'WinRTError', undefined);
|
||||
|
||||
setProperty(window, 'exports', document.getElementById('exports'));
|
||||
setProperty(window, 'global', undefined);
|
||||
setProperty(window, 'module', document.getElementById('module'));
|
||||
|
||||
delete funcProto._method;
|
||||
delete Object._create;
|
||||
delete Object._getOwnPropertySymbols;
|
||||
delete objectProto._propertyIsEnumerable;
|
||||
}
|
||||
|
||||
// Load lodash to expose it to the bad extensions/shims.
|
||||
if (!ui.isModularize) {
|
||||
addBizarroMethods();
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
// Store lodash to test for bad extensions/shims.
|
||||
if (!ui.isModularize) {
|
||||
var lodashBizarro = window._;
|
||||
window._ = undefined;
|
||||
removeBizarroMethods();
|
||||
}
|
||||
// Load test scripts.
|
||||
document.write((ui.isForeign || ui.urlParams.loader == 'none')
|
||||
? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
var lodashModule,
|
||||
shimmedModule,
|
||||
underscoreModule;
|
||||
|
||||
(function() {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (ui.isForeign || !window.require) {
|
||||
return;
|
||||
}
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0],
|
||||
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
|
||||
shimmedLocationPath = './abc/../' + locationPath,
|
||||
underscoreLocationPath = './xyz/../' + locationPath,
|
||||
uid = +new Date;
|
||||
|
||||
function getConfig() {
|
||||
var result = {
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + uid++,
|
||||
'waitSeconds': 0,
|
||||
'paths': {},
|
||||
'packages': [{
|
||||
'name': 'test',
|
||||
'location': basePath + 'test',
|
||||
'main': 'test',
|
||||
'config': {
|
||||
// Work around no global being exported.
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}],
|
||||
'shim': {
|
||||
'shimmed': {
|
||||
'exports': '_'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (ui.isModularize) {
|
||||
result.packages.push({
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
}, {
|
||||
'name': 'shimmed',
|
||||
'location': shimmedLocationPath,
|
||||
'main': moduleMain
|
||||
}, {
|
||||
'name': 'underscore',
|
||||
'location': underscoreLocationPath,
|
||||
'main': moduleMain
|
||||
});
|
||||
} else {
|
||||
result.paths.lodash = modulePath;
|
||||
result.paths.shimmed = shimmedLocationPath + '/' + moduleMain;
|
||||
result.paths.underscore = underscoreLocationPath + '/' + moduleMain;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadTests() {
|
||||
require(getConfig(), ['test'], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
}
|
||||
|
||||
function loadModulesAndTests() {
|
||||
require(getConfig(), ['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||
lodashModule = lodash;
|
||||
lodashModule.moduleName = 'lodash';
|
||||
|
||||
if (shimmed) {
|
||||
shimmedModule = shimmed.result(shimmed, 'noConflict') || shimmed;
|
||||
shimmedModule.moduleName = 'shimmed';
|
||||
}
|
||||
if (underscore) {
|
||||
underscoreModule = underscore.result(underscore, 'noConflict') || underscore;
|
||||
underscoreModule.moduleName = 'underscore';
|
||||
}
|
||||
window._ = lodash;
|
||||
|
||||
if (ui.isModularize) {
|
||||
require(getConfig(), [
|
||||
'lodash/_baseEach',
|
||||
'lodash/_isIndex',
|
||||
'lodash/_isIterateeCall'
|
||||
], function(baseEach, isIndex, isIterateeCall) {
|
||||
lodash._baseEach = baseEach;
|
||||
lodash._isIndex = isIndex;
|
||||
lodash._isIterateeCall = isIterateeCall;
|
||||
loadTests();
|
||||
});
|
||||
} else {
|
||||
loadTests();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
if (window.requirejs) {
|
||||
addBizarroMethods();
|
||||
require(getConfig(), ['lodash'], function(lodash) {
|
||||
lodashBizarro = lodash.result(lodash, 'noConflict') || lodash;
|
||||
delete requirejs.s.contexts._;
|
||||
|
||||
removeBizarroMethods();
|
||||
loadModulesAndTests();
|
||||
});
|
||||
} else {
|
||||
loadModulesAndTests();
|
||||
}
|
||||
}());
|
||||
|
||||
// Set a more readable browser name.
|
||||
window.onload = function() {
|
||||
var timeoutId = setInterval(function() {
|
||||
var ua = document.getElementById('qunit-userAgent');
|
||||
if (ua) {
|
||||
ua.innerHTML = platform;
|
||||
clearInterval(timeoutId);
|
||||
}
|
||||
}, 16);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
// set a more readable browser name
|
||||
window.onload = function() {
|
||||
var timeoutId = setInterval(function() {
|
||||
var ua = document.getElementById('qunit-userAgent');
|
||||
if (ua) {
|
||||
ua.innerHTML = platform;
|
||||
clearInterval(timeoutId);
|
||||
}
|
||||
}, 16);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var _ = require('../lodash'),
|
||||
fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
var args = (args = process.argv)
|
||||
.slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0);
|
||||
|
||||
var filePath = path.resolve(args[1]),
|
||||
reLine = /.*/gm;
|
||||
|
||||
var pattern = (function() {
|
||||
var result = args[0],
|
||||
delimiter = result.charAt(0),
|
||||
lastIndex = result.lastIndexOf(delimiter);
|
||||
|
||||
return RegExp(result.slice(1, lastIndex), result.slice(lastIndex + 1));
|
||||
}());
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
fs.writeFileSync(filePath, fs.readFileSync(filePath, 'utf8').replace(pattern, function(match) {
|
||||
var snippet = _.slice(arguments, -3, -2)[0];
|
||||
return match.replace(snippet, snippet.replace(reLine, ''));
|
||||
}));
|
||||
14
test/run-test.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||
echo "Testing in $cmd..."
|
||||
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
|
||||
echo ""
|
||||
done
|
||||
|
||||
echo "Testing in node..."
|
||||
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
|
||||
|
||||
echo ""
|
||||
echo "Testing in a browser..."
|
||||
open index.html
|
||||
@@ -1,922 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
/** Environment shortcut. */
|
||||
var env = process.env;
|
||||
|
||||
if (env.TRAVIS_SECURE_ENV_VARS == 'false') {
|
||||
console.log('Skipping Sauce Labs jobs; secure environment variables are unavailable');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
/** Load Node.js modules. */
|
||||
var EventEmitter = require('events').EventEmitter,
|
||||
http = require('http'),
|
||||
path = require('path'),
|
||||
url = require('url'),
|
||||
util = require('util');
|
||||
|
||||
/** Load other modules. */
|
||||
var _ = require('../lodash.js'),
|
||||
chalk = require('chalk'),
|
||||
ecstatic = require('ecstatic'),
|
||||
request = require('request'),
|
||||
SauceTunnel = require('sauce-tunnel');
|
||||
|
||||
/** Used for Sauce Labs credentials. */
|
||||
var accessKey = env.SAUCE_ACCESS_KEY,
|
||||
username = env.SAUCE_USERNAME;
|
||||
|
||||
/** Used as the default maximum number of times to retry a job and tunnel. */
|
||||
var maxJobRetries = 3,
|
||||
maxTunnelRetries = 3;
|
||||
|
||||
/** Used as the static file server middleware. */
|
||||
var mount = ecstatic({
|
||||
'cache': 'no-cache',
|
||||
'root': process.cwd()
|
||||
});
|
||||
|
||||
/** Used as the list of ports supported by Sauce Connect. */
|
||||
var ports = [
|
||||
80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001, 3030, 3210,
|
||||
3333, 4000, 4001, 4040, 4321, 4502, 4503, 4567, 5000, 5001, 5050, 5555, 5432,
|
||||
6000, 6001, 6060, 6666, 6543, 7000, 7070, 7774, 7777, 8000, 8001, 8003, 8031,
|
||||
8080, 8081, 8765, 8777, 8888, 9000, 9001, 9080, 9090, 9876, 9877, 9999, 49221,
|
||||
55001
|
||||
];
|
||||
|
||||
/** Used by `logInline` to clear previously logged messages. */
|
||||
var prevLine = '';
|
||||
|
||||
/** Method shortcut. */
|
||||
var push = Array.prototype.push;
|
||||
|
||||
/** Used to detect error messages. */
|
||||
var reError = /(?:\be|E)rror\b/;
|
||||
|
||||
/** Used to detect valid job ids. */
|
||||
var reJobId = /^[a-z0-9]{32}$/;
|
||||
|
||||
/** Used to display the wait throbber. */
|
||||
var throbberDelay = 500,
|
||||
waitCount = -1;
|
||||
|
||||
/**
|
||||
* Used as Sauce Labs config values.
|
||||
* See the [Sauce Labs documentation](https://docs.saucelabs.com/reference/test-configuration/)
|
||||
* for more details.
|
||||
*/
|
||||
var advisor = getOption('advisor', false),
|
||||
build = getOption('build', (env.TRAVIS_COMMIT || '').slice(0, 10)),
|
||||
commandTimeout = getOption('commandTimeout', 90),
|
||||
compatMode = getOption('compatMode', null),
|
||||
customData = Function('return {' + getOption('customData', '').replace(/^\{|}$/g, '') + '}')(),
|
||||
deviceOrientation = getOption('deviceOrientation', 'portrait'),
|
||||
framework = getOption('framework', 'qunit'),
|
||||
idleTimeout = getOption('idleTimeout', 60),
|
||||
jobName = getOption('name', 'unit tests'),
|
||||
maxDuration = getOption('maxDuration', 180),
|
||||
port = ports[Math.min(_.sortedIndex(ports, getOption('port', 9001)), ports.length - 1)],
|
||||
publicAccess = getOption('public', true),
|
||||
queueTimeout = getOption('queueTimeout', 240),
|
||||
recordVideo = getOption('recordVideo', true),
|
||||
recordScreenshots = getOption('recordScreenshots', false),
|
||||
runner = getOption('runner', 'test/index.html').replace(/^\W+/, ''),
|
||||
runnerUrl = getOption('runnerUrl', 'http://localhost:' + port + '/' + runner),
|
||||
statusInterval = getOption('statusInterval', 5),
|
||||
tags = getOption('tags', []),
|
||||
throttled = getOption('throttled', 10),
|
||||
tunneled = getOption('tunneled', true),
|
||||
tunnelId = getOption('tunnelId', 'tunnel_' + (env.TRAVIS_JOB_ID || 0)),
|
||||
tunnelTimeout = getOption('tunnelTimeout', 120),
|
||||
videoUploadOnPass = getOption('videoUploadOnPass', false);
|
||||
|
||||
/** Used to convert Sauce Labs browser identifiers to their formal names. */
|
||||
var browserNameMap = {
|
||||
'googlechrome': 'Chrome',
|
||||
'iehta': 'Internet Explorer',
|
||||
'ipad': 'iPad',
|
||||
'iphone': 'iPhone',
|
||||
'microsoftedge': 'Edge'
|
||||
};
|
||||
|
||||
/** List of platforms to load the runner on. */
|
||||
var platforms = [
|
||||
['Linux', 'android', '5.1'],
|
||||
['Windows 10', 'chrome', '49'],
|
||||
['Windows 10', 'chrome', '48'],
|
||||
['Windows 10', 'firefox', '45'],
|
||||
['Windows 10', 'firefox', '44'],
|
||||
['Windows 10', 'microsoftedge', '13'],
|
||||
['Windows 10', 'internet explorer', '11'],
|
||||
['Windows 8', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
// ['OS X 10.10', 'ipad', '9.1'],
|
||||
['OS X 10.11', 'safari', '9'],
|
||||
['OS X 10.10', 'safari', '8']
|
||||
];
|
||||
|
||||
/** Used to tailor the `platforms` array. */
|
||||
var isAMD = _.includes(tags, 'amd'),
|
||||
isBackbone = _.includes(tags, 'backbone'),
|
||||
isModern = _.includes(tags, 'modern');
|
||||
|
||||
// The platforms to test IE compatibility modes.
|
||||
if (compatMode) {
|
||||
platforms = [
|
||||
['Windows 10', 'internet explorer', '11'],
|
||||
['Windows 8', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
['Windows 7', 'internet explorer', '8']
|
||||
];
|
||||
}
|
||||
// The platforms for AMD tests.
|
||||
if (isAMD) {
|
||||
platforms = _.filter(platforms, function(platform) {
|
||||
var browser = browserName(platform[1]),
|
||||
version = +platform[2];
|
||||
|
||||
switch (browser) {
|
||||
case 'Android': return version >= 4.4;
|
||||
case 'Opera': return version >= 10;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
// The platforms for Backbone tests.
|
||||
if (isBackbone) {
|
||||
platforms = _.filter(platforms, function(platform) {
|
||||
var browser = browserName(platform[1]),
|
||||
version = +platform[2];
|
||||
|
||||
switch (browser) {
|
||||
case 'Firefox': return version >= 4;
|
||||
case 'Internet Explorer': return version >= 7;
|
||||
case 'iPad': return version >= 5;
|
||||
case 'Opera': return version >= 12;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
// The platforms for modern builds.
|
||||
if (isModern) {
|
||||
platforms = _.filter(platforms, function(platform) {
|
||||
var browser = browserName(platform[1]),
|
||||
version = +platform[2];
|
||||
|
||||
switch (browser) {
|
||||
case 'Android': return version >= 4.1;
|
||||
case 'Firefox': return version >= 10;
|
||||
case 'Internet Explorer': return version >= 9;
|
||||
case 'iPad': return version >= 6;
|
||||
case 'Opera': return version >= 12;
|
||||
case 'Safari': return version >= 6;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/** Used as the default `Job` options object. */
|
||||
var jobOptions = {
|
||||
'build': build,
|
||||
'command-timeout': commandTimeout,
|
||||
'custom-data': customData,
|
||||
'device-orientation': deviceOrientation,
|
||||
'framework': framework,
|
||||
'idle-timeout': idleTimeout,
|
||||
'max-duration': maxDuration,
|
||||
'name': jobName,
|
||||
'public': publicAccess,
|
||||
'platforms': platforms,
|
||||
'record-screenshots': recordScreenshots,
|
||||
'record-video': recordVideo,
|
||||
'sauce-advisor': advisor,
|
||||
'tags': tags,
|
||||
'url': runnerUrl,
|
||||
'video-upload-on-pass': videoUploadOnPass
|
||||
};
|
||||
|
||||
if (publicAccess === true) {
|
||||
jobOptions['public'] = 'public';
|
||||
}
|
||||
if (tunneled) {
|
||||
jobOptions['tunnel-identifier'] = tunnelId;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Resolves the formal browser name for a given Sauce Labs browser identifier.
|
||||
*
|
||||
* @private
|
||||
* @param {string} identifier The browser identifier.
|
||||
* @returns {string} Returns the formal browser name.
|
||||
*/
|
||||
function browserName(identifier) {
|
||||
return browserNameMap[identifier] || capitalizeWords(identifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Capitalizes the first character of each word in `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to augment.
|
||||
* @returns {string} Returns the augmented string.
|
||||
*/
|
||||
function capitalizeWords(string) {
|
||||
return _.map(string.split(' '), _.capitalize).join(' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value for the given option name. If no value is available the
|
||||
* `defaultValue` is returned.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the option.
|
||||
* @param {*} defaultValue The default option value.
|
||||
* @returns {*} Returns the option value.
|
||||
*/
|
||||
function getOption(name, defaultValue) {
|
||||
var isArr = _.isArray(defaultValue);
|
||||
return _.reduce(process.argv, function(result, value) {
|
||||
if (isArr) {
|
||||
value = optionToArray(name, value);
|
||||
return _.isEmpty(value) ? result : value;
|
||||
}
|
||||
value = optionToValue(name, value);
|
||||
|
||||
return value == null ? result : value;
|
||||
}, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is a job ID.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a job ID, else `false`.
|
||||
*/
|
||||
function isJobId(value) {
|
||||
return reJobId.test(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes an inline message to standard output.
|
||||
*
|
||||
* @private
|
||||
* @param {string} [text=''] The text to log.
|
||||
*/
|
||||
function logInline(text) {
|
||||
var blankLine = _.repeat(' ', _.size(prevLine));
|
||||
prevLine = text = _.truncate(text, { 'length': 40 });
|
||||
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the wait throbber to standard output.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function logThrobber() {
|
||||
logInline('Please wait' + _.repeat('.', (++waitCount % 3) + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a comma separated option value into an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the option to inspect.
|
||||
* @param {string} string The options string.
|
||||
* @returns {Array} Returns the new converted array.
|
||||
*/
|
||||
function optionToArray(name, string) {
|
||||
return _.compact(_.invokeMap((optionToValue(name, string) || '').split(/, */), 'trim'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the option value from an option string.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the option to inspect.
|
||||
* @param {string} string The options string.
|
||||
* @returns {string|undefined} Returns the option value, else `undefined`.
|
||||
*/
|
||||
function optionToValue(name, string) {
|
||||
var result = string.match(RegExp('^' + name + '(?:=([\\s\\S]+))?$'));
|
||||
if (result) {
|
||||
result = _.result(result, 1);
|
||||
result = result ? _.trim(result) : true;
|
||||
}
|
||||
if (result === 'false') {
|
||||
return false;
|
||||
}
|
||||
return result || undefined;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `Job#remove` and `Tunnel#stop` callback used by `Jobs#restart`
|
||||
* and `Tunnel#restart` respectively.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function onGenericRestart() {
|
||||
this.restarting = false;
|
||||
this.emit('restart');
|
||||
this.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* The `request.put` and `SauceTunnel#stop` callback used by `Jobs#stop`
|
||||
* and `Tunnel#stop` respectively.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} [error] The error object.
|
||||
*/
|
||||
function onGenericStop(error) {
|
||||
this.running = this.stopping = false;
|
||||
this.emit('stop', error);
|
||||
}
|
||||
|
||||
/**
|
||||
* The `request.del` callback used by `Jobs#remove`.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function onJobRemove(error, res, body) {
|
||||
this.id = this.taskId = this.url = null;
|
||||
this.removing = false;
|
||||
this.emit('remove');
|
||||
}
|
||||
|
||||
/**
|
||||
* The `Job#remove` callback used by `Jobs#reset`.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function onJobReset() {
|
||||
this.attempts = 0;
|
||||
this.failed = this.resetting = false;
|
||||
this._pollerId = this.id = this.result = this.taskId = this.url = null;
|
||||
this.emit('reset');
|
||||
}
|
||||
|
||||
/**
|
||||
* The `request.post` callback used by `Jobs#start`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} [error] The error object.
|
||||
* @param {Object} res The response data object.
|
||||
* @param {Object} body The response body JSON object.
|
||||
*/
|
||||
function onJobStart(error, res, body) {
|
||||
this.starting = false;
|
||||
|
||||
if (this.stopping) {
|
||||
return;
|
||||
}
|
||||
var statusCode = _.result(res, 'statusCode'),
|
||||
taskId = _.first(_.result(body, 'js tests'));
|
||||
|
||||
if (error || !taskId || statusCode != 200) {
|
||||
if (this.attempts < this.retries) {
|
||||
this.restart();
|
||||
return;
|
||||
}
|
||||
var na = 'unavailable',
|
||||
bodyStr = _.isObject(body) ? '\n' + JSON.stringify(body) : na,
|
||||
statusStr = _.isFinite(statusCode) ? statusCode : na;
|
||||
|
||||
logInline();
|
||||
console.error('Failed to start job; status: %s, body: %s', statusStr, bodyStr);
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
this.failed = true;
|
||||
this.emit('complete');
|
||||
return;
|
||||
}
|
||||
this.running = true;
|
||||
this.taskId = taskId;
|
||||
this.timestamp = _.now();
|
||||
this.emit('start');
|
||||
this.status();
|
||||
}
|
||||
|
||||
/**
|
||||
* The `request.post` callback used by `Job#status`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} [error] The error object.
|
||||
* @param {Object} res The response data object.
|
||||
* @param {Object} body The response body JSON object.
|
||||
*/
|
||||
function onJobStatus(error, res, body) {
|
||||
this.checking = false;
|
||||
|
||||
if (!this.running || this.stopping) {
|
||||
return;
|
||||
}
|
||||
var completed = _.result(body, 'completed', false),
|
||||
data = _.first(_.result(body, 'js tests')),
|
||||
elapsed = (_.now() - this.timestamp) / 1000,
|
||||
jobId = _.result(data, 'job_id', null),
|
||||
jobResult = _.result(data, 'result', null),
|
||||
jobStatus = _.result(data, 'status', ''),
|
||||
jobUrl = _.result(data, 'url', null),
|
||||
expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')),
|
||||
options = this.options,
|
||||
platform = options.platforms[0];
|
||||
|
||||
if (_.isObject(jobResult)) {
|
||||
var message = _.result(jobResult, 'message');
|
||||
} else {
|
||||
if (typeof jobResult == 'string') {
|
||||
message = jobResult;
|
||||
}
|
||||
jobResult = null;
|
||||
}
|
||||
if (isJobId(jobId)) {
|
||||
this.id = jobId;
|
||||
this.result = jobResult;
|
||||
this.url = jobUrl;
|
||||
} else {
|
||||
completed = false;
|
||||
}
|
||||
this.emit('status', jobStatus);
|
||||
|
||||
if (!completed && !expired) {
|
||||
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
|
||||
return;
|
||||
}
|
||||
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
||||
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
|
||||
failures = _.result(jobResult, 'failed'),
|
||||
label = options.name + ':',
|
||||
tunnel = this.tunnel;
|
||||
|
||||
if (errored || failures) {
|
||||
if (errored && this.attempts < this.retries) {
|
||||
this.restart();
|
||||
return;
|
||||
}
|
||||
var details = 'See ' + jobUrl + ' for details.';
|
||||
this.failed = true;
|
||||
|
||||
logInline();
|
||||
if (failures) {
|
||||
console.error(label + ' %s ' + chalk.red('failed') + ' %d test' + (failures > 1 ? 's' : '') + '. %s', description, failures, details);
|
||||
}
|
||||
else if (tunnel.attempts < tunnel.retries) {
|
||||
tunnel.restart();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (typeof message == 'undefined') {
|
||||
message = 'Results are unavailable. ' + details;
|
||||
}
|
||||
console.error(label, description, chalk.red('failed') + ';', message);
|
||||
}
|
||||
}
|
||||
else {
|
||||
logInline();
|
||||
console.log(label, description, chalk.green('passed'));
|
||||
}
|
||||
this.running = false;
|
||||
this.emit('complete');
|
||||
}
|
||||
|
||||
/**
|
||||
* The `SauceTunnel#start` callback used by `Tunnel#start`.
|
||||
*
|
||||
* @private
|
||||
* @param {boolean} success The connection success indicator.
|
||||
*/
|
||||
function onTunnelStart(success) {
|
||||
this.starting = false;
|
||||
|
||||
if (this._timeoutId) {
|
||||
clearTimeout(this._timeoutId);
|
||||
this._timeoutId = null;
|
||||
}
|
||||
if (!success) {
|
||||
if (this.attempts < this.retries) {
|
||||
this.restart();
|
||||
return;
|
||||
}
|
||||
logInline();
|
||||
console.error('Failed to open Sauce Connect tunnel');
|
||||
process.exit(2);
|
||||
}
|
||||
logInline();
|
||||
console.log('Sauce Connect tunnel opened');
|
||||
|
||||
var jobs = this.jobs;
|
||||
push.apply(jobs.queue, jobs.all);
|
||||
|
||||
this.running = true;
|
||||
this.emit('start');
|
||||
|
||||
console.log('Starting jobs...');
|
||||
this.dequeue();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Job constructor.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} [properties] The properties to initialize a job with.
|
||||
*/
|
||||
function Job(properties) {
|
||||
EventEmitter.call(this);
|
||||
|
||||
this.options = {};
|
||||
_.merge(this, properties);
|
||||
_.defaults(this.options, _.cloneDeep(jobOptions));
|
||||
|
||||
this.attempts = 0;
|
||||
this.checking = this.failed = this.removing = this.resetting = this.restarting = this.running = this.starting = this.stopping = false;
|
||||
this._pollerId = this.id = this.result = this.taskId = this.url = null;
|
||||
}
|
||||
|
||||
util.inherits(Job, EventEmitter);
|
||||
|
||||
/**
|
||||
* Removes the job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the job is removed.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.remove = function(callback) {
|
||||
this.once('remove', _.iteratee(callback));
|
||||
if (this.removing) {
|
||||
return this;
|
||||
}
|
||||
this.removing = true;
|
||||
return this.stop(function() {
|
||||
var onRemove = _.bind(onJobRemove, this);
|
||||
if (!this.id) {
|
||||
_.defer(onRemove);
|
||||
return;
|
||||
}
|
||||
request.del(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}')(this), {
|
||||
'auth': { 'user': this.user, 'pass': this.pass }
|
||||
}, onRemove);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets the job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the job is reset.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.reset = function(callback) {
|
||||
this.once('reset', _.iteratee(callback));
|
||||
if (this.resetting) {
|
||||
return this;
|
||||
}
|
||||
this.resetting = true;
|
||||
return this.remove(onJobReset);
|
||||
};
|
||||
|
||||
/**
|
||||
* Restarts the job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the job is restarted.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.restart = function(callback) {
|
||||
this.once('restart', _.iteratee(callback));
|
||||
if (this.restarting) {
|
||||
return this;
|
||||
}
|
||||
this.restarting = true;
|
||||
|
||||
var options = this.options,
|
||||
platform = options.platforms[0],
|
||||
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
||||
label = options.name + ':';
|
||||
|
||||
logInline();
|
||||
console.log('%s %s restart %d of %d', label, description, ++this.attempts, this.retries);
|
||||
|
||||
return this.remove(onGenericRestart);
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts the job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the job is started.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.start = function(callback) {
|
||||
this.once('start', _.iteratee(callback));
|
||||
if (this.starting || this.running) {
|
||||
return this;
|
||||
}
|
||||
this.starting = true;
|
||||
request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests')(this), {
|
||||
'auth': { 'user': this.user, 'pass': this.pass },
|
||||
'json': this.options
|
||||
}, _.bind(onJobStart, this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks the status of a job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the status is resolved.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.status = function(callback) {
|
||||
this.once('status', _.iteratee(callback));
|
||||
if (this.checking || this.removing || this.resetting || this.restarting || this.starting || this.stopping) {
|
||||
return this;
|
||||
}
|
||||
this._pollerId = null;
|
||||
this.checking = true;
|
||||
request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests/status')(this), {
|
||||
'auth': { 'user': this.user, 'pass': this.pass },
|
||||
'json': { 'js tests': [this.taskId] }
|
||||
}, _.bind(onJobStatus, this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops the job.
|
||||
*
|
||||
* @memberOf Job
|
||||
* @param {Function} callback The function called once the job is stopped.
|
||||
* @param {Object} Returns the job instance.
|
||||
*/
|
||||
Job.prototype.stop = function(callback) {
|
||||
this.once('stop', _.iteratee(callback));
|
||||
if (this.stopping) {
|
||||
return this;
|
||||
}
|
||||
this.stopping = true;
|
||||
if (this._pollerId) {
|
||||
clearTimeout(this._pollerId);
|
||||
this._pollerId = null;
|
||||
this.checking = false;
|
||||
}
|
||||
var onStop = _.bind(onGenericStop, this);
|
||||
if (!this.running || !this.id) {
|
||||
_.defer(onStop);
|
||||
return this;
|
||||
}
|
||||
request.put(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}/stop')(this), {
|
||||
'auth': { 'user': this.user, 'pass': this.pass }
|
||||
}, onStop);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Tunnel constructor.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} [properties] The properties to initialize the tunnel with.
|
||||
*/
|
||||
function Tunnel(properties) {
|
||||
EventEmitter.call(this);
|
||||
|
||||
_.merge(this, properties);
|
||||
|
||||
var active = [],
|
||||
queue = [];
|
||||
|
||||
var all = _.map(this.platforms, _.bind(function(platform) {
|
||||
return new Job(_.merge({
|
||||
'user': this.user,
|
||||
'pass': this.pass,
|
||||
'tunnel': this,
|
||||
'options': { 'platforms': [platform] }
|
||||
}, this.job));
|
||||
}, this));
|
||||
|
||||
var completed = 0,
|
||||
restarted = [],
|
||||
success = true,
|
||||
total = all.length,
|
||||
tunnel = this;
|
||||
|
||||
_.invokeMap(all, 'on', 'complete', function() {
|
||||
_.pull(active, this);
|
||||
if (success) {
|
||||
success = !this.failed;
|
||||
}
|
||||
if (++completed == total) {
|
||||
tunnel.stop(_.partial(tunnel.emit, 'complete', success));
|
||||
return;
|
||||
}
|
||||
tunnel.dequeue();
|
||||
});
|
||||
|
||||
_.invokeMap(all, 'on', 'restart', function() {
|
||||
if (!_.includes(restarted, this)) {
|
||||
restarted.push(this);
|
||||
}
|
||||
// Restart tunnel if all active jobs have restarted.
|
||||
var threshold = Math.min(all.length, _.isFinite(throttled) ? throttled : 3);
|
||||
if (tunnel.attempts < tunnel.retries &&
|
||||
active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
|
||||
tunnel.restart();
|
||||
}
|
||||
});
|
||||
|
||||
this.on('restart', function() {
|
||||
completed = 0;
|
||||
success = true;
|
||||
restarted.length = 0;
|
||||
});
|
||||
|
||||
this._timeoutId = null;
|
||||
this.attempts = 0;
|
||||
this.restarting = this.running = this.starting = this.stopping = false;
|
||||
this.jobs = { 'active': active, 'all': all, 'queue': queue };
|
||||
this.connection = new SauceTunnel(this.user, this.pass, this.id, this.tunneled, ['-P', '0']);
|
||||
}
|
||||
|
||||
util.inherits(Tunnel, EventEmitter);
|
||||
|
||||
/**
|
||||
* Restarts the tunnel.
|
||||
*
|
||||
* @memberOf Tunnel
|
||||
* @param {Function} callback The function called once the tunnel is restarted.
|
||||
*/
|
||||
Tunnel.prototype.restart = function(callback) {
|
||||
this.once('restart', _.iteratee(callback));
|
||||
if (this.restarting) {
|
||||
return this;
|
||||
}
|
||||
this.restarting = true;
|
||||
|
||||
logInline();
|
||||
console.log('Tunnel %s: restart %d of %d', this.id, ++this.attempts, this.retries);
|
||||
|
||||
var jobs = this.jobs,
|
||||
active = jobs.active,
|
||||
all = jobs.all;
|
||||
|
||||
var reset = _.after(all.length, _.bind(this.stop, this, onGenericRestart)),
|
||||
stop = _.after(active.length, _.partial(_.invokeMap, all, 'reset', reset));
|
||||
|
||||
if (_.isEmpty(active)) {
|
||||
_.defer(stop);
|
||||
}
|
||||
if (_.isEmpty(all)) {
|
||||
_.defer(reset);
|
||||
}
|
||||
_.invokeMap(active, 'stop', function() {
|
||||
_.pull(active, this);
|
||||
stop();
|
||||
});
|
||||
|
||||
if (this._timeoutId) {
|
||||
clearTimeout(this._timeoutId);
|
||||
this._timeoutId = null;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts the tunnel.
|
||||
*
|
||||
* @memberOf Tunnel
|
||||
* @param {Function} callback The function called once the tunnel is started.
|
||||
* @param {Object} Returns the tunnel instance.
|
||||
*/
|
||||
Tunnel.prototype.start = function(callback) {
|
||||
this.once('start', _.iteratee(callback));
|
||||
if (this.starting || this.running) {
|
||||
return this;
|
||||
}
|
||||
this.starting = true;
|
||||
|
||||
logInline();
|
||||
console.log('Opening Sauce Connect tunnel...');
|
||||
|
||||
var onStart = _.bind(onTunnelStart, this);
|
||||
if (this.timeout) {
|
||||
this._timeoutId = _.delay(onStart, this.timeout * 1000, false);
|
||||
}
|
||||
this.connection.start(onStart);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes jobs from the queue and starts them.
|
||||
*
|
||||
* @memberOf Tunnel
|
||||
* @param {Object} Returns the tunnel instance.
|
||||
*/
|
||||
Tunnel.prototype.dequeue = function() {
|
||||
var jobs = this.jobs,
|
||||
active = jobs.active,
|
||||
queue = jobs.queue,
|
||||
throttled = this.throttled;
|
||||
|
||||
while (queue.length && (active.length < throttled)) {
|
||||
active.push(queue.shift().start());
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops the tunnel.
|
||||
*
|
||||
* @memberOf Tunnel
|
||||
* @param {Function} callback The function called once the tunnel is stopped.
|
||||
* @param {Object} Returns the tunnel instance.
|
||||
*/
|
||||
Tunnel.prototype.stop = function(callback) {
|
||||
this.once('stop', _.iteratee(callback));
|
||||
if (this.stopping) {
|
||||
return this;
|
||||
}
|
||||
this.stopping = true;
|
||||
|
||||
logInline();
|
||||
console.log('Shutting down Sauce Connect tunnel...');
|
||||
|
||||
var jobs = this.jobs,
|
||||
active = jobs.active;
|
||||
|
||||
var stop = _.after(active.length, _.bind(function() {
|
||||
var onStop = _.bind(onGenericStop, this);
|
||||
if (this.running) {
|
||||
this.connection.stop(onStop);
|
||||
} else {
|
||||
onStop();
|
||||
}
|
||||
}, this));
|
||||
|
||||
jobs.queue.length = 0;
|
||||
if (_.isEmpty(active)) {
|
||||
_.defer(stop);
|
||||
}
|
||||
_.invokeMap(active, 'stop', function() {
|
||||
_.pull(active, this);
|
||||
stop();
|
||||
});
|
||||
|
||||
if (this._timeoutId) {
|
||||
clearTimeout(this._timeoutId);
|
||||
this._timeoutId = null;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
// Cleanup any inline logs when exited via `ctrl+c`.
|
||||
process.on('SIGINT', function() {
|
||||
logInline();
|
||||
process.exit();
|
||||
});
|
||||
|
||||
// Create a web server for the current working directory.
|
||||
http.createServer(function(req, res) {
|
||||
// See http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx.
|
||||
if (compatMode && path.extname(url.parse(req.url).pathname) == '.html') {
|
||||
res.setHeader('X-UA-Compatible', 'IE=' + compatMode);
|
||||
}
|
||||
mount(req, res);
|
||||
}).listen(port);
|
||||
|
||||
// Setup Sauce Connect so we can use this server from Sauce Labs.
|
||||
var tunnel = new Tunnel({
|
||||
'user': username,
|
||||
'pass': accessKey,
|
||||
'id': tunnelId,
|
||||
'job': { 'retries': maxJobRetries, 'statusInterval': statusInterval },
|
||||
'platforms': platforms,
|
||||
'retries': maxTunnelRetries,
|
||||
'throttled': throttled,
|
||||
'tunneled': tunneled,
|
||||
'timeout': tunnelTimeout
|
||||
});
|
||||
|
||||
tunnel.on('complete', function(success) {
|
||||
process.exit(success ? 0 : 1);
|
||||
});
|
||||
|
||||
tunnel.start();
|
||||
|
||||
setInterval(logThrobber, throbberDelay);
|
||||
1759
test/test-fp.js
177
test/test-ui.js
Normal file
@@ -0,0 +1,177 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the builds */
|
||||
var basePath = '../';
|
||||
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The module loader to use */
|
||||
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
|
||||
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {string} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose `ui.urlParams` properties
|
||||
ui.urlParams = {
|
||||
'build': build,
|
||||
'loader': loader
|
||||
};
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-modern-dev': result = 'dist/lodash.js'; break;
|
||||
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-modularize': result = 'modularize/main.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case 'lodash-compat-dev':
|
||||
case null: result = 'lodash.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose module loader file path
|
||||
ui.loaderPath = (function() {
|
||||
var result;
|
||||
switch (loader) {
|
||||
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
|
||||
case 'dojo': result = 'vendor/dojo/dojo.js'; break;
|
||||
case 'requirejs':
|
||||
case null: result = 'vendor/requirejs/require.js'; break;
|
||||
default: return loader;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// used to indicate testing a modularized build
|
||||
ui.isModularize = /\b(?:lodash-(?:amd|node)|modularize)\b/.test([location.pathname, location.search, ui.buildPath]);
|
||||
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
loaderIndex = loaderList.selectedIndex,
|
||||
search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
|
||||
'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
|
||||
}
|
||||
|
||||
function init() {
|
||||
var toolbar = document.getElementById('qunit-testrunner-toolbar');
|
||||
if (toolbar) {
|
||||
toolbar.appendChild(span1);
|
||||
toolbar.appendChild(span2);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-compat': return 1;
|
||||
case 'lodash-modern-dev': return 2;
|
||||
case 'lodash-modern': return 3;
|
||||
case 'lodash-legacy': return 4;
|
||||
case 'lodash-mobile': return 5;
|
||||
case 'lodash-modularize': return 6;
|
||||
case 'lodash-underscore': return 7;
|
||||
case 'lodash-custom-dev': return 8;
|
||||
case 'lodash-custom': return 9;
|
||||
case 'lodash-compat-dev':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
loaderList.selectedIndex = (function() {
|
||||
switch (loader) {
|
||||
case 'none': return 0
|
||||
case 'curl': return 1;
|
||||
case 'dojo': return 2;
|
||||
case 'requirejs':
|
||||
case null: return 3;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(loaderList, 'change', eventHandler);
|
||||
}
|
||||
else {
|
||||
setTimeout(init, 15);
|
||||
}
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="qunit-build">Build: </label>' +
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
|
||||
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-modularize">Lo-Dash (modularize)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="qunit-loader">Loader: </label>' +
|
||||
'<select id="qunit-loader">' +
|
||||
'<option value="none">None</option>' +
|
||||
'<option value="curl">Curl</option>' +
|
||||
'<option value="dojo">Dojo</option>' +
|
||||
'<option value="requirejs">RequireJS</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
loaderList = span2.lastChild;
|
||||
|
||||
init();
|
||||
});
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
26233
test/test.js
@@ -1,484 +1,142 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Underscore Test Suite</title>
|
||||
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<script>
|
||||
// Avoid reporting tests to Sauce Labs when script errors occur.
|
||||
if (location.port == '9001') {
|
||||
window.onerror = function(message) {
|
||||
if (window.QUnit) {
|
||||
QUnit.config.done.length = 0;
|
||||
}
|
||||
global_test_results = { 'message': message };
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
|
||||
<script src="../node_modules/jquery/dist/jquery.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
QUnit.config.asyncRetries = 10;
|
||||
QUnit.config.hidepassed = true;
|
||||
QUnit.config.excused = {
|
||||
'Arrays': {
|
||||
'chunk': [
|
||||
'defaults to empty array (chunk size 0)'
|
||||
],
|
||||
'difference': [
|
||||
'can perform an OO-style difference'
|
||||
],
|
||||
'drop': [
|
||||
'is an alias for rest'
|
||||
],
|
||||
'first': [
|
||||
'returns an empty array when n <= 0 (0 case)',
|
||||
'returns an empty array when n <= 0 (negative case)',
|
||||
'can fetch the first n elements',
|
||||
'returns the whole array if n > length'
|
||||
],
|
||||
'findIndex': [
|
||||
'called with context'
|
||||
],
|
||||
'findLastIndex': [
|
||||
'called with context'
|
||||
],
|
||||
'flatten': [
|
||||
'supports empty arrays',
|
||||
'can flatten nested arrays',
|
||||
'works on an arguments object',
|
||||
'can handle very deep arrays'
|
||||
],
|
||||
'head': [
|
||||
'is an alias for first'
|
||||
],
|
||||
'indexOf': [
|
||||
"sorted indexOf doesn't uses binary search",
|
||||
'0'
|
||||
],
|
||||
'initial': [
|
||||
'returns all but the last n elements',
|
||||
'returns an empty array when n > length',
|
||||
'works on an arguments object'
|
||||
],
|
||||
'intersection': [
|
||||
'can perform an OO-style intersection'
|
||||
],
|
||||
'last': [
|
||||
'returns an empty array when n <= 0 (0 case)',
|
||||
'returns an empty array when n <= 0 (negative case)',
|
||||
'can fetch the last n elements',
|
||||
'returns the whole array if n > length'
|
||||
],
|
||||
'lastIndexOf': [
|
||||
'should treat falsey `fromIndex` values, except `0` and `NaN`, as `array.length`',
|
||||
'should treat non-number `fromIndex` values as `array.length`',
|
||||
'[0,-1,-1]'
|
||||
],
|
||||
'object': [
|
||||
'an array of pairs zipped together into an object',
|
||||
'an object converted to pairs and back to an object'
|
||||
],
|
||||
'range': [
|
||||
'range with two arguments a & b, b<a generates an empty array'
|
||||
],
|
||||
'rest': [
|
||||
'returns the whole array when index is 0',
|
||||
'returns elements starting at the given index',
|
||||
'works on an arguments object'
|
||||
],
|
||||
'sortedIndex': [
|
||||
'2',
|
||||
'3'
|
||||
],
|
||||
'tail': [
|
||||
'is an alias for rest'
|
||||
],
|
||||
'take': [
|
||||
'is an alias for first'
|
||||
],
|
||||
'uniq': [
|
||||
'uses the result of `iterator` for uniqueness comparisons (unsorted case)',
|
||||
'`sorted` argument defaults to false when omitted',
|
||||
'when `iterator` is a string, uses that key for comparisons (unsorted case)',
|
||||
'uses the result of `iterator` for uniqueness comparisons (sorted case)',
|
||||
'when `iterator` is a string, uses that key for comparisons (sorted case)',
|
||||
'can use falsey pluck like iterator'
|
||||
],
|
||||
'union': [
|
||||
'can perform an OO-style union'
|
||||
]
|
||||
},
|
||||
'Chaining': {
|
||||
'pop': true,
|
||||
'shift': true,
|
||||
'splice': true,
|
||||
'reverse/concat/unshift/pop/map': [
|
||||
'can chain together array functions.'
|
||||
]
|
||||
},
|
||||
'Collections': {
|
||||
'lookupIterator with contexts': true,
|
||||
'Iterating objects with sketchy length properties': true,
|
||||
'Resistant to collection length and properties changing while iterating': true,
|
||||
'countBy': [
|
||||
'true'
|
||||
],
|
||||
'each': [
|
||||
'context object property accessed'
|
||||
],
|
||||
'every': [
|
||||
'Can be called with object',
|
||||
'Died on test #15',
|
||||
'context works'
|
||||
],
|
||||
'filter': [
|
||||
'given context',
|
||||
'[{"a":1,"b":2},{"a":1,"b":3},{"a":1,"b":4}]',
|
||||
'[{"a":1,"b":2},{"a":2,"b":2}]',
|
||||
'Empty object accepts all items',
|
||||
'OO-filter'
|
||||
],
|
||||
'find': [
|
||||
'{"a":1,"b":4}',
|
||||
'undefined when not found',
|
||||
'undefined when searching empty list',
|
||||
'works on objects',
|
||||
'undefined',
|
||||
'called with context'
|
||||
],
|
||||
'findWhere': [
|
||||
'checks properties given function'
|
||||
],
|
||||
'groupBy': [
|
||||
'true'
|
||||
],
|
||||
'includes': [
|
||||
"doesn't delegate to binary search"
|
||||
],
|
||||
'invoke': [
|
||||
'handles null & undefined'
|
||||
],
|
||||
'map': [
|
||||
'tripled numbers with context',
|
||||
'OO-style doubled numbers'
|
||||
],
|
||||
'max': [
|
||||
'can handle null/undefined',
|
||||
'can perform a computation-based max',
|
||||
'Maximum value of an empty object',
|
||||
'Maximum value of an empty array',
|
||||
'Maximum value of a non-numeric collection',
|
||||
'Finds correct max in array starting with num and containing a NaN',
|
||||
'Finds correct max in array starting with NaN',
|
||||
'Respects iterator return value of -Infinity',
|
||||
'String keys use property iterator',
|
||||
'Iterator context',
|
||||
'Lookup falsy iterator'
|
||||
],
|
||||
'min': [
|
||||
'can handle null/undefined',
|
||||
'can perform a computation-based min',
|
||||
'Minimum value of an empty object',
|
||||
'Minimum value of an empty array',
|
||||
'Minimum value of a non-numeric collection',
|
||||
'Finds correct min in array starting with NaN',
|
||||
'Respects iterator return value of Infinity',
|
||||
'String keys use property iterator',
|
||||
'Iterator context',
|
||||
'Lookup falsy iterator'
|
||||
],
|
||||
'partition': [
|
||||
'can reference the array index',
|
||||
'Died on test #8',
|
||||
'partition takes a context argument',
|
||||
'function(a){[code]}'
|
||||
],
|
||||
'pluck': [
|
||||
'[1]'
|
||||
],
|
||||
'reduce': [
|
||||
'can reduce with a context object'
|
||||
],
|
||||
'reject': [
|
||||
'Returns empty list given empty array'
|
||||
],
|
||||
'sample': [
|
||||
'behaves correctly on negative n',
|
||||
'Died on test #3'
|
||||
],
|
||||
'some': [
|
||||
'Can be called with object',
|
||||
'Died on test #17',
|
||||
'context works'
|
||||
],
|
||||
'where': [
|
||||
'checks properties given function'
|
||||
],
|
||||
'Can use various collection methods on NodeLists': [
|
||||
'<span id="id2"></span>',
|
||||
'<span id="id1"></span>'
|
||||
]
|
||||
},
|
||||
'Functions': {
|
||||
'debounce asap': true,
|
||||
'debounce asap cancel': true,
|
||||
'debounce after system time is set backwards': true,
|
||||
'debounce asap recursively': true,
|
||||
'throttle repeatedly with results': true,
|
||||
'more throttle does not trigger leading call when leading is set to false': true,
|
||||
'throttle does not trigger trailing call when trailing is set to false': true,
|
||||
'before': [
|
||||
'stores a memo to the last value',
|
||||
'provides context'
|
||||
],
|
||||
'bind': [
|
||||
'Died on test #2'
|
||||
],
|
||||
'bindAll': [
|
||||
'throws an error for bindAll with no functions named'
|
||||
],
|
||||
'memoize': [
|
||||
'{"bar":"BAR","foo":"FOO"}',
|
||||
'Died on test #8'
|
||||
],
|
||||
'partial':[
|
||||
'can partially apply with placeholders',
|
||||
'accepts more arguments than the number of placeholders',
|
||||
'accepts fewer arguments than the number of placeholders',
|
||||
'unfilled placeholders are undefined',
|
||||
'keeps prototype',
|
||||
'allows the placeholder to be swapped out'
|
||||
]
|
||||
},
|
||||
'Objects': {
|
||||
'#1929 Typed Array constructors are functions': true,
|
||||
'allKeys': [
|
||||
'is not fooled by sparse arrays; see issue #95',
|
||||
'is not fooled by sparse arrays with additional properties',
|
||||
'[]'
|
||||
],
|
||||
'defaults': [
|
||||
'defaults skips nulls',
|
||||
'defaults skips undefined'
|
||||
],
|
||||
'extend': [
|
||||
'extending null results in null',
|
||||
'extending undefined results in undefined'
|
||||
],
|
||||
'extendOwn': [
|
||||
'extending non-objects results in returning the non-object value',
|
||||
'extending undefined results in undefined'
|
||||
],
|
||||
'functions': [
|
||||
'also looks up functions on the prototype'
|
||||
],
|
||||
'isEqual': [
|
||||
'`0` is not equal to `-0`',
|
||||
'Commutative equality is implemented for `0` and `-0`',
|
||||
'`new Number(0)` and `-0` are not equal',
|
||||
'Commutative equality is implemented for `new Number(0)` and `-0`',
|
||||
'false'
|
||||
],
|
||||
'isFinite': [
|
||||
'Numeric strings are numbers',
|
||||
'Number instances can be finite'
|
||||
],
|
||||
'isMatch': [
|
||||
'doesnt falsey match constructor on undefined/null'
|
||||
],
|
||||
'isSet': [
|
||||
'Died on test #9'
|
||||
],
|
||||
'findKey': [
|
||||
'called with context'
|
||||
],
|
||||
'keys': [
|
||||
'is not fooled by sparse arrays; see issue #95',
|
||||
'[]'
|
||||
],
|
||||
'mapObject': [
|
||||
'keep context',
|
||||
'called with context',
|
||||
'mapValue identity'
|
||||
],
|
||||
'matcher': [
|
||||
'null matches null',
|
||||
'treats primitives as empty'
|
||||
],
|
||||
'omit': [
|
||||
'can accept a predicate',
|
||||
'function is given context'
|
||||
],
|
||||
'pick': [
|
||||
'can accept a predicate and context',
|
||||
'function is given context'
|
||||
]
|
||||
},
|
||||
'Utility': {
|
||||
'noConflict (node vm)': true,
|
||||
'now': [
|
||||
'Produces the correct time in milliseconds'
|
||||
],
|
||||
'times': [
|
||||
'works as a wrapper'
|
||||
]
|
||||
}
|
||||
};
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Underscore Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
iframe {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
<div id="map-test">
|
||||
<div id="id1"></div>
|
||||
<div id="id2"></div>
|
||||
</div>
|
||||
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
|
||||
</div>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script>
|
||||
function init(lodash) {
|
||||
var arrayRef = [],
|
||||
push = arrayRef.push;
|
||||
|
||||
var mixinPrereqs = (function() {
|
||||
var aliasToReal = {
|
||||
'all': 'every',
|
||||
'allKeys': 'keysIn',
|
||||
'any': 'some',
|
||||
'collect': 'map',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'detect': 'find',
|
||||
'extendOwn': 'assign',
|
||||
'findWhere': 'find',
|
||||
'foldl': 'reduce',
|
||||
'foldr': 'reduceRight',
|
||||
'include': 'includes',
|
||||
'indexBy': 'keyBy',
|
||||
'inject': 'reduce',
|
||||
'invoke': 'invokeMap',
|
||||
'mapObject': 'mapValues',
|
||||
'matcher': 'matches',
|
||||
'methods': 'functions',
|
||||
'object': 'zipObject',
|
||||
'pairs': 'toPairs',
|
||||
'pluck': 'map',
|
||||
'restParam': 'restArgs',
|
||||
'select': 'filter',
|
||||
'unique': 'uniq',
|
||||
'where': 'filter'
|
||||
};
|
||||
if (!lodash().map()) {
|
||||
return;
|
||||
}
|
||||
lodash.mixin = function(object) {
|
||||
lodash.forEach(lodash.functions(object), function(methodName) {
|
||||
var func = lodash[methodName] = object[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__];
|
||||
push.apply(args, arguments);
|
||||
|
||||
var keyMap = {
|
||||
'rest': 'tail',
|
||||
'restArgs': 'rest'
|
||||
};
|
||||
var result = func.apply(lodash, args);
|
||||
if (this.__chain__) {
|
||||
result = new lodash(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
var lodash = _.noConflict();
|
||||
lodash.forEach(['pop', 'shift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
func.apply(this.__wrapped__, arguments);
|
||||
return this;
|
||||
};
|
||||
});
|
||||
|
||||
return function(_) {
|
||||
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
|
||||
lodash.mixin(_, lodash.pick(lodash, lodash.difference(lodash.functions(lodash), lodash.functions(_))));
|
||||
|
||||
lodash.forOwn(keyMap, function(realName, otherName) {
|
||||
_[otherName] = lodash[realName];
|
||||
_.prototype[otherName] = lodash.prototype[realName];
|
||||
});
|
||||
lodash.mixin(lodash);
|
||||
|
||||
lodash.forOwn(aliasToReal, function(realName, alias) {
|
||||
_[alias] = _[realName];
|
||||
_.prototype[alias] = _.prototype[realName];
|
||||
});
|
||||
};
|
||||
}());
|
||||
// expose lodash
|
||||
window._ = lodash;
|
||||
}
|
||||
|
||||
// Only excuse in Sauce Labs.
|
||||
if (!ui.isSauceLabs) {
|
||||
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
|
||||
delete QUnit.config.excused.Utility.now;
|
||||
}
|
||||
// Load prerequisite scripts.
|
||||
document.write(ui.urlParams.loader == 'none'
|
||||
? '<script src="' + ui.buildPath + '"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
if (ui.urlParams.loader == 'none') {
|
||||
mixinPrereqs(_);
|
||||
document.write([
|
||||
'<script src="../vendor/underscore/test/collections.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/functions.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/objects.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/cross-document.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/utility.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
|
||||
].join('\n'));
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
return;
|
||||
}
|
||||
// Wrap to work around tests assuming Node `require` use.
|
||||
require = (function(func) {
|
||||
return function() {
|
||||
return arguments[0] === '..' ? window._ : func.apply(null, arguments);
|
||||
};
|
||||
}(require));
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
|
||||
moduleId = /\bunderscore\b/i.test(ui.buildPath) ? 'underscore' : 'lodash',
|
||||
moduleMain = modulePath.match(reBasename)[0],
|
||||
uid = +new Date;
|
||||
// load test.js if not using require.js
|
||||
document.write(ui.urlParams.loader != 'none'
|
||||
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
: ([
|
||||
'<script src="../vendor/underscore/test/collections.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/functions.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/objects.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/utility.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
|
||||
].join('\n'))
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
init(_);
|
||||
return;
|
||||
}
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0];
|
||||
|
||||
function getConfig() {
|
||||
var result = {
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + uid++,
|
||||
'waitSeconds': 0,
|
||||
'paths': {},
|
||||
'packages': [{
|
||||
'name': 'test',
|
||||
'location': '../vendor/underscore/test',
|
||||
'config': {
|
||||
// Work around no global being exported.
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}]
|
||||
};
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
if (ui.isModularize) {
|
||||
result.packages.push({
|
||||
'name': moduleId,
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
});
|
||||
} else {
|
||||
result.paths[moduleId] = modulePath;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
require(getConfig(), [moduleId], function(lodash) {
|
||||
mixinPrereqs(lodash);
|
||||
require(getConfig(), [
|
||||
'test/collections',
|
||||
'test/arrays',
|
||||
'test/functions',
|
||||
'test/objects',
|
||||
'test/cross-document',
|
||||
'test/utility',
|
||||
'test/chaining'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
// load Lo-Dash as a module
|
||||
require({
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'packages': [
|
||||
{
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'test',
|
||||
'location': '../vendor/underscore/test',
|
||||
'config': {
|
||||
// work around no global being exported
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
['lodash'], function(lodash) {
|
||||
init(lodash);
|
||||
require([
|
||||
'test/collections',
|
||||
'test/arrays',
|
||||
'test/functions',
|
||||
'test/objects',
|
||||
'test/utility',
|
||||
'test/chaining'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
<script type="text/html" id="template">
|
||||
<%
|
||||
// a comment
|
||||
if (data) { data += 12345; }; %>
|
||||
<li><%= data %></li>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
6
test/worker.js
Normal file
@@ -0,0 +1,6 @@
|
||||
addEventListener('message', function(e) {
|
||||
if (e.data) {
|
||||
importScripts(e.data);
|
||||
postMessage(_.VERSION);
|
||||
}
|
||||
}, false);
|
||||
2
vendor/backbone/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2010-2016 Jeremy Ashkenas, DocumentCloud
|
||||
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
||||
1397
vendor/backbone/backbone.js
vendored
1992
vendor/backbone/test/collection.js
vendored
45
vendor/backbone/test/environment.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
(function() {
|
||||
|
||||
var Environment = this.Environment = function(){};
|
||||
|
||||
_.extend(Environment.prototype, {
|
||||
|
||||
ajax: Backbone.ajax,
|
||||
|
||||
sync: Backbone.sync,
|
||||
|
||||
emulateHTTP: Backbone.emulateHTTP,
|
||||
|
||||
emulateJSON: Backbone.emulateJSON,
|
||||
|
||||
setup: function() {
|
||||
var env = this;
|
||||
|
||||
// Capture ajax settings for comparison.
|
||||
Backbone.ajax = function(settings) {
|
||||
env.ajaxSettings = settings;
|
||||
};
|
||||
|
||||
// Capture the arguments to Backbone.sync for comparison.
|
||||
Backbone.sync = function(method, model, options) {
|
||||
env.syncArgs = {
|
||||
method: method,
|
||||
model: model,
|
||||
options: options
|
||||
};
|
||||
env.sync.apply(this, arguments);
|
||||
};
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
this.syncArgs = null;
|
||||
this.ajaxSettings = null;
|
||||
Backbone.sync = this.sync;
|
||||
Backbone.ajax = this.ajax;
|
||||
Backbone.emulateHTTP = this.emulateHTTP;
|
||||
Backbone.emulateJSON = this.emulateJSON;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
542
vendor/backbone/test/events.js
vendored
@@ -1,44 +1,42 @@
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
QUnit.module('Backbone.Events');
|
||||
module("Backbone.Events");
|
||||
|
||||
QUnit.test('on and trigger', function(assert) {
|
||||
assert.expect(2);
|
||||
var obj = {counter: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
test("on and trigger", 2, function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj,Backbone.Events);
|
||||
obj.on('event', function() { obj.counter += 1; });
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counter, 1, 'counter should be incremented.');
|
||||
equal(obj.counter,1,'counter should be incremented.');
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counter, 5, 'counter should be incremented five times.');
|
||||
equal(obj.counter, 5, 'counter should be incremented five times.');
|
||||
});
|
||||
|
||||
QUnit.test('binding and triggering multiple events', function(assert) {
|
||||
assert.expect(4);
|
||||
var obj = {counter: 0};
|
||||
test("binding and triggering multiple events", 4, function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
obj.on('a b c', function() { obj.counter += 1; });
|
||||
|
||||
obj.trigger('a');
|
||||
assert.equal(obj.counter, 1);
|
||||
equal(obj.counter, 1);
|
||||
|
||||
obj.trigger('a b');
|
||||
assert.equal(obj.counter, 3);
|
||||
equal(obj.counter, 3);
|
||||
|
||||
obj.trigger('c');
|
||||
assert.equal(obj.counter, 4);
|
||||
equal(obj.counter, 4);
|
||||
|
||||
obj.off('a c');
|
||||
obj.trigger('a b c');
|
||||
assert.equal(obj.counter, 5);
|
||||
equal(obj.counter, 5);
|
||||
});
|
||||
|
||||
QUnit.test('binding and triggering with event maps', function(assert) {
|
||||
var obj = {counter: 0};
|
||||
test("binding and triggering with event maps", function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
var increment = function() {
|
||||
@@ -52,85 +50,36 @@
|
||||
}, obj);
|
||||
|
||||
obj.trigger('a');
|
||||
assert.equal(obj.counter, 1);
|
||||
equal(obj.counter, 1);
|
||||
|
||||
obj.trigger('a b');
|
||||
assert.equal(obj.counter, 3);
|
||||
equal(obj.counter, 3);
|
||||
|
||||
obj.trigger('c');
|
||||
assert.equal(obj.counter, 4);
|
||||
equal(obj.counter, 4);
|
||||
|
||||
obj.off({
|
||||
a: increment,
|
||||
c: increment
|
||||
}, obj);
|
||||
obj.trigger('a b c');
|
||||
assert.equal(obj.counter, 5);
|
||||
equal(obj.counter, 5);
|
||||
});
|
||||
|
||||
QUnit.test('binding and triggering multiple event names with event maps', function(assert) {
|
||||
var obj = {counter: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
var increment = function() {
|
||||
this.counter += 1;
|
||||
};
|
||||
|
||||
obj.on({
|
||||
'a b c': increment
|
||||
});
|
||||
|
||||
obj.trigger('a');
|
||||
assert.equal(obj.counter, 1);
|
||||
|
||||
obj.trigger('a b');
|
||||
assert.equal(obj.counter, 3);
|
||||
|
||||
obj.trigger('c');
|
||||
assert.equal(obj.counter, 4);
|
||||
|
||||
obj.off({
|
||||
'a c': increment
|
||||
});
|
||||
obj.trigger('a b c');
|
||||
assert.equal(obj.counter, 5);
|
||||
});
|
||||
|
||||
QUnit.test('binding and trigger with event maps context', function(assert) {
|
||||
assert.expect(2);
|
||||
var obj = {counter: 0};
|
||||
var context = {};
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
obj.on({
|
||||
a: function() {
|
||||
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
|
||||
}
|
||||
}, context).trigger('a');
|
||||
|
||||
obj.off().on({
|
||||
a: function() {
|
||||
assert.strictEqual(this, context, 'will not override explicit `context` param');
|
||||
}
|
||||
}, this, context).trigger('a');
|
||||
});
|
||||
|
||||
QUnit.test('listenTo and stopListening', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo and stopListening", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenTo(b, 'all', function(){ assert.ok(true); });
|
||||
a.listenTo(b, 'all', function(){ ok(true); });
|
||||
b.trigger('anything');
|
||||
a.listenTo(b, 'all', function(){ assert.ok(false); });
|
||||
a.listenTo(b, 'all', function(){ ok(false); });
|
||||
a.stopListening();
|
||||
b.trigger('anything');
|
||||
});
|
||||
|
||||
QUnit.test('listenTo and stopListening with event maps', function(assert) {
|
||||
assert.expect(4);
|
||||
test("listenTo and stopListening with event maps", 4, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var cb = function(){ assert.ok(true); };
|
||||
var cb = function(){ ok(true); };
|
||||
a.listenTo(b, {event: cb});
|
||||
b.trigger('event');
|
||||
a.listenTo(b, {event2: cb});
|
||||
@@ -141,11 +90,10 @@
|
||||
b.trigger('event event2');
|
||||
});
|
||||
|
||||
QUnit.test('stopListening with omitted args', function(assert) {
|
||||
assert.expect(2);
|
||||
test("stopListening with omitted args", 2, function () {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var cb = function() { assert.ok(true); };
|
||||
var cb = function () { ok(true); };
|
||||
a.listenTo(b, 'event', cb);
|
||||
b.on('event', cb);
|
||||
a.listenTo(b, 'event2', cb);
|
||||
@@ -158,237 +106,98 @@
|
||||
b.trigger('event2');
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce', function(assert) {
|
||||
assert.expect(2);
|
||||
// Same as the previous test, but we use once rather than having to explicitly unbind
|
||||
var obj = {counterA: 0, counterB: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
|
||||
var incrB = function(){ obj.counterB += 1; };
|
||||
obj.listenToOnce(obj, 'event', incrA);
|
||||
obj.listenToOnce(obj, 'event', incrB);
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce and stopListening', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenToOnce and stopListening", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, 'all', function() { assert.ok(true); });
|
||||
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||
b.trigger('anything');
|
||||
b.trigger('anything');
|
||||
a.listenToOnce(b, 'all', function() { assert.ok(false); });
|
||||
a.listenToOnce(b, 'all', function() { ok(false); });
|
||||
a.stopListening();
|
||||
b.trigger('anything');
|
||||
});
|
||||
|
||||
QUnit.test('listenTo, listenToOnce and stopListening', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo, listenToOnce and stopListening", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, 'all', function() { assert.ok(true); });
|
||||
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||
b.trigger('anything');
|
||||
b.trigger('anything');
|
||||
a.listenTo(b, 'all', function() { assert.ok(false); });
|
||||
a.listenTo(b, 'all', function() { ok(false); });
|
||||
a.stopListening();
|
||||
b.trigger('anything');
|
||||
});
|
||||
|
||||
QUnit.test('listenTo and stopListening with event maps', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo and stopListening with event maps", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenTo(b, {change: function(){ assert.ok(true); }});
|
||||
a.listenTo(b, {change: function(){ ok(true); }});
|
||||
b.trigger('change');
|
||||
a.listenTo(b, {change: function(){ assert.ok(false); }});
|
||||
a.listenTo(b, {change: function(){ ok(false); }});
|
||||
a.stopListening();
|
||||
b.trigger('change');
|
||||
});
|
||||
|
||||
QUnit.test('listenTo yourself', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo yourself", 1, function(){
|
||||
var e = _.extend({}, Backbone.Events);
|
||||
e.listenTo(e, 'foo', function(){ assert.ok(true); });
|
||||
e.trigger('foo');
|
||||
e.listenTo(e, "foo", function(){ ok(true); });
|
||||
e.trigger("foo");
|
||||
});
|
||||
|
||||
QUnit.test('listenTo yourself cleans yourself up with stopListening', function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo yourself cleans yourself up with stopListening", 1, function(){
|
||||
var e = _.extend({}, Backbone.Events);
|
||||
e.listenTo(e, 'foo', function(){ assert.ok(true); });
|
||||
e.trigger('foo');
|
||||
e.listenTo(e, "foo", function(){ ok(true); });
|
||||
e.trigger("foo");
|
||||
e.stopListening();
|
||||
e.trigger('foo');
|
||||
e.trigger("foo");
|
||||
});
|
||||
|
||||
QUnit.test('stopListening cleans up references', function(assert) {
|
||||
assert.expect(12);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
b.on('event', fn);
|
||||
a.listenTo(b, 'event', fn).stopListening();
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn).stopListening(b);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn).stopListening(b, 'event');
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn).stopListening(b, 'event', fn);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
});
|
||||
|
||||
QUnit.test('stopListening cleans up references from listenToOnce', function(assert) {
|
||||
assert.expect(12);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
b.on('event', fn);
|
||||
a.listenToOnce(b, 'event', fn).stopListening();
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenToOnce(b, 'event', fn).stopListening(b);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenToOnce(b, 'event', fn).stopListening(b, 'event');
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenToOnce(b, 'event', fn).stopListening(b, 'event', fn);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._events.event), 1);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
});
|
||||
|
||||
QUnit.test('listenTo and off cleaning up references', function(assert) {
|
||||
assert.expect(8);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
a.listenTo(b, 'event', fn);
|
||||
b.off();
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn);
|
||||
b.off('event');
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn);
|
||||
b.off(null, fn);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
a.listenTo(b, 'event', fn);
|
||||
b.off(null, null, a);
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
assert.equal(_.size(b._listeners), 0);
|
||||
});
|
||||
|
||||
QUnit.test('listenTo and stopListening cleaning up references', function(assert) {
|
||||
assert.expect(2);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenTo(b, 'all', function(){ assert.ok(true); });
|
||||
b.trigger('anything');
|
||||
a.listenTo(b, 'other', function(){ assert.ok(false); });
|
||||
a.stopListening(b, 'other');
|
||||
a.stopListening(b, 'all');
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce without context cleans up references after the event has fired', function(assert) {
|
||||
assert.expect(2);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, 'all', function(){ assert.ok(true); });
|
||||
b.trigger('anything');
|
||||
assert.equal(_.size(a._listeningTo), 0);
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce with event maps cleans up references', function(assert) {
|
||||
assert.expect(2);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, {
|
||||
one: function() { assert.ok(true); },
|
||||
two: function() { assert.ok(false); }
|
||||
});
|
||||
b.trigger('one');
|
||||
assert.equal(_.size(a._listeningTo), 1);
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce with event maps binds the correct `this`', function(assert) {
|
||||
assert.expect(1);
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, {
|
||||
one: function() { assert.ok(this === a); },
|
||||
two: function() { assert.ok(false); }
|
||||
});
|
||||
b.trigger('one');
|
||||
});
|
||||
|
||||
QUnit.test("listenTo with empty callback doesn't throw an error", function(assert) {
|
||||
assert.expect(1);
|
||||
test("listenTo with empty callback doesn't throw an error", 1, function(){
|
||||
var e = _.extend({}, Backbone.Events);
|
||||
e.listenTo(e, 'foo', null);
|
||||
e.trigger('foo');
|
||||
assert.ok(true);
|
||||
e.listenTo(e, "foo", null);
|
||||
e.trigger("foo");
|
||||
ok(true);
|
||||
});
|
||||
|
||||
QUnit.test('trigger all for each event', function(assert) {
|
||||
assert.expect(3);
|
||||
var a, b, obj = {counter: 0};
|
||||
test("trigger all for each event", 3, function() {
|
||||
var a, b, obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
obj.on('all', function(event) {
|
||||
obj.counter++;
|
||||
if (event === 'a') a = true;
|
||||
if (event === 'b') b = true;
|
||||
if (event == 'a') a = true;
|
||||
if (event == 'b') b = true;
|
||||
})
|
||||
.trigger('a b');
|
||||
assert.ok(a);
|
||||
assert.ok(b);
|
||||
assert.equal(obj.counter, 2);
|
||||
ok(a);
|
||||
ok(b);
|
||||
equal(obj.counter, 2);
|
||||
});
|
||||
|
||||
QUnit.test('on, then unbind all functions', function(assert) {
|
||||
assert.expect(1);
|
||||
var obj = {counter: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
test("on, then unbind all functions", 1, function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj,Backbone.Events);
|
||||
var callback = function() { obj.counter += 1; };
|
||||
obj.on('event', callback);
|
||||
obj.trigger('event');
|
||||
obj.off('event');
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counter, 1, 'counter should have only been incremented once.');
|
||||
equal(obj.counter, 1, 'counter should have only been incremented once.');
|
||||
});
|
||||
|
||||
QUnit.test('bind two callbacks, unbind only one', function(assert) {
|
||||
assert.expect(2);
|
||||
var obj = {counterA: 0, counterB: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
test("bind two callbacks, unbind only one", 2, function() {
|
||||
var obj = { counterA: 0, counterB: 0 };
|
||||
_.extend(obj,Backbone.Events);
|
||||
var callback = function() { obj.counterA += 1; };
|
||||
obj.on('event', callback);
|
||||
obj.on('event', function() { obj.counterB += 1; });
|
||||
obj.trigger('event');
|
||||
obj.off('event', callback);
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
assert.equal(obj.counterB, 2, 'counterB should have been incremented twice.');
|
||||
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
equal(obj.counterB, 2, 'counterB should have been incremented twice.');
|
||||
});
|
||||
|
||||
QUnit.test('unbind a callback in the midst of it firing', function(assert) {
|
||||
assert.expect(1);
|
||||
test("unbind a callback in the midst of it firing", 1, function() {
|
||||
var obj = {counter: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
var callback = function() {
|
||||
@@ -399,13 +208,12 @@
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counter, 1, 'the callback should have been unbound.');
|
||||
equal(obj.counter, 1, 'the callback should have been unbound.');
|
||||
});
|
||||
|
||||
QUnit.test('two binds that unbind themeselves', function(assert) {
|
||||
assert.expect(2);
|
||||
var obj = {counterA: 0, counterB: 0};
|
||||
_.extend(obj, Backbone.Events);
|
||||
test("two binds that unbind themeselves", 2, function() {
|
||||
var obj = { counterA: 0, counterB: 0 };
|
||||
_.extend(obj,Backbone.Events);
|
||||
var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
|
||||
var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
|
||||
obj.on('event', incrA);
|
||||
@@ -413,64 +221,49 @@
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||
});
|
||||
|
||||
QUnit.test('bind a callback with a default context when none supplied', function(assert) {
|
||||
assert.expect(1);
|
||||
var obj = _.extend({
|
||||
assertTrue: function() {
|
||||
assert.equal(this, obj, '`this` was bound to the callback');
|
||||
}
|
||||
}, Backbone.Events);
|
||||
|
||||
obj.once('event', obj.assertTrue);
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('bind a callback with a supplied context', function(assert) {
|
||||
assert.expect(1);
|
||||
var TestClass = function() {
|
||||
test("bind a callback with a supplied context", 1, function () {
|
||||
var TestClass = function () {
|
||||
return this;
|
||||
};
|
||||
TestClass.prototype.assertTrue = function() {
|
||||
assert.ok(true, '`this` was bound to the callback');
|
||||
TestClass.prototype.assertTrue = function () {
|
||||
ok(true, '`this` was bound to the callback');
|
||||
};
|
||||
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('event', function() { this.assertTrue(); }, new TestClass);
|
||||
var obj = _.extend({},Backbone.Events);
|
||||
obj.on('event', function () { this.assertTrue(); }, (new TestClass));
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('nested trigger with unbind', function(assert) {
|
||||
assert.expect(1);
|
||||
var obj = {counter: 0};
|
||||
test("nested trigger with unbind", 1, function () {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
|
||||
var incr2 = function(){ obj.counter += 1; };
|
||||
obj.on('event', incr1);
|
||||
obj.on('event', incr2);
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counter, 3, 'counter should have been incremented three times');
|
||||
equal(obj.counter, 3, 'counter should have been incremented three times');
|
||||
});
|
||||
|
||||
QUnit.test('callback list is not altered during trigger', function(assert) {
|
||||
assert.expect(2);
|
||||
test("callback list is not altered during trigger", 2, function () {
|
||||
var counter = 0, obj = _.extend({}, Backbone.Events);
|
||||
var incr = function(){ counter++; };
|
||||
var incrOn = function(){ obj.on('event all', incr); };
|
||||
var incrOff = function(){ obj.off('event all', incr); };
|
||||
|
||||
obj.on('event all', incrOn).trigger('event');
|
||||
assert.equal(counter, 0, 'on does not alter callback list');
|
||||
|
||||
obj.off().on('event', incrOff).on('event all', incr).trigger('event');
|
||||
assert.equal(counter, 2, 'off does not alter callback list');
|
||||
obj.on('event', function(){ obj.on('event', incr).on('all', incr); })
|
||||
.trigger('event');
|
||||
equal(counter, 0, 'bind does not alter callback list');
|
||||
obj.off()
|
||||
.on('event', function(){ obj.off('event', incr).off('all', incr); })
|
||||
.on('event', incr)
|
||||
.on('all', incr)
|
||||
.trigger('event');
|
||||
equal(counter, 2, 'unbind does not alter callback list');
|
||||
});
|
||||
|
||||
QUnit.test("#1282 - 'all' callback list is retrieved after each event.", function(assert) {
|
||||
assert.expect(1);
|
||||
test("#1282 - 'all' callback list is retrieved after each event.", 1, function() {
|
||||
var counter = 0;
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
var incr = function(){ counter++; };
|
||||
@@ -478,68 +271,61 @@
|
||||
obj.on('y', incr).on('all', incr);
|
||||
})
|
||||
.trigger('x y');
|
||||
assert.strictEqual(counter, 2);
|
||||
strictEqual(counter, 2);
|
||||
});
|
||||
|
||||
QUnit.test('if no callback is provided, `on` is a noop', function(assert) {
|
||||
assert.expect(0);
|
||||
test("if no callback is provided, `on` is a noop", 0, function() {
|
||||
_.extend({}, Backbone.Events).on('test').trigger('test');
|
||||
});
|
||||
|
||||
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
|
||||
assert.expect(1);
|
||||
test("if callback is truthy but not a function, `on` should throw an error just like jQuery", 1, function() {
|
||||
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
||||
assert.raises(function() {
|
||||
throws(function() {
|
||||
view.trigger('test');
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test('remove all events for a specific context', function(assert) {
|
||||
assert.expect(4);
|
||||
test("remove all events for a specific context", 4, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('x y all', function() { assert.ok(true); });
|
||||
obj.on('x y all', function() { assert.ok(false); }, obj);
|
||||
obj.on('x y all', function() { ok(true); });
|
||||
obj.on('x y all', function() { ok(false); }, obj);
|
||||
obj.off(null, null, obj);
|
||||
obj.trigger('x y');
|
||||
});
|
||||
|
||||
QUnit.test('remove all events for a specific callback', function(assert) {
|
||||
assert.expect(4);
|
||||
test("remove all events for a specific callback", 4, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
var success = function() { assert.ok(true); };
|
||||
var fail = function() { assert.ok(false); };
|
||||
var success = function() { ok(true); };
|
||||
var fail = function() { ok(false); };
|
||||
obj.on('x y all', success);
|
||||
obj.on('x y all', fail);
|
||||
obj.off(null, fail);
|
||||
obj.trigger('x y');
|
||||
});
|
||||
|
||||
QUnit.test('#1310 - off does not skip consecutive events', function(assert) {
|
||||
assert.expect(0);
|
||||
test("#1310 - off does not skip consecutive events", 0, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('event', function() { assert.ok(false); }, obj);
|
||||
obj.on('event', function() { assert.ok(false); }, obj);
|
||||
obj.on('event', function() { ok(false); }, obj);
|
||||
obj.on('event', function() { ok(false); }, obj);
|
||||
obj.off(null, null, obj);
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('once', function(assert) {
|
||||
assert.expect(2);
|
||||
test("once", 2, function() {
|
||||
// Same as the previous test, but we use once rather than having to explicitly unbind
|
||||
var obj = {counterA: 0, counterB: 0};
|
||||
var obj = { counterA: 0, counterB: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
|
||||
var incrB = function(){ obj.counterB += 1; };
|
||||
obj.once('event', incrA);
|
||||
obj.once('event', incrB);
|
||||
obj.trigger('event');
|
||||
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||
});
|
||||
|
||||
QUnit.test('once variant one', function(assert) {
|
||||
assert.expect(3);
|
||||
var f = function(){ assert.ok(true); };
|
||||
test("once variant one", 3, function() {
|
||||
var f = function(){ ok(true); };
|
||||
|
||||
var a = _.extend({}, Backbone.Events).once('event', f);
|
||||
var b = _.extend({}, Backbone.Events).on('event', f);
|
||||
@@ -550,9 +336,8 @@
|
||||
b.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('once variant two', function(assert) {
|
||||
assert.expect(3);
|
||||
var f = function(){ assert.ok(true); };
|
||||
test("once variant two", 3, function() {
|
||||
var f = function(){ ok(true); };
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
|
||||
obj
|
||||
@@ -562,9 +347,8 @@
|
||||
.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('once with off', function(assert) {
|
||||
assert.expect(0);
|
||||
var f = function(){ assert.ok(true); };
|
||||
test("once with off", 0, function() {
|
||||
var f = function(){ ok(true); };
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
|
||||
obj.once('event', f);
|
||||
@@ -572,8 +356,8 @@
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('once with event maps', function(assert) {
|
||||
var obj = {counter: 0};
|
||||
test("once with event maps", function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
var increment = function() {
|
||||
@@ -587,120 +371,82 @@
|
||||
}, obj);
|
||||
|
||||
obj.trigger('a');
|
||||
assert.equal(obj.counter, 1);
|
||||
equal(obj.counter, 1);
|
||||
|
||||
obj.trigger('a b');
|
||||
assert.equal(obj.counter, 2);
|
||||
equal(obj.counter, 2);
|
||||
|
||||
obj.trigger('c');
|
||||
assert.equal(obj.counter, 3);
|
||||
equal(obj.counter, 3);
|
||||
|
||||
obj.trigger('a b c');
|
||||
assert.equal(obj.counter, 3);
|
||||
equal(obj.counter, 3);
|
||||
});
|
||||
|
||||
QUnit.test('bind a callback with a supplied context using once with object notation', function(assert) {
|
||||
assert.expect(1);
|
||||
var obj = {counter: 0};
|
||||
var context = {};
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
obj.once({
|
||||
a: function() {
|
||||
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
|
||||
}
|
||||
}, context).trigger('a');
|
||||
});
|
||||
|
||||
QUnit.test('once with off only by context', function(assert) {
|
||||
assert.expect(0);
|
||||
test("once with off only by context", 0, function() {
|
||||
var context = {};
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.once('event', function(){ assert.ok(false); }, context);
|
||||
obj.once('event', function(){ ok(false); }, context);
|
||||
obj.off(null, null, context);
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('Backbone object inherits Events', function(assert) {
|
||||
assert.ok(Backbone.on === Backbone.Events.on);
|
||||
test("Backbone object inherits Events", function() {
|
||||
ok(Backbone.on === Backbone.Events.on);
|
||||
});
|
||||
|
||||
QUnit.test('once with asynchronous events', function(assert) {
|
||||
var done = assert.async();
|
||||
assert.expect(1);
|
||||
var func = _.debounce(function() { assert.ok(true); done(); }, 50);
|
||||
asyncTest("once with asynchronous events", 1, function() {
|
||||
var func = _.debounce(function() { ok(true); start(); }, 50);
|
||||
var obj = _.extend({}, Backbone.Events).once('async', func);
|
||||
|
||||
obj.trigger('async');
|
||||
obj.trigger('async');
|
||||
});
|
||||
|
||||
QUnit.test('once with multiple events.', function(assert) {
|
||||
assert.expect(2);
|
||||
test("once with multiple events.", 2, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.once('x y', function() { assert.ok(true); });
|
||||
obj.once('x y', function() { ok(true); });
|
||||
obj.trigger('x y');
|
||||
});
|
||||
|
||||
QUnit.test('Off during iteration with once.', function(assert) {
|
||||
assert.expect(2);
|
||||
test("Off during iteration with once.", 2, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
var f = function(){ this.off('event', f); };
|
||||
obj.on('event', f);
|
||||
obj.once('event', function(){});
|
||||
obj.on('event', function(){ assert.ok(true); });
|
||||
obj.on('event', function(){ ok(true); });
|
||||
|
||||
obj.trigger('event');
|
||||
obj.trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('`once` on `all` should work as expected', function(assert) {
|
||||
assert.expect(1);
|
||||
test("`once` on `all` should work as expected", 1, function() {
|
||||
Backbone.once('all', function() {
|
||||
assert.ok(true);
|
||||
ok(true);
|
||||
Backbone.trigger('all');
|
||||
});
|
||||
Backbone.trigger('all');
|
||||
});
|
||||
|
||||
QUnit.test('once without a callback is a noop', function(assert) {
|
||||
assert.expect(0);
|
||||
test("once without a callback is a noop", 0, function() {
|
||||
_.extend({}, Backbone.Events).once('event').trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('listenToOnce without a callback is a noop', function(assert) {
|
||||
assert.expect(0);
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.listenToOnce(obj, 'event').trigger('event');
|
||||
});
|
||||
|
||||
QUnit.test('event functions are chainable', function(assert) {
|
||||
test("event functions are chainable", function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
var obj2 = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
assert.equal(obj, obj.trigger('noeventssetyet'));
|
||||
assert.equal(obj, obj.off('noeventssetyet'));
|
||||
assert.equal(obj, obj.stopListening('noeventssetyet'));
|
||||
assert.equal(obj, obj.on('a', fn));
|
||||
assert.equal(obj, obj.once('c', fn));
|
||||
assert.equal(obj, obj.trigger('a'));
|
||||
assert.equal(obj, obj.listenTo(obj2, 'a', fn));
|
||||
assert.equal(obj, obj.listenToOnce(obj2, 'b', fn));
|
||||
assert.equal(obj, obj.off('a c'));
|
||||
assert.equal(obj, obj.stopListening(obj2, 'a'));
|
||||
assert.equal(obj, obj.stopListening());
|
||||
equal(obj, obj.trigger('noeventssetyet'));
|
||||
equal(obj, obj.off('noeventssetyet'));
|
||||
equal(obj, obj.stopListening('noeventssetyet'));
|
||||
equal(obj, obj.on('a', fn));
|
||||
equal(obj, obj.once('c', fn));
|
||||
equal(obj, obj.trigger('a'));
|
||||
equal(obj, obj.listenTo(obj2, 'a', fn));
|
||||
equal(obj, obj.listenToOnce(obj2, 'b', fn));
|
||||
equal(obj, obj.off('a c'));
|
||||
equal(obj, obj.stopListening(obj2, 'a'));
|
||||
equal(obj, obj.stopListening());
|
||||
});
|
||||
|
||||
QUnit.test('#3448 - listenToOnce with space-separated events', function(assert) {
|
||||
assert.expect(2);
|
||||
var one = _.extend({}, Backbone.Events);
|
||||
var two = _.extend({}, Backbone.Events);
|
||||
var count = 1;
|
||||
one.listenToOnce(two, 'x y', function(n) { assert.ok(n === count++); });
|
||||
two.trigger('x', 1);
|
||||
two.trigger('x', 1);
|
||||
two.trigger('y', 2);
|
||||
two.trigger('y', 2);
|
||||
});
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
1220
vendor/backbone/test/model.js
vendored
13
vendor/backbone/test/noconflict.js
vendored
@@ -1,13 +1,12 @@
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
QUnit.module('Backbone.noConflict');
|
||||
module("Backbone.noConflict");
|
||||
|
||||
QUnit.test('noConflict', function(assert) {
|
||||
assert.expect(2);
|
||||
test('noConflict', 2, function() {
|
||||
var noconflictBackbone = Backbone.noConflict();
|
||||
assert.equal(window.Backbone, undefined, 'Returned window.Backbone');
|
||||
equal(window.Backbone, undefined, 'Returned window.Backbone');
|
||||
window.Backbone = noconflictBackbone;
|
||||
assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
|
||||
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
|
||||
});
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
768
vendor/backbone/test/router.js
vendored
4
vendor/backbone/test/setup/dom-setup.js
vendored
@@ -1,4 +0,0 @@
|
||||
$('body').append(
|
||||
'<div id="qunit"></div>' +
|
||||
'<div id="qunit-fixture"></div>'
|
||||
);
|
||||
45
vendor/backbone/test/setup/environment.js
vendored
@@ -1,45 +0,0 @@
|
||||
(function() {
|
||||
|
||||
var sync = Backbone.sync;
|
||||
var ajax = Backbone.ajax;
|
||||
var emulateHTTP = Backbone.emulateHTTP;
|
||||
var emulateJSON = Backbone.emulateJSON;
|
||||
var history = window.history;
|
||||
var pushState = history.pushState;
|
||||
var replaceState = history.replaceState;
|
||||
|
||||
QUnit.config.noglobals = true;
|
||||
|
||||
QUnit.testStart(function() {
|
||||
var env = QUnit.config.current.testEnvironment;
|
||||
|
||||
// We never want to actually call these during tests.
|
||||
history.pushState = history.replaceState = function(){};
|
||||
|
||||
// Capture ajax settings for comparison.
|
||||
Backbone.ajax = function(settings) {
|
||||
env.ajaxSettings = settings;
|
||||
};
|
||||
|
||||
// Capture the arguments to Backbone.sync for comparison.
|
||||
Backbone.sync = function(method, model, options) {
|
||||
env.syncArgs = {
|
||||
method: method,
|
||||
model: model,
|
||||
options: options
|
||||
};
|
||||
sync.apply(this, arguments);
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
QUnit.testDone(function() {
|
||||
Backbone.sync = sync;
|
||||
Backbone.ajax = ajax;
|
||||
Backbone.emulateHTTP = emulateHTTP;
|
||||
Backbone.emulateJSON = emulateJSON;
|
||||
history.pushState = pushState;
|
||||
history.replaceState = replaceState;
|
||||
});
|
||||
|
||||
})();
|
||||
205
vendor/backbone/test/sync.js
vendored
@@ -1,239 +1,212 @@
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
var Library = Backbone.Collection.extend({
|
||||
url: function() { return '/library'; }
|
||||
url : function() { return '/library'; }
|
||||
});
|
||||
var library;
|
||||
|
||||
var attrs = {
|
||||
title: 'The Tempest',
|
||||
author: 'Bill Shakespeare',
|
||||
length: 123
|
||||
title : "The Tempest",
|
||||
author : "Bill Shakespeare",
|
||||
length : 123
|
||||
};
|
||||
|
||||
QUnit.module('Backbone.sync', {
|
||||
module("Backbone.sync", _.extend(new Environment, {
|
||||
|
||||
beforeEach: function(assert) {
|
||||
setup : function() {
|
||||
Environment.prototype.setup.apply(this, arguments);
|
||||
library = new Library;
|
||||
library.create(attrs, {wait: false});
|
||||
},
|
||||
|
||||
afterEach: function(assert) {
|
||||
teardown: function() {
|
||||
Environment.prototype.teardown.apply(this, arguments);
|
||||
Backbone.emulateHTTP = false;
|
||||
}
|
||||
|
||||
});
|
||||
}));
|
||||
|
||||
QUnit.test('read', function(assert) {
|
||||
assert.expect(4);
|
||||
test("read", 4, function() {
|
||||
library.fetch();
|
||||
assert.equal(this.ajaxSettings.url, '/library');
|
||||
assert.equal(this.ajaxSettings.type, 'GET');
|
||||
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||
assert.ok(_.isEmpty(this.ajaxSettings.data));
|
||||
equal(this.ajaxSettings.url, '/library');
|
||||
equal(this.ajaxSettings.type, 'GET');
|
||||
equal(this.ajaxSettings.dataType, 'json');
|
||||
ok(_.isEmpty(this.ajaxSettings.data));
|
||||
});
|
||||
|
||||
QUnit.test('passing data', function(assert) {
|
||||
assert.expect(3);
|
||||
test("passing data", 3, function() {
|
||||
library.fetch({data: {a: 'a', one: 1}});
|
||||
assert.equal(this.ajaxSettings.url, '/library');
|
||||
assert.equal(this.ajaxSettings.data.a, 'a');
|
||||
assert.equal(this.ajaxSettings.data.one, 1);
|
||||
equal(this.ajaxSettings.url, '/library');
|
||||
equal(this.ajaxSettings.data.a, 'a');
|
||||
equal(this.ajaxSettings.data.one, 1);
|
||||
});
|
||||
|
||||
QUnit.test('create', function(assert) {
|
||||
assert.expect(6);
|
||||
assert.equal(this.ajaxSettings.url, '/library');
|
||||
assert.equal(this.ajaxSettings.type, 'POST');
|
||||
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||
test("create", 6, function() {
|
||||
equal(this.ajaxSettings.url, '/library');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(this.ajaxSettings.dataType, 'json');
|
||||
var data = JSON.parse(this.ajaxSettings.data);
|
||||
assert.equal(data.title, 'The Tempest');
|
||||
assert.equal(data.author, 'Bill Shakespeare');
|
||||
assert.equal(data.length, 123);
|
||||
equal(data.title, 'The Tempest');
|
||||
equal(data.author, 'Bill Shakespeare');
|
||||
equal(data.length, 123);
|
||||
});
|
||||
|
||||
QUnit.test('update', function(assert) {
|
||||
assert.expect(7);
|
||||
test("update", 7, function() {
|
||||
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
|
||||
assert.equal(this.ajaxSettings.url, '/library/1-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'PUT');
|
||||
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||
equal(this.ajaxSettings.url, '/library/1-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'PUT');
|
||||
equal(this.ajaxSettings.dataType, 'json');
|
||||
var data = JSON.parse(this.ajaxSettings.data);
|
||||
assert.equal(data.id, '1-the-tempest');
|
||||
assert.equal(data.title, 'The Tempest');
|
||||
assert.equal(data.author, 'William Shakespeare');
|
||||
assert.equal(data.length, 123);
|
||||
equal(data.id, '1-the-tempest');
|
||||
equal(data.title, 'The Tempest');
|
||||
equal(data.author, 'William Shakespeare');
|
||||
equal(data.length, 123);
|
||||
});
|
||||
|
||||
QUnit.test('update with emulateHTTP and emulateJSON', function(assert) {
|
||||
assert.expect(7);
|
||||
test("update with emulateHTTP and emulateJSON", 7, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateHTTP: true,
|
||||
emulateJSON: true
|
||||
});
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'POST');
|
||||
assert.equal(this.ajaxSettings.dataType, 'json');
|
||||
assert.equal(this.ajaxSettings.data._method, 'PUT');
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(this.ajaxSettings.dataType, 'json');
|
||||
equal(this.ajaxSettings.data._method, 'PUT');
|
||||
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||
assert.equal(data.id, '2-the-tempest');
|
||||
assert.equal(data.author, 'Tim Shakespeare');
|
||||
assert.equal(data.length, 123);
|
||||
equal(data.id, '2-the-tempest');
|
||||
equal(data.author, 'Tim Shakespeare');
|
||||
equal(data.length, 123);
|
||||
});
|
||||
|
||||
QUnit.test('update with just emulateHTTP', function(assert) {
|
||||
assert.expect(6);
|
||||
test("update with just emulateHTTP", 6, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateHTTP: true
|
||||
});
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'POST');
|
||||
assert.equal(this.ajaxSettings.contentType, 'application/json');
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(this.ajaxSettings.contentType, 'application/json');
|
||||
var data = JSON.parse(this.ajaxSettings.data);
|
||||
assert.equal(data.id, '2-the-tempest');
|
||||
assert.equal(data.author, 'Tim Shakespeare');
|
||||
assert.equal(data.length, 123);
|
||||
equal(data.id, '2-the-tempest');
|
||||
equal(data.author, 'Tim Shakespeare');
|
||||
equal(data.length, 123);
|
||||
});
|
||||
|
||||
QUnit.test('update with just emulateJSON', function(assert) {
|
||||
assert.expect(6);
|
||||
test("update with just emulateJSON", 6, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateJSON: true
|
||||
});
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'PUT');
|
||||
assert.equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'PUT');
|
||||
equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
|
||||
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||
assert.equal(data.id, '2-the-tempest');
|
||||
assert.equal(data.author, 'Tim Shakespeare');
|
||||
assert.equal(data.length, 123);
|
||||
equal(data.id, '2-the-tempest');
|
||||
equal(data.author, 'Tim Shakespeare');
|
||||
equal(data.length, 123);
|
||||
});
|
||||
|
||||
QUnit.test('read model', function(assert) {
|
||||
assert.expect(3);
|
||||
test("read model", 3, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||
library.first().fetch();
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'GET');
|
||||
assert.ok(_.isEmpty(this.ajaxSettings.data));
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'GET');
|
||||
ok(_.isEmpty(this.ajaxSettings.data));
|
||||
});
|
||||
|
||||
QUnit.test('destroy', function(assert) {
|
||||
assert.expect(3);
|
||||
test("destroy", 3, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||
library.first().destroy({wait: true});
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'DELETE');
|
||||
assert.equal(this.ajaxSettings.data, null);
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'DELETE');
|
||||
equal(this.ajaxSettings.data, null);
|
||||
});
|
||||
|
||||
QUnit.test('destroy with emulateHTTP', function(assert) {
|
||||
assert.expect(3);
|
||||
test("destroy with emulateHTTP", 3, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||
library.first().destroy({
|
||||
emulateHTTP: true,
|
||||
emulateJSON: true
|
||||
});
|
||||
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
assert.equal(this.ajaxSettings.type, 'POST');
|
||||
assert.equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
|
||||
});
|
||||
|
||||
QUnit.test('urlError', function(assert) {
|
||||
assert.expect(2);
|
||||
test("urlError", 2, function() {
|
||||
var model = new Backbone.Model();
|
||||
assert.raises(function() {
|
||||
raises(function() {
|
||||
model.fetch();
|
||||
});
|
||||
model.fetch({url: '/one/two'});
|
||||
assert.equal(this.ajaxSettings.url, '/one/two');
|
||||
equal(this.ajaxSettings.url, '/one/two');
|
||||
});
|
||||
|
||||
QUnit.test('#1052 - `options` is optional.', function(assert) {
|
||||
assert.expect(0);
|
||||
test("#1052 - `options` is optional.", 0, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.url = '/test';
|
||||
Backbone.sync('create', model);
|
||||
});
|
||||
|
||||
QUnit.test('Backbone.ajax', function(assert) {
|
||||
assert.expect(1);
|
||||
test("Backbone.ajax", 1, function() {
|
||||
Backbone.ajax = function(settings){
|
||||
assert.strictEqual(settings.url, '/test');
|
||||
strictEqual(settings.url, '/test');
|
||||
};
|
||||
var model = new Backbone.Model();
|
||||
model.url = '/test';
|
||||
Backbone.sync('create', model);
|
||||
});
|
||||
|
||||
QUnit.test('Call provided error callback on error.', function(assert) {
|
||||
assert.expect(1);
|
||||
test("Call provided error callback on error.", 1, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
Backbone.sync('read', model, {
|
||||
error: function() { assert.ok(true); }
|
||||
error: function() { ok(true); }
|
||||
});
|
||||
this.ajaxSettings.error();
|
||||
});
|
||||
|
||||
QUnit.test('Use Backbone.emulateHTTP as default.', function(assert) {
|
||||
assert.expect(2);
|
||||
test('Use Backbone.emulateHTTP as default.', 2, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
|
||||
Backbone.emulateHTTP = true;
|
||||
model.sync('create', model);
|
||||
assert.strictEqual(this.ajaxSettings.emulateHTTP, true);
|
||||
strictEqual(this.ajaxSettings.emulateHTTP, true);
|
||||
|
||||
Backbone.emulateHTTP = false;
|
||||
model.sync('create', model);
|
||||
assert.strictEqual(this.ajaxSettings.emulateHTTP, false);
|
||||
strictEqual(this.ajaxSettings.emulateHTTP, false);
|
||||
});
|
||||
|
||||
QUnit.test('Use Backbone.emulateJSON as default.', function(assert) {
|
||||
assert.expect(2);
|
||||
test('Use Backbone.emulateJSON as default.', 2, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
|
||||
Backbone.emulateJSON = true;
|
||||
model.sync('create', model);
|
||||
assert.strictEqual(this.ajaxSettings.emulateJSON, true);
|
||||
strictEqual(this.ajaxSettings.emulateJSON, true);
|
||||
|
||||
Backbone.emulateJSON = false;
|
||||
model.sync('create', model);
|
||||
assert.strictEqual(this.ajaxSettings.emulateJSON, false);
|
||||
strictEqual(this.ajaxSettings.emulateJSON, false);
|
||||
});
|
||||
|
||||
QUnit.test('#1756 - Call user provided beforeSend function.', function(assert) {
|
||||
assert.expect(4);
|
||||
test("#1756 - Call user provided beforeSend function.", 4, function() {
|
||||
Backbone.emulateHTTP = true;
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
var xhr = {
|
||||
setRequestHeader: function(header, value) {
|
||||
assert.strictEqual(header, 'X-HTTP-Method-Override');
|
||||
assert.strictEqual(value, 'DELETE');
|
||||
strictEqual(header, 'X-HTTP-Method-Override');
|
||||
strictEqual(value, 'DELETE');
|
||||
}
|
||||
};
|
||||
model.sync('delete', model, {
|
||||
beforeSend: function(_xhr) {
|
||||
assert.ok(_xhr === xhr);
|
||||
ok(_xhr === xhr);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
assert.strictEqual(this.ajaxSettings.beforeSend(xhr), false);
|
||||
strictEqual(this.ajaxSettings.beforeSend(xhr), false);
|
||||
});
|
||||
|
||||
QUnit.test('#2928 - Pass along `textStatus` and `errorThrown`.', function(assert) {
|
||||
assert.expect(2);
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
model.on('error', function(m, xhr, options) {
|
||||
assert.strictEqual(options.textStatus, 'textStatus');
|
||||
assert.strictEqual(options.errorThrown, 'errorThrown');
|
||||
});
|
||||
model.fetch();
|
||||
this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
|
||||
});
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
490
vendor/backbone/test/view.js
vendored
@@ -1,115 +1,71 @@
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
var view;
|
||||
|
||||
QUnit.module('Backbone.View', {
|
||||
|
||||
beforeEach: function(assert) {
|
||||
$('#qunit-fixture').append(
|
||||
'<div id="testElement"><h1>Test</h1></div>'
|
||||
);
|
||||
module("Backbone.View", {
|
||||
|
||||
setup: function() {
|
||||
view = new Backbone.View({
|
||||
id: 'test-view',
|
||||
className: 'test-view',
|
||||
other: 'non-special-option'
|
||||
id : 'test-view',
|
||||
className : 'test-view',
|
||||
other : 'non-special-option'
|
||||
});
|
||||
},
|
||||
|
||||
afterEach: function() {
|
||||
$('#testElement').remove();
|
||||
$('#test-view').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
QUnit.test('constructor', function(assert) {
|
||||
assert.expect(3);
|
||||
assert.equal(view.el.id, 'test-view');
|
||||
assert.equal(view.el.className, 'test-view');
|
||||
assert.equal(view.el.other, void 0);
|
||||
test("constructor", 6, function() {
|
||||
equal(view.el.id, 'test-view');
|
||||
equal(view.el.className, 'test-view');
|
||||
equal(view.el.other, void 0);
|
||||
equal(view.options.id, 'test-view');
|
||||
equal(view.options.className, 'test-view');
|
||||
equal(view.options.other, 'non-special-option');
|
||||
});
|
||||
|
||||
QUnit.test('$', function(assert) {
|
||||
assert.expect(2);
|
||||
var myView = new Backbone.View;
|
||||
myView.setElement('<p><a><b>test</b></a></p>');
|
||||
var result = myView.$('a b');
|
||||
|
||||
assert.strictEqual(result[0].innerHTML, 'test');
|
||||
assert.ok(result.length === +result.length);
|
||||
test("jQuery", 1, function() {
|
||||
var view = new Backbone.View;
|
||||
view.setElement('<p><a><b>test</b></a></p>');
|
||||
strictEqual(view.$('a b').html(), 'test');
|
||||
});
|
||||
|
||||
QUnit.test('$el', function(assert) {
|
||||
assert.expect(3);
|
||||
var myView = new Backbone.View;
|
||||
myView.setElement('<p><a><b>test</b></a></p>');
|
||||
assert.strictEqual(myView.el.nodeType, 1);
|
||||
|
||||
assert.ok(myView.$el instanceof Backbone.$);
|
||||
assert.strictEqual(myView.$el[0], myView.el);
|
||||
});
|
||||
|
||||
QUnit.test('initialize', function(assert) {
|
||||
assert.expect(1);
|
||||
test("initialize", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
this.one = 1;
|
||||
}
|
||||
});
|
||||
|
||||
assert.strictEqual(new View().one, 1);
|
||||
strictEqual(new View().one, 1);
|
||||
});
|
||||
|
||||
QUnit.test('render', function(assert) {
|
||||
assert.expect(1);
|
||||
var myView = new Backbone.View;
|
||||
assert.equal(myView.render(), myView, '#render returns the view instance');
|
||||
});
|
||||
|
||||
QUnit.test('delegateEvents', function(assert) {
|
||||
assert.expect(6);
|
||||
test("delegateEvents", 6, function() {
|
||||
var counter1 = 0, counter2 = 0;
|
||||
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.increment = function(){ counter1++; };
|
||||
myView.$el.on('click', function(){ counter2++; });
|
||||
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
|
||||
view.increment = function(){ counter1++; };
|
||||
view.$el.on('click', function(){ counter2++; });
|
||||
|
||||
var events = {'click h1': 'increment'};
|
||||
var events = {'click #test': 'increment'};
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 1);
|
||||
assert.equal(counter2, 1);
|
||||
view.delegateEvents(events);
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 1);
|
||||
equal(counter2, 1);
|
||||
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 2);
|
||||
assert.equal(counter2, 2);
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 2);
|
||||
equal(counter2, 2);
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 3);
|
||||
assert.equal(counter2, 3);
|
||||
view.delegateEvents(events);
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 3);
|
||||
equal(counter2, 3);
|
||||
});
|
||||
|
||||
QUnit.test('delegate', function(assert) {
|
||||
assert.expect(3);
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.delegate('click', 'h1', function() {
|
||||
assert.ok(true);
|
||||
});
|
||||
myView.delegate('click', function() {
|
||||
assert.ok(true);
|
||||
});
|
||||
myView.$('h1').trigger('click');
|
||||
|
||||
assert.equal(myView.delegate(), myView, '#delegate returns the view instance');
|
||||
});
|
||||
|
||||
QUnit.test('delegateEvents allows functions for callbacks', function(assert) {
|
||||
assert.expect(3);
|
||||
var myView = new Backbone.View({el: '<p></p>'});
|
||||
myView.counter = 0;
|
||||
test("delegateEvents allows functions for callbacks", 3, function() {
|
||||
var view = new Backbone.View({el: '<p></p>'});
|
||||
view.counter = 0;
|
||||
|
||||
var events = {
|
||||
click: function() {
|
||||
@@ -117,148 +73,76 @@
|
||||
}
|
||||
};
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$el.trigger('click');
|
||||
assert.equal(myView.counter, 1);
|
||||
view.delegateEvents(events);
|
||||
view.$el.trigger('click');
|
||||
equal(view.counter, 1);
|
||||
|
||||
myView.$el.trigger('click');
|
||||
assert.equal(myView.counter, 2);
|
||||
view.$el.trigger('click');
|
||||
equal(view.counter, 2);
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$el.trigger('click');
|
||||
assert.equal(myView.counter, 3);
|
||||
view.delegateEvents(events);
|
||||
view.$el.trigger('click');
|
||||
equal(view.counter, 3);
|
||||
});
|
||||
|
||||
|
||||
QUnit.test('delegateEvents ignore undefined methods', function(assert) {
|
||||
assert.expect(0);
|
||||
var myView = new Backbone.View({el: '<p></p>'});
|
||||
myView.delegateEvents({'click': 'undefinedMethod'});
|
||||
myView.$el.trigger('click');
|
||||
test("delegateEvents ignore undefined methods", 0, function() {
|
||||
var view = new Backbone.View({el: '<p></p>'});
|
||||
view.delegateEvents({'click': 'undefinedMethod'});
|
||||
view.$el.trigger('click');
|
||||
});
|
||||
|
||||
QUnit.test('undelegateEvents', function(assert) {
|
||||
assert.expect(7);
|
||||
test("undelegateEvents", 6, function() {
|
||||
var counter1 = 0, counter2 = 0;
|
||||
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.increment = function(){ counter1++; };
|
||||
myView.$el.on('click', function(){ counter2++; });
|
||||
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
|
||||
view.increment = function(){ counter1++; };
|
||||
view.$el.on('click', function(){ counter2++; });
|
||||
|
||||
var events = {'click h1': 'increment'};
|
||||
var events = {'click #test': 'increment'};
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 1);
|
||||
assert.equal(counter2, 1);
|
||||
view.delegateEvents(events);
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 1);
|
||||
equal(counter2, 1);
|
||||
|
||||
myView.undelegateEvents();
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 1);
|
||||
assert.equal(counter2, 2);
|
||||
view.undelegateEvents();
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 1);
|
||||
equal(counter2, 2);
|
||||
|
||||
myView.delegateEvents(events);
|
||||
myView.$('h1').trigger('click');
|
||||
assert.equal(counter1, 2);
|
||||
assert.equal(counter2, 3);
|
||||
|
||||
assert.equal(myView.undelegateEvents(), myView, '#undelegateEvents returns the view instance');
|
||||
view.delegateEvents(events);
|
||||
view.$('#test').trigger('click');
|
||||
equal(counter1, 2);
|
||||
equal(counter2, 3);
|
||||
});
|
||||
|
||||
QUnit.test('undelegate', function(assert) {
|
||||
assert.expect(1);
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.delegate('click', function() { assert.ok(false); });
|
||||
myView.delegate('click', 'h1', function() { assert.ok(false); });
|
||||
|
||||
myView.undelegate('click');
|
||||
|
||||
myView.$('h1').trigger('click');
|
||||
myView.$el.trigger('click');
|
||||
|
||||
assert.equal(myView.undelegate(), myView, '#undelegate returns the view instance');
|
||||
});
|
||||
|
||||
QUnit.test('undelegate with passed handler', function(assert) {
|
||||
assert.expect(1);
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
var listener = function() { assert.ok(false); };
|
||||
myView.delegate('click', listener);
|
||||
myView.delegate('click', function() { assert.ok(true); });
|
||||
myView.undelegate('click', listener);
|
||||
myView.$el.trigger('click');
|
||||
});
|
||||
|
||||
QUnit.test('undelegate with selector', function(assert) {
|
||||
assert.expect(2);
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.delegate('click', function() { assert.ok(true); });
|
||||
myView.delegate('click', 'h1', function() { assert.ok(false); });
|
||||
myView.undelegate('click', 'h1');
|
||||
myView.$('h1').trigger('click');
|
||||
myView.$el.trigger('click');
|
||||
});
|
||||
|
||||
QUnit.test('undelegate with handler and selector', function(assert) {
|
||||
assert.expect(2);
|
||||
var myView = new Backbone.View({el: '#testElement'});
|
||||
myView.delegate('click', function() { assert.ok(true); });
|
||||
var handler = function(){ assert.ok(false); };
|
||||
myView.delegate('click', 'h1', handler);
|
||||
myView.undelegate('click', 'h1', handler);
|
||||
myView.$('h1').trigger('click');
|
||||
myView.$el.trigger('click');
|
||||
});
|
||||
|
||||
QUnit.test('tagName can be provided as a string', function(assert) {
|
||||
assert.expect(1);
|
||||
var View = Backbone.View.extend({
|
||||
tagName: 'span'
|
||||
});
|
||||
|
||||
assert.equal(new View().el.tagName, 'SPAN');
|
||||
});
|
||||
|
||||
QUnit.test('tagName can be provided as a function', function(assert) {
|
||||
assert.expect(1);
|
||||
var View = Backbone.View.extend({
|
||||
tagName: function() {
|
||||
return 'p';
|
||||
}
|
||||
});
|
||||
|
||||
assert.ok(new View().$el.is('p'));
|
||||
});
|
||||
|
||||
QUnit.test('_ensureElement with DOM node el', function(assert) {
|
||||
assert.expect(1);
|
||||
test("_ensureElement with DOM node el", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
el: document.body
|
||||
});
|
||||
|
||||
assert.equal(new View().el, document.body);
|
||||
equal(new View().el, document.body);
|
||||
});
|
||||
|
||||
QUnit.test('_ensureElement with string el', function(assert) {
|
||||
assert.expect(3);
|
||||
test("_ensureElement with string el", 3, function() {
|
||||
var View = Backbone.View.extend({
|
||||
el: 'body'
|
||||
el: "body"
|
||||
});
|
||||
assert.strictEqual(new View().el, document.body);
|
||||
strictEqual(new View().el, document.body);
|
||||
|
||||
View = Backbone.View.extend({
|
||||
el: '#testElement > h1'
|
||||
el: "#testElement > h1"
|
||||
});
|
||||
assert.strictEqual(new View().el, $('#testElement > h1').get(0));
|
||||
strictEqual(new View().el, $("#testElement > h1").get(0));
|
||||
|
||||
View = Backbone.View.extend({
|
||||
el: '#nonexistent'
|
||||
el: "#nonexistent"
|
||||
});
|
||||
assert.ok(!new View().el);
|
||||
ok(!new View().el);
|
||||
});
|
||||
|
||||
QUnit.test('with className and id functions', function(assert) {
|
||||
assert.expect(2);
|
||||
test("with className and id functions", 2, function() {
|
||||
var View = Backbone.View.extend({
|
||||
className: function() {
|
||||
return 'className';
|
||||
@@ -268,54 +152,57 @@
|
||||
}
|
||||
});
|
||||
|
||||
assert.strictEqual(new View().el.className, 'className');
|
||||
assert.strictEqual(new View().el.id, 'id');
|
||||
strictEqual(new View().el.className, 'className');
|
||||
strictEqual(new View().el.id, 'id');
|
||||
});
|
||||
|
||||
QUnit.test('with attributes', function(assert) {
|
||||
assert.expect(2);
|
||||
test("with options function", 3, function() {
|
||||
var View1 = Backbone.View.extend({
|
||||
options: function() {
|
||||
return {
|
||||
title: 'title1',
|
||||
acceptText: 'confirm'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var View2 = View1.extend({
|
||||
options: function() {
|
||||
return _.extend(View1.prototype.options.call(this), {
|
||||
title: 'title2',
|
||||
fixed: true
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
strictEqual(new View2().options.title, 'title2');
|
||||
strictEqual(new View2().options.acceptText, 'confirm');
|
||||
strictEqual(new View2().options.fixed, true);
|
||||
});
|
||||
|
||||
test("with attributes", 2, function() {
|
||||
var View = Backbone.View.extend({
|
||||
attributes: {
|
||||
'id': 'id',
|
||||
id: 'id',
|
||||
'class': 'class'
|
||||
}
|
||||
});
|
||||
|
||||
assert.strictEqual(new View().el.className, 'class');
|
||||
assert.strictEqual(new View().el.id, 'id');
|
||||
strictEqual(new View().el.className, 'class');
|
||||
strictEqual(new View().el.id, 'id');
|
||||
});
|
||||
|
||||
QUnit.test('with attributes as a function', function(assert) {
|
||||
assert.expect(1);
|
||||
test("with attributes as a function", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
attributes: function() {
|
||||
return {'class': 'dynamic'};
|
||||
}
|
||||
});
|
||||
|
||||
assert.strictEqual(new View().el.className, 'dynamic');
|
||||
strictEqual(new View().el.className, 'dynamic');
|
||||
});
|
||||
|
||||
QUnit.test('should default to className/id properties', function(assert) {
|
||||
assert.expect(4);
|
||||
var View = Backbone.View.extend({
|
||||
className: 'backboneClass',
|
||||
id: 'backboneId',
|
||||
attributes: {
|
||||
'class': 'attributeClass',
|
||||
'id': 'attributeId'
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View;
|
||||
assert.strictEqual(myView.el.className, 'backboneClass');
|
||||
assert.strictEqual(myView.el.id, 'backboneId');
|
||||
assert.strictEqual(myView.$el.attr('class'), 'backboneClass');
|
||||
assert.strictEqual(myView.$el.attr('id'), 'backboneId');
|
||||
});
|
||||
|
||||
QUnit.test('multiple views per element', function(assert) {
|
||||
assert.expect(3);
|
||||
test("multiple views per element", 3, function() {
|
||||
var count = 0;
|
||||
var $el = $('<p></p>');
|
||||
|
||||
@@ -329,167 +216,142 @@
|
||||
});
|
||||
|
||||
var view1 = new View;
|
||||
$el.trigger('click');
|
||||
assert.equal(1, count);
|
||||
$el.trigger("click");
|
||||
equal(1, count);
|
||||
|
||||
var view2 = new View;
|
||||
$el.trigger('click');
|
||||
assert.equal(3, count);
|
||||
$el.trigger("click");
|
||||
equal(3, count);
|
||||
|
||||
view1.delegateEvents();
|
||||
$el.trigger('click');
|
||||
assert.equal(5, count);
|
||||
$el.trigger("click");
|
||||
equal(5, count);
|
||||
});
|
||||
|
||||
QUnit.test('custom events', function(assert) {
|
||||
assert.expect(2);
|
||||
test("custom events, with namespaces", 2, function() {
|
||||
var count = 0;
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
el: $('body'),
|
||||
events: {
|
||||
fake$event: function() { assert.ok(true); }
|
||||
events: function() {
|
||||
return {"fake$event.namespaced": "run"};
|
||||
},
|
||||
run: function() {
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View;
|
||||
var view = new View;
|
||||
$('body').trigger('fake$event').trigger('fake$event');
|
||||
equal(count, 2);
|
||||
|
||||
$('body').off('fake$event');
|
||||
$('body').unbind('.namespaced');
|
||||
$('body').trigger('fake$event');
|
||||
equal(count, 2);
|
||||
});
|
||||
|
||||
QUnit.test('#1048 - setElement uses provided object.', function(assert) {
|
||||
assert.expect(2);
|
||||
test("#1048 - setElement uses provided object.", 2, function() {
|
||||
var $el = $('body');
|
||||
|
||||
var myView = new Backbone.View({el: $el});
|
||||
assert.ok(myView.$el === $el);
|
||||
var view = new Backbone.View({el: $el});
|
||||
ok(view.$el === $el);
|
||||
|
||||
myView.setElement($el = $($el));
|
||||
assert.ok(myView.$el === $el);
|
||||
view.setElement($el = $($el));
|
||||
ok(view.$el === $el);
|
||||
});
|
||||
|
||||
QUnit.test('#986 - Undelegate before changing element.', function(assert) {
|
||||
assert.expect(1);
|
||||
test("#986 - Undelegate before changing element.", 1, function() {
|
||||
var button1 = $('<button></button>');
|
||||
var button2 = $('<button></button>');
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
events: {
|
||||
click: function(e) {
|
||||
assert.ok(myView.el === e.target);
|
||||
ok(view.el === e.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View({el: button1});
|
||||
myView.setElement(button2);
|
||||
var view = new View({el: button1});
|
||||
view.setElement(button2);
|
||||
|
||||
button1.trigger('click');
|
||||
button2.trigger('click');
|
||||
});
|
||||
|
||||
QUnit.test('#1172 - Clone attributes object', function(assert) {
|
||||
assert.expect(2);
|
||||
test("#1172 - Clone attributes object", 2, function() {
|
||||
var View = Backbone.View.extend({
|
||||
attributes: {foo: 'bar'}
|
||||
});
|
||||
|
||||
var view1 = new View({id: 'foo'});
|
||||
assert.strictEqual(view1.el.id, 'foo');
|
||||
strictEqual(view1.el.id, 'foo');
|
||||
|
||||
var view2 = new View();
|
||||
assert.ok(!view2.el.id);
|
||||
ok(!view2.el.id);
|
||||
});
|
||||
|
||||
QUnit.test('views stopListening', function(assert) {
|
||||
assert.expect(0);
|
||||
test("#1228 - tagName can be provided as a function", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
this.listenTo(this.model, 'all x', function(){ assert.ok(false); });
|
||||
this.listenTo(this.collection, 'all x', function(){ assert.ok(false); });
|
||||
tagName: function() {
|
||||
return 'p';
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View({
|
||||
ok(new View().$el.is('p'));
|
||||
});
|
||||
|
||||
test("views stopListening", 0, function() {
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
this.listenTo(this.model, 'all x', function(){ ok(false); }, this);
|
||||
this.listenTo(this.collection, 'all x', function(){ ok(false); }, this);
|
||||
}
|
||||
});
|
||||
|
||||
var view = new View({
|
||||
model: new Backbone.Model,
|
||||
collection: new Backbone.Collection
|
||||
});
|
||||
|
||||
myView.stopListening();
|
||||
myView.model.trigger('x');
|
||||
myView.collection.trigger('x');
|
||||
view.stopListening();
|
||||
view.model.trigger('x');
|
||||
view.collection.trigger('x');
|
||||
});
|
||||
|
||||
QUnit.test('Provide function for el.', function(assert) {
|
||||
assert.expect(2);
|
||||
test("Provide function for el.", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
el: function() {
|
||||
return '<p><a></a></p>';
|
||||
return "<p><a></a></p>";
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View;
|
||||
assert.ok(myView.$el.is('p'));
|
||||
assert.ok(myView.$el.has('a'));
|
||||
var view = new View;
|
||||
ok(view.$el.is('p:has(a)'));
|
||||
});
|
||||
|
||||
QUnit.test('events passed in options', function(assert) {
|
||||
assert.expect(1);
|
||||
test("events passed in options", 2, function() {
|
||||
var counter = 0;
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
el: '#testElement',
|
||||
el: '<p><a id="test"></a></p>',
|
||||
increment: function() {
|
||||
counter++;
|
||||
}
|
||||
});
|
||||
|
||||
var myView = new View({
|
||||
events: {
|
||||
'click h1': 'increment'
|
||||
}
|
||||
});
|
||||
var view = new View({events:{'click #test':'increment'}});
|
||||
var view2 = new View({events:function(){
|
||||
return {'click #test':'increment'};
|
||||
}});
|
||||
|
||||
myView.$('h1').trigger('click').trigger('click');
|
||||
assert.equal(counter, 2);
|
||||
view.$('#test').trigger('click');
|
||||
view2.$('#test').trigger('click');
|
||||
equal(counter, 2);
|
||||
|
||||
view.$('#test').trigger('click');
|
||||
view2.$('#test').trigger('click');
|
||||
equal(counter, 4);
|
||||
});
|
||||
|
||||
QUnit.test('remove', function(assert) {
|
||||
assert.expect(2);
|
||||
var myView = new Backbone.View;
|
||||
document.body.appendChild(view.el);
|
||||
|
||||
myView.delegate('click', function() { assert.ok(false); });
|
||||
myView.listenTo(myView, 'all x', function() { assert.ok(false); });
|
||||
|
||||
assert.equal(myView.remove(), myView, '#remove returns the view instance');
|
||||
myView.$el.trigger('click');
|
||||
myView.trigger('x');
|
||||
|
||||
// In IE8 and below, parentNode still exists but is not document.body.
|
||||
assert.notEqual(myView.el.parentNode, document.body);
|
||||
});
|
||||
|
||||
QUnit.test('setElement', function(assert) {
|
||||
assert.expect(3);
|
||||
var myView = new Backbone.View({
|
||||
events: {
|
||||
click: function() { assert.ok(false); }
|
||||
}
|
||||
});
|
||||
myView.events = {
|
||||
click: function() { assert.ok(true); }
|
||||
};
|
||||
var oldEl = myView.el;
|
||||
var $oldEl = myView.$el;
|
||||
|
||||
myView.setElement(document.createElement('div'));
|
||||
|
||||
$oldEl.click();
|
||||
myView.$el.click();
|
||||
|
||||
assert.notEqual(oldEl, myView.el);
|
||||
assert.notEqual($oldEl, myView.$el);
|
||||
});
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
22
vendor/benchmark.js/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright 2010-2013 Mathias Bynens <http://mathiasbynens.be/>
|
||||
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
||||
Modified by John-David Dalton <http://allyoucanleet.com/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
2859
vendor/benchmark.js/benchmark.js
vendored
Normal file
BIN
vendor/benchmark.js/nano.jar
vendored
Normal file
24
vendor/curl/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
Open Source Initiative OSI - The MIT License
|
||||
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Copyright (c) 2010-2013 Brian Cavalier and John Hann
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
48
vendor/curl/dist/curl-kitchen-sink/curl.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
(function(){/*
|
||||
MIT License (c) copyright 2010-2013 B Cavalier & J Hann MIT (c) copyright 2010-2013 B Cavalier & J Hann */
|
||||
(function(d){function l(){}function k(b,e){return 0==U.call(b).indexOf("[object "+e)}function n(b){return b&&"/"==b.charAt(b.length-1)?b.substr(0,b.length-1):b}function h(b,e){var m,g,x,P;m=1;g=b;"."==g.charAt(0)&&(x=!0,g=g.replace(V,function(b,e,g,x){g&&m++;return x||""}));if(x){x=e.split("/");P=x.length-m;if(0>P)return b;x.splice(P,m);return x.concat(g||[]).join("/")}return g}function p(b){var e=b.indexOf("!");return{h:b.substr(e+1),e:0<=e&&b.substr(0,e)}}function v(){}function r(b,e){v.prototype=
|
||||
b||Q;var m=new v;v.prototype=Q;for(var g in e)m[g]=e[g];return m}function z(){function b(b,e,m){g.push([b,e,m])}function e(b,e){for(var m,x=0;m=g[x++];)(m=m[b])&&m(e)}var m,g,x;m=this;g=[];x=function(m,f){b=m?function(b){b&&b(f)}:function(b,e){e&&e(f)};x=l;e(m?0:1,f);e=l;g=G};this.j=function(e,g,x){b(e,g,x);return m};this.g=function(b){m.I=b;x(!0,b)};this.d=function(b){m.Aa=b;x(!1,b)};this.G=function(b){e(2,b)}}function y(b){return b instanceof z||b instanceof t}function q(b,e,m,g){y(b)?b.j(e,m,g):
|
||||
e(b)}function w(b,e,m){var g;return function(){0<=--b&&e&&(g=e.apply(G,arguments));0==b&&m&&m(g);return g}}function c(){var b,e;b=[].slice.call(arguments);k(b[0],"Object")&&(e=b.shift(),e=a(e));return new t(b[0],b[1],b[2],e)}function a(b,e,m){var g,x,a;if(b&&(u.V(b),f=u.b(b),"preloads"in b&&(g=new t(b.preloads,G,m,J,!0),u.C(function(){J=g})),a=(a=b.main)&&String(a).split(W)))return x=new z,x.j(e,m),b=a[1]?function(){new t([a[1]],x.g,x.d)}:x.d,new t([a[0]],x.g,b),x}function t(b,e,m,g,x){var s;s=u.k(f,
|
||||
G,[].concat(b),x);this.then=this.j=b=function(b,e){q(s,function(e){b&&b.apply(G,e)},function(b){if(e)e(b);else throw b;});return this};this.next=function(b,e,g){return new t(b,e,g,s)};this.config=a;(e||m)&&b(e,m);u.C(function(){q(x||J,function(){q(g,function(){u.A(s)},m)})})}function A(b){var e,m;e=b.id;e==G&&(K!==G?K={M:"Multiple anonymous defines encountered"}:(e=u.ia())||(K=b));if(e!=G){m=E[e];e in E||(m=u.m(e,f),m=u.J(m.b,e),E[e]=m);if(!y(m))throw Error("duplicate define: "+e);m.na=!1;u.K(m,b)}}
|
||||
function C(){var b=u.fa(arguments);A(b)}var f,B,F,H=d.document,D=H&&(H.head||H.getElementsByTagName("head")[0]),R=D&&D.getElementsByTagName("base")[0]||null,L={},M={},I={},s="addEventListener"in d?{}:{loaded:1,complete:1},Q={},U=Q.toString,G,E={},N={},J=!1,K,T=/^\/|^[^:]+:\/\//,V=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,X=/\/\*[\s\S]*?\*\/|\/\/.*?[\n\r]/g,Y=/require\s*\(\s*(["'])(.*?[^\\])\1\s*\)|[^\\]?(["'])/g,W=/\s*,\s*/,S,u;u={t:function(b,e,m){var g;b=h(b,e);if("."==b.charAt(0))return b;g=p(b);b=(e=
|
||||
g.e)||g.h;b in m.c&&(b=m.c[b].q||b);e&&(0>e.indexOf("/")&&!(e in m.c)&&(b=n(m.T)+"/"+e),b=b+"!"+g.h);return b},k:function(b,e,m,g){function x(e,g){var m,a;m=u.t(e,f.id,b);if(!g)return m;a=p(m);if(!a.e)return m;m=E[a.e];a.h="normalize"in m?m.normalize(a.h,x,f.b)||"":x(a.h);return a.e+"!"+a.h}function a(e,m,s){var c;c=m&&function(b){m.apply(G,b)};if(k(e,"String")){if(c)throw Error("require(id, callback) not allowed");s=x(e,!0);e=E[s];if(!(s in E))throw Error("Module not resolved: "+s);return(s=y(e)&&
|
||||
e.a)||e}q(u.A(u.k(b,f.id,e,g)),c,s)}var f;f=new z;f.id=e||"";f.ja=g;f.L=m;f.b=b;f.s=a;a.toUrl=function(e){return u.m(x(e,!0),b).url};f.t=x;return f},J:function(b,e,m){var g,x,a;g=u.k(b,e,G,m);x=g.g;a=w(1,function(b){g.w=b;try{return u.aa(g)}catch(e){g.d(e)}});g.g=function(b){q(m||J,function(){x(E[g.id]=N[g.url]=a(b))})};g.N=function(b){q(m||J,function(){g.a&&(a(b),g.G(M))})};return g},Z:function(b,e,m,g){return u.k(b,m,G,g)},ha:function(b){return b.s},P:function(b){return b.a||(b.a={})},ga:function(b){var e=
|
||||
b.B;e||(e=b.B={id:b.id,uri:u.Q(b),exports:u.P(b),config:function(){return b.b}},e.a=e.exports);return e},Q:function(b){return b.url||(b.url=u.u(b.s.toUrl(b.id),b.b))},V:function(b){var e,m,g,a,f;e="curl";m="define";g=a=d;if(b&&(f=b.overwriteApi||b.xa,e=b.apiName||b.pa||e,g=b.apiContext||b.oa||g,m=b.defineName||b.ta||m,a=b.defineContext||b.sa||a,B&&k(B,"Function")&&(d.curl=B),B=null,F&&k(F,"Function")&&(d.define=F),F=null,!f)){if(g[e]&&g[e]!=c)throw Error(e+" already exists");if(a[m]&&a[m]!=C)throw Error(m+
|
||||
" already exists");}g[e]=c;a[m]=C},b:function(b){function e(b,e){var m,g,f,c,d;for(d in b){f=b[d];k(f,"String")&&(f={path:b[d]});f.name=f.name||d;c=a;g=p(n(f.name));m=g.h;if(g=g.e)c=s[g],c||(c=s[g]=r(a),c.c=r(a.c),c.f=[]),delete b[d];g=f;var l=e,q=void 0;g.path=n(g.path||g.location||"");l&&(q=g.main||"./main","."==q.charAt(0)||(q="./"+q),g.q=h(q,g.name+"/"));g.b=g.config;g.b&&(g.b=r(a,g.b));g.W=m.split("/").length;m?(c.c[m]=g,c.f.push(m)):c.n=u.U(f.path,a)}}function m(b){var e=b.c;b.S=RegExp("^("+
|
||||
b.f.sort(function(b,g){return e[g].W-e[b].W}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete b.f}var g,a,s,c;"baseUrl"in b&&(b.n=b.baseUrl);"main"in b&&(b.q=b.main);"preloads"in b&&(b.ya=b.preloads);"pluginPath"in b&&(b.T=b.pluginPath);if("dontAddFileExt"in b||b.l)b.l=RegExp(b.dontAddFileExt||b.l);g=f;a=r(g,b);a.c=r(g.c);s=b.plugins||{};a.plugins=r(g.plugins);a.F=r(g.F,b.F);a.D=r(g.D,b.D);a.f=[];e(b.packages,!0);e(b.paths,!1);for(c in s)b=u.t(c+"!","",a),a.plugins[b.substr(0,b.length-1)]=
|
||||
s[c];s=a.plugins;for(c in s)if(s[c]=r(a,s[c]),b=s[c].f)s[c].f=b.concat(a.f),m(s[c]);for(c in g.c)a.c.hasOwnProperty(c)||a.f.push(c);m(a);return a},m:function(b,e){var a,g,c,s;a=e.c;c=T.test(b)?b:b.replace(e.S,function(b){g=a[b]||{};s=g.b;return g.path||""});return{b:s||f,url:u.U(c,e)}},U:function(b,e){var a=e.n;return a&&!T.test(b)?n(a)+"/"+b:b},u:function(b,e){return b+((e||f).l.test(b)?"":".js")},p:function(b,e,a){var g=H.createElement("script");g.onload=g.onreadystatechange=function(a){a=a||d.event;
|
||||
if("load"==a.type||s[g.readyState])delete I[b.id],g.onload=g.onreadystatechange=g.onerror="",e()};g.onerror=function(){a(Error("Syntax or http error: "+b.url))};g.type=b.r||"text/javascript";g.charset="utf-8";g.async=!b.R;g.src=b.url;I[b.id]=g;D.insertBefore(g,R);return g},O:function(b){var e=[],a;("string"==typeof b?b:b.toSource?b.toSource():b.toString()).replace(X,"").replace(Y,function(b,f,c,s){s?a=a==s?G:a:a||e.push(c);return""});return e},fa:function(b){var e,a,g,f,c,s;c=b.length;g=b[c-1];f=
|
||||
k(g,"Function")?g.length:-1;2==c?k(b[0],"Array")?a=b[0]:e=b[0]:3==c&&(e=b[0],a=b[1]);!a&&0<f&&(s=!0,a=["require","exports","module"].slice(0,f).concat(u.O(g)));return{id:e,w:a||[],H:0<=f?g:function(){return g},v:s}},aa:function(b){var e;e=b.H.apply(b.v?b.a:G,b.w);e===G&&b.a&&(e=b.B?b.a=b.B.a:b.a);return e},K:function(b,e){b.H=e.H;b.v=e.v;b.L=e.w;u.A(b)},A:function(b){function e(b,e,a){s[e]=b;a&&k(b,e)}function a(e,g){var f,c,s,m;f=w(1,function(b){c(b);p(b,g)});c=w(1,function(b){k(b,g)});s=u.ca(e,
|
||||
b);(m=y(s)&&s.a)&&c(m);q(s,f,b.d,b.a&&function(b){s.a&&(b==L?c(s.a):b==M&&f(s.a))})}function g(){b.g(s)}var f,c,s,d,h,k,p;s=[];c=b.L;d=c.length;0==c.length&&g();k=w(d,e,function(){b.N&&b.N(s)});p=w(d,e,g);for(f=0;f<d;f++)h=c[f],h in S?(p(S[h](b),f,!0),b.a&&b.G(L)):h?a(h,f):p(G,f,!0);return b},da:function(b){u.Q(b);u.p(b,function(){var e=K;K=G;!1!==b.na&&(!e||e.M?b.d(Error(e&&e.M||"define() missing or duplicated: "+b.url)):u.K(b,e))},b.d);return b},ca:function(b,e){var a,g,s,c,d,h,k,l,n,r,t,B;a=e.t;
|
||||
g=e.ja;s=e.b||f;d=a(b);d in E?h=d:(c=p(d),l=c.h,h=c.e||l,n=u.m(h,s));if(!(d in E))if(B=u.m(l,s).b,c.e)k=h;else if(k=B.moduleLoader||B.wa||B.loader||B.va)l=h,h=k,n=u.m(k,s);h in E?r=E[h]:n.url in N?r=E[h]=N[n.url]:(r=u.J(B,h,g),r.url=u.u(n.url,n.b),E[h]=N[n.url]=r,u.da(r));h==k&&(c.e&&s.plugins[c.e]&&(B=s.plugins[c.e]),t=new z,q(r,function(b){var e,c,s;s=b.dynamic;l="normalize"in b?b.normalize(l,a,r.b)||"":a(l);c=k+"!"+l;e=E[c];if(!(c in E)){e=u.Z(B,c,l,g);s||(E[c]=e);var f=function(b){s||(E[c]=b);
|
||||
e.g(b)};f.resolve=f;f.reject=f.error=e.d;b.load(l,e.s,f,B)}t!=e&&q(e,t.g,t.d,t.G)},t.d));return t||r},ia:function(){var b;if(!k(d.opera,"Opera"))for(var e in I)if("interactive"==I[e].readyState){b=e;break}return b},ea:function(b){var e=0,a,c;for(a=H&&(H.scripts||H.getElementsByTagName("script"));a&&(c=a[e++]);)if(b(c))return c},ba:function(b){var e;(e=u.ea(function(e){if(e=e.getAttribute("data-curl-run"))b.q=e;return e}))&&e.setAttribute("data-curl-run","");return b},C:function(b){setTimeout(b,0)}};
|
||||
S={require:u.ha,exports:u.P,module:u.ga};c.version="0.8.1";c.config=a;C.amd={plugins:!0,jQuery:!0,curl:"0.8.1"};f={n:"",T:"curl/plugin",l:/\?|\.js\b/,F:{},D:{},plugins:{},c:{},S:/$^/};f=u.ba(f);B=d.curl;F=d.define;B&&k(B,"Object")||f.q?(d.curl=G,a(B||f)):u.V();E.curl=c;E["curl/_privileged"]={core:u,cache:E,config:function(){return f},_define:A,_curl:c,Promise:z}})(this.window||"undefined"!=typeof global&&global||this);
|
||||
(function(d,l){function k(){if(!l.body)return!1;C||(C=l.createTextNode(""));try{return l.body.removeChild(l.body.appendChild(C)),C=A,!0}catch(a){return!1}}function n(){var f;f=v[l[p]]&&k();if(!y&&f){y=!0;for(clearTimeout(t);c=a.pop();)c();z&&(l[p]="complete");for(var h;h=r.shift();)h()}return f}function h(){n();y||(t=setTimeout(h,q))}var p="readyState",v={loaded:1,interactive:1,complete:1},r=[],z=l&&"string"!=typeof l[p],y=!1,q=10,w,c,a=[],t,A,C;w="addEventListener"in d?function(a,c){a.addEventListener(c,
|
||||
n,!1);return function(){a.removeEventListener(c,n,!1)}}:function(a,c){a.attachEvent("on"+c,n);return function(){a.detachEvent(c,n)}};l&&!n()&&(a=[w(d,"load"),w(l,"readystatechange"),w(d,"DOMContentLoaded")],t=setTimeout(h,q));define("curl/domReady",function(){function a(c){y?c():r.push(c)}a.then=a;a.amd=!0;return a})})(this,this.document);var O;
|
||||
(function(d,l){define("curl/shim/dojo18",["curl/_privileged"],function(k){function n(a){a.has||(a.has=c);a.on||(a.on=p);a.idle||(a.idle=h);a.async=!0}function h(){for(var a in r)if(r[a]instanceof z)return!1;return!0}function p(){}var v,r,z,y;v=k._curl;r=k.cache;z=k.Promise;y=k.core.k;var q,w,c;q=k.b().ua||{};w=l&&l.createElement("div");c=function(a){return"function"==typeof q[a]?q[a]=q[a](d,l,w):q[a]};c.add=function(a,h,d,k){if(void 0===q[a]||k)q[a]=h;if(d)return c(a)};q["dojo-loader"]=!1;r["dojo/_base/loader"]=
|
||||
0;"undefined"==typeof O&&(n(v),O=v);k.core.k=function(){var a=y.apply(this,arguments);n(a.s);return a};return!0})})("object"==typeof global?global:this.window||this.global,"object"==typeof document&&document);
|
||||
(function(d,l,k){define("curl/plugin/js",["curl/_privileged"],function(d){function h(c,a,h){function l(){f||(p<new Date?h():setTimeout(l,10))}var p,f,r;p=(new Date).valueOf()+(c.ma||3E5);h&&c.a&&setTimeout(l,10);r=d.core.p(c,function(){f=!0;c.a&&(c.I=k(c.a));!c.a||c.I?a(r):h()},function(a){f=!0;h(a)})}function p(c,a){h(c,function(){var h=r.shift();q=0<r.length;h&&p.apply(null,h);a.g(c.I||!0)},function(c){a.d(c)})}var v={},r=[],z=l&&!0==l.createElement("script").async,y,q,w=/\?|\.js\b/;y=d.Promise;
|
||||
return{dynamic:!0,normalize:function(c,a){var h=c.indexOf("!");return 0<=h?a(c.substr(0,h))+c.substr(h):a(c)},load:function(c,a,d,k){function l(a){(d.error||function(a){throw a;})(a)}var f,n,F,H,D;f=0<c.indexOf("!order");n=c.indexOf("!exports=");F=0<n?c.substr(n+9):k.a;H="prefetch"in k?k.prefetch:!0;c=f||0<n?c.substr(0,c.indexOf("!")):c;n=(n=k.dontAddFileExt||k.l)?RegExp(n):w;D=a.toUrl(c);n.test(D)||(D=D.lastIndexOf(".")<=D.lastIndexOf("/")?D+".js":D);D in v?v[D]instanceof y?v[D].j(d,l):d(v[D]):(c=
|
||||
{name:c,url:D,R:f,a:F,ma:k.timeout},v[D]=a=new y,a.j(function(a){v[D]=a;d(a)},l),f&&!z&&q?(r.push([c,a]),H&&(c.r="text/cache",h(c,function(a){a&&a.parentNode.removeChild(a)},function(){}),c.r="")):(q=q||f,p(c,a)))},cramPlugin:"../cram/js"}})})(this,this.document,function(d){try{return eval(d)}catch(l){}});
|
||||
define("curl/plugin/_fetchText",[],function(){var d,l;l=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d=function(){if("undefined"!==typeof XMLHttpRequest)d=function(){return new XMLHttpRequest};else for(var k=d=function(){throw Error("getXhr(): XMLHttpRequest not available");};0<l.length&&d===k;)(function(k){try{new ActiveXObject(k),d=function(){return new ActiveXObject(k)}}catch(h){}})(l.shift());return d()};return function(k,l,h){var p=d();p.open("GET",k,!0);p.onreadystatechange=function(){4===
|
||||
p.readyState&&(400>p.status?l(p.responseText):h(Error("fetchText() failed. status: "+p.statusText)))};p.send(null)}});define("curl/plugin/text",["./_fetchText"],function(d){function l(d){throw d;}return{normalize:function(d,l){return d?l(d.split("!")[0]):d},load:function(k,n,h){d(n.toUrl(k),h,h.error||l)},cramPlugin:"../cram/text"}});
|
||||
define("curl/plugin/async",function(){return{load:function(d,l,k){function n(h){"function"==typeof k.error&&k.error(h)}l([d],function(h){"function"==typeof h.j?h.j(function(d){0==arguments.length&&(d=h);k(d)},n):k(h)},k.error||function(h){throw h;})},analyze:function(d,l,k){k(d)}}});
|
||||
(function(d){function l(){var a;a=f[A]("link");a.rel="stylesheet";a.type="text/css";return a}function k(a,c){a.onload=function(){I.load=I.load||!0;c()}}function n(a,c){a.onerror=function(){I.error=I.error||!0;c()}}function h(a,c,f){D.push({url:a,X:c,$:function(){f(Error(M))}});(a=v())&&p(a)}function p(a){var c,f;c=D.shift();f=a.styleSheet;c?(a.onload=function(){c.X(c.la);p(a)},a.onerror=function(){c.$();p(a)},c.la=f.imports[f.addImport(c.url)]):(a.onload=a.onerror=t,H.push(a))}function v(){var a;
|
||||
a=H.shift();!a&&F.length<R&&(a=f.createElement("style"),F.push(a),B.appendChild(a));return a}function r(a){var c,h,d;if(!a.href||f.readyState&&"complete"!=f.readyState)return!1;c=!1;try{if(h=a.sheet)d=h.cssRules,c=null===d,!c&&d&&(h.insertRule("-curl-css-test {}",0),h.deleteRule(0),c=!0)}catch(k){c="[object Opera]"!=Object.prototype.toString.call(window.opera)&&/security|denied/i.test(k.message)}return c}function z(a,c,f){I.load||(r(a)?f(a.sheet):a.onload==t||!a.onload||C(function(){z(a,c,f)},c))}
|
||||
function y(a,f,h){function d(){a.onload!=t&&a.onload&&(a.onload=a.onerror=t,c(function(){h(a.sheet)}))}k(a,d);z(a,f,d)}function q(a,c){n(a,function(){a.onload!=t&&a.onload&&(a.onload=a.onerror=t,c(Error(M)))})}function w(a,c,f,h){var d;d=l();y(d,h,c);q(d,f);d.href=a;B.appendChild(d)}function c(a){function c(){f.readyState&&"complete"!=f.readyState?C(c,10):a()}c()}function a(a){return a.lastIndexOf(".")<=a.lastIndexOf("/")?a+".css":a}function t(){}var A="createElement",C=d.setTimeout,f=d.document,
|
||||
B;d=f&&f.createStyleSheet&&!(10<=f.documentMode);var F=[],H=[],D=[],R=12,L,M="HTTP or network error.",I={};f&&(B=f.head||f.getElementsByTagName("head")[0],L=d?h:w);define("curl/plugin/css",{normalize:function(a,c){var f,h;if(!a)return a;f=a.split(",");h=[];for(var d=0,k=f.length;d<k;d++)h.push(c(f[d]));return h.join(",")},load:function(c,f,h,d){function k(a){1<n.length&&p.push(a);0==--w&&h(1==n.length?a:p)}function r(a){(h.d||function(a){throw a;})(a)}var p,n,q,w,F;p=[];n=(c||"").split(",");q=d.cssWatchPeriod||
|
||||
50;d=d.cssNoWait;w=n.length;for(F=0;F<n.length;F++){c=n[F];var t;c=a(f.toUrl(c));d?(t=l(),t.href=c,B.appendChild(t),k(t.sheet||t.styleSheet)):L(c,k,r,q)}},cramPlugin:"../cram/css"})})(this);
|
||||
(function(d){var l=d.document,k=/^\/\//,n;l&&(n=l.head||(l.head=l.getElementsByTagName("head")[0]));define("curl/plugin/link",{load:function(d,p,v,r){d=p.toUrl(d);d=d.lastIndexOf(".")<=d.lastIndexOf("/")?d+".css":d;r=d=(r="fixSchemalessUrls"in r?r.fixSchemalessUrls:l.location.protocol)?d.replace(k,r+"//"):d;d=l.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=r;n.appendChild(d);v(d.sheet||d.styleSheet)}})})(this);
|
||||
define("curl/plugin/domReady",["../domReady"],function(d){return{load:function(l,k,n){d(n)}}});(function(d){define("curl/shim/_fetchText",function(){function l(d,h,k){n.za(d,function(d,l){d?k(d):h(l.toString())})}function k(d,k,l){var n;d=p.parse(d,!1,!0);n="";h.get(d,function(d){d.i("data",function(c){n+=c}).i("end",function(){k(n)}).i("error",l)}).i("error",l)}var n,h,p;n=d("fs");h=d("http");p=d("url");var v;v=/^https?:/;return function(d,h,n){v.test(d)?k(d,h,n):l(d,h,n)}})})(O);define.amd.Ca=!0;
|
||||
(function(d,l){define("curl/shim/ssjs",["curl/_privileged","./_fetchText"],function(k,n){function h(a,c,d){try{l(a.url),c()}catch(f){d(f)}}function p(a,c,f){var h;try{h=a.url.replace(/\.js$/,""),d(h),c()}catch(k){f(k)}}function v(a,c,f){var h;a=d("url").parse(a.url,!1,!0);h="";A.get(a,function(a){a.i("data",function(a){h+=a}).i("end",function(){z(h);c()}).i("error",f)}).i("error",f)}function r(a){throw Error("ssjs: unable to load module in current environment: "+a.url);}function z(a){eval(a)}function y(c){return c&&
|
||||
c.replace(a,function(a,c){return c})}var q,w,c,a,t,A,C,f;if("object"!=typeof window||!window.ra&&!window.navigator){q=k.qa;w=k.b();c=/^\w+:\/\//;a=/(^\w+:)?.*$/;"undefined"==typeof XMLHttpRequest&&(q["curl/plugin/_fetchText"]=n);t=(w.o&&":"!=w.o[w.o.length-1]?w.o+":":w.o)||y(w.n)||"http:";if(l)C=f=h;else if(d){C=p;try{A=d("http"),f=v}catch(B){f=r}}else C=f=r;"object"===typeof process&&process.ka&&(k.Y.C=process.ka);k.Y.p=function(a,d,h){/^\/\//.test(a.url)&&(a.url=t+a.url);return c.test(a.url)?f(a,
|
||||
d,h):C(a,d,h)}}})})(O,void 0);
|
||||
(function(d,l,k){define("curl/loader/cjsm11",["../plugin/_fetchText","curl/_privileged"],function(d,h){function p(d,c){p="text"in d?function(a,c){a.text=c}:function(a,c){a.appendChild(l.createTextNode(c))};p(d,c)}function v(d,c,a){a=a?"/*\n////@ sourceURL="+a.replace(/\s/g,"%20")+".js\n*/":"";return"define('"+c+"',['require','exports','module'],function(require,exports,module){"+d+"\n});\n"+a+"\n"}var r,z,y,q;z=(r=l&&(l.head||l.getElementsByTagName("head")[0]))&&r.getElementsByTagName("base")[0]||null;
|
||||
y=h.core.O;q=h.core.u;v.load=function(h,c,a,t){var A,C,f;A=a.error||function(a){throw a;};C=q(c.Ea(h),t);f=!1!==t.injectSourceUrl&&C;d(C,function(d){var n;n=y(d);c(n,function(){d=v(d,h,f);if(t.injectScript){var n=d,q=l.createElement("script");p(q,n);q.charset="utf-8";r.insertBefore(q,z)}else k(d);a(c(h))},A)},A)};v.cramPlugin="../cram/cjsm11";return v})})(this,this.document,function(d){eval(d)});
|
||||
define("curl/plugin/locale",function(){function d(d,h){var k;if(d&&(k=d.locale,"function"==typeof k&&(k=k(d,h)),"string"==typeof k))return k;if("undefined"==typeof window)return!1;k=window.clientInformation||window.navigator;return(k&&(k.language||k.userLanguage)||"").toLowerCase()}function l(d,h){return d.replace(k,(h?"/"+h:"")+"$&")}var k;k=/(\.js)?$/;d.toModuleId=l;d.load=function(k,h,p,v){function r(){var c=Error("Unable to find correct locale for "+k);if(p.error)p.error(c);else throw c;}var z,
|
||||
y;z=d(v,k);y=v.localeToModuleId||l;v=z?y(k,z):k;try{p(h(v))}catch(q){y=z?y(k,!1):k;if(y==v)return r();try{p(h(y))}catch(w){if(!0!==z)return r();h(["i18n!"+k],p,r)}}};return d});
|
||||
define("curl/plugin/i18n",["./locale"],function(d){function l(d,l,h,p,v){d([l],function(d){p(d,h)},v)}return{load:function(k,n,h,p){function v(a,c){w[c]=a;r()}function r(){var d;if(++c==a.length)if(0==w.length)z(Error('No i18n bundles found: "'+k+'", locale "'+q+'"'));else{d=w[0]||{};for(A=1;A<w.length;A++){var f=w[A],l={},n=void 0;for(n in d)l[n]=d[n];if(f)for(n in f)l[n]=f[n];d=l}h(d)}}var z,y,q,w,c,a,t,A;z=h.error;k||z(Error("blank i18n bundle id."));y=p.localeToModuleId||d.Da;q=d(p,k);a=[k];w=
|
||||
[];c=0;if(q&&!1!==p.locale)for(a=a.concat(q.split("-")),t=[],A=1;A<a.length;A++)t[A-1]=a[A],p=y(k,t.join("-")),l(n,p,A,v,r);l(n,k,0,v,r)},cramPlugin:"../cram/i18n"}});
|
||||
(function(d,l,k){define("curl/loader/legacy",["curl/_privileged"],function(n){var h,p,v;h=l&&!0==l.createElement("script").async;p=n.core.p;v=/\?|\.js\b/;return{load:function(l,n,y,q){function w(){B.r="";p(B,c,a)}function c(){var c;if(!(0<--F)){if(A)try{c=A.call(d,l)}catch(f){a(Error("Factory for legacy "+l+" failed: "+f.message))}else try{c=k(t)}catch(h){a(Error("Failed to find exports "+t+" for legacy "+l))}y(c)}}function a(a){(y.error||function(a){throw a;})(a)}var t,A,C,f,B,F;t=q.exports||q.a;
|
||||
A=q.factory||q.factory;if(!t&&!A)throw Error("`exports` or `factory` required for legacy: "+l);C=[].concat(q.requires||q.Ba||[]);q=(q=q.dontAddFileExt||q.l)?RegExp(q):v;f=n.toUrl(l);q.test(f)||(f=f.lastIndexOf(".")<=f.lastIndexOf("/")?f+".js":f);B={url:f,R:!0,r:h||!C.length?"":"text/cache"};C.length?(F=2,n(C,h?c:w,a)):F=1;p(B,c,a)},cramPlugin:"../cram/legacy"}})})(this,this.document,function(d){return(0,eval)(d)});
|
||||
}).call(this);
|
||||
20
vendor/docdown/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
38
vendor/docdown/docdown.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*!
|
||||
* Docdown v1.0.0-pre
|
||||
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Available under MIT license <http://mths.be/mit>
|
||||
*/
|
||||
require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
|
||||
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries in a given file.
|
||||
*
|
||||
* @param {Array} [$options=array()] The options array.
|
||||
* @returns {string} The generated Markdown.
|
||||
* @example
|
||||
*
|
||||
* // specify a file path
|
||||
* $markdown = docdown(array(
|
||||
* // path to js file
|
||||
* 'path' => $filepath,
|
||||
* // url used to reference line numbers in code
|
||||
* 'url' => 'https://github.com/username/project/blob/master/my.js'
|
||||
* ));
|
||||
*
|
||||
* // or pass raw js
|
||||
* $markdown = docdown(array(
|
||||
* // raw JavaScript source
|
||||
* 'source' => $rawJS,
|
||||
* // documentation title
|
||||
* 'title' => 'My API Documentation',
|
||||
* // url used to reference line numbers in code
|
||||
* 'url' => 'https://github.com/username/project/blob/master/my.js'
|
||||
* ));
|
||||
*/
|
||||
function docdown( $options = array() ) {
|
||||
$gen = new MarkdownGenerator($options);
|
||||
return $gen->generate();
|
||||
}
|
||||
?>
|
||||
226
vendor/docdown/src/DocDown/Alias.php
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* A class to represent a JSDoc entry alias.
|
||||
*/
|
||||
class Alias {
|
||||
|
||||
/**
|
||||
* The alias owner.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @type Object
|
||||
*/
|
||||
public $owner;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Alias constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {string} $name The alias name.
|
||||
* @param {Object} $owner The alias owner.
|
||||
*/
|
||||
public function __construct( $name, $owner ) {
|
||||
$this->owner = $owner;
|
||||
$this->_name = $name;
|
||||
$this->_call = $owner->getCall();
|
||||
$this->_category = $owner->getCategory();
|
||||
$this->_desc = $owner->getDesc();
|
||||
$this->_example = $owner->getExample();
|
||||
$this->_isCtor = $owner->isCtor();
|
||||
$this->_isLicense = $owner->isLicense();
|
||||
$this->_isPlugin = $owner->isPlugin();
|
||||
$this->_isPrivate = $owner->isPrivate();
|
||||
$this->_isStatic = $owner->isStatic();
|
||||
$this->_lineNumber = $owner->getLineNumber();
|
||||
$this->_members = $owner->getMembers();
|
||||
$this->_params = $owner->getParams();
|
||||
$this->_returns = $owner->getReturns();
|
||||
$this->_type = $owner->getType();
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Extracts the entry's `alias` objects.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `alias` objects.
|
||||
*/
|
||||
public function getAliases( $index = null ) {
|
||||
$result = array();
|
||||
return $index !== null
|
||||
? @$result[$index]
|
||||
: $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the function call from the owner entry.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The function call.
|
||||
*/
|
||||
public function getCall() {
|
||||
return $this->_call;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `category` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's `category` data.
|
||||
*/
|
||||
public function getCategory() {
|
||||
return $this->_category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's description.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's description.
|
||||
*/
|
||||
public function getDesc() {
|
||||
return $this->_desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `example` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's `example` data.
|
||||
*/
|
||||
public function getExample() {
|
||||
return $this->_example;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is an alias.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true`.
|
||||
*/
|
||||
public function isAlias() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the owner entry is a constructor.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true` if a constructor, else `false`.
|
||||
*/
|
||||
public function isCtor() {
|
||||
return $this->_isCtor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the owner entry is a license.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true` if a license, else `false`.
|
||||
*/
|
||||
public function isLicense() {
|
||||
return $this->_isLicense;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the owner entry *is* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isPlugin() {
|
||||
return $this->_isPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the owner entry is private.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true` if private, else `false`.
|
||||
*/
|
||||
public function isPrivate() {
|
||||
return $this->_isPrivate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the owner entry is *not* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isStatic() {
|
||||
return $this->_isStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the owner entry's line number.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {number} The owner entry's line number.
|
||||
*/
|
||||
public function getLineNumber() {
|
||||
return $this->_lineNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `member` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The owner entry's `member` data.
|
||||
*/
|
||||
public function getMembers( $index = null ) {
|
||||
return $index !== null
|
||||
? @$this->_members[$index]
|
||||
: $this->_members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `name` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's `name` data.
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `param` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array} The owner entry's `param` data.
|
||||
*/
|
||||
public function getParams( $index = null ) {
|
||||
return $index !== null
|
||||
? @$this->_params[$index]
|
||||
: $this->_params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `returns` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's `returns` data.
|
||||
*/
|
||||
public function getReturns() {
|
||||
return $this->_returns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the owner entry's `type` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {string} The owner entry's `type` data.
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->_type;
|
||||
}
|
||||
}
|
||||
?>
|
||||
451
vendor/docdown/src/DocDown/Entry.php
vendored
Normal file
@@ -0,0 +1,451 @@
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__) . "/Alias.php");
|
||||
|
||||
/**
|
||||
* A class to simplify parsing a single JSDoc entry.
|
||||
*/
|
||||
class Entry {
|
||||
|
||||
/**
|
||||
* The documentation entry.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type string
|
||||
*/
|
||||
public $entry = '';
|
||||
|
||||
/**
|
||||
* The language highlighter used for code examples.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type string
|
||||
*/
|
||||
public $lang = '';
|
||||
|
||||
/**
|
||||
* The source code.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type string
|
||||
*/
|
||||
public $source = '';
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Entry constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {string} $entry The documentation entry to analyse.
|
||||
* @param {string} $source The source code.
|
||||
* @param {string} [$lang ='js'] The language highlighter used for code examples.
|
||||
*/
|
||||
public function __construct( $entry, $source, $lang = 'js' ) {
|
||||
$this->entry = $entry;
|
||||
$this->lang = $lang;
|
||||
$this->source = str_replace(PHP_EOL, "\n", $source);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Extracts the documentation entries from source code.
|
||||
*
|
||||
* @static
|
||||
* @memberOf Entry
|
||||
* @param {string} $source The source code.
|
||||
* @returns {Array} The array of entries.
|
||||
*/
|
||||
public static function getEntries( $source ) {
|
||||
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
|
||||
return array_pop($result);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Checks if the entry is a function reference.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if the entry is a function reference, else `false`.
|
||||
*/
|
||||
private function isFunction() {
|
||||
if (!isset($this->_isFunction)) {
|
||||
$this->_isFunction = !!(
|
||||
$this->isCtor() ||
|
||||
count($this->getParams()) ||
|
||||
count($this->getReturns()) ||
|
||||
preg_match('/\*[\t ]*@function\b/', $this->entry)
|
||||
);
|
||||
}
|
||||
return $this->_isFunction;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Extracts the entry's `alias` objects.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `alias` objects.
|
||||
*/
|
||||
public function getAliases( $index = null ) {
|
||||
if (!isset($this->_aliases)) {
|
||||
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
|
||||
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
|
||||
foreach ($result as $resultIndex => $value) {
|
||||
$result[$resultIndex] = new Alias($value, $this);
|
||||
}
|
||||
}
|
||||
$this->_aliases = $result;
|
||||
}
|
||||
return $index !== null
|
||||
? @$this->_aliases[$index]
|
||||
: $this->_aliases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the function call from the entry.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The function call.
|
||||
*/
|
||||
public function getCall() {
|
||||
if (isset($this->_call)) {
|
||||
return $this->_call;
|
||||
}
|
||||
|
||||
preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result);
|
||||
if ($result = array_pop($result)) {
|
||||
$result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'")));
|
||||
}
|
||||
// resolve name
|
||||
// avoid $this->getName() because it calls $this->getCall()
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
|
||||
if (count($name)) {
|
||||
$name = trim($name[1]);
|
||||
} else {
|
||||
$name = $result;
|
||||
}
|
||||
// compile function call syntax
|
||||
if ($this->isFunction()) {
|
||||
// compose parts
|
||||
$result = array($result);
|
||||
$params = $this->getParams();
|
||||
|
||||
foreach ($params as $param) {
|
||||
// skip params that are properties of other params (e.g. `options.leading`)
|
||||
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
|
||||
$result[] = $param[1];
|
||||
}
|
||||
}
|
||||
// format
|
||||
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
|
||||
}
|
||||
|
||||
$this->_call = $result ? $result : $name;
|
||||
return $this->_call;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `category` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's `category` data.
|
||||
*/
|
||||
public function getCategory() {
|
||||
if (isset($this->_category)) {
|
||||
return $this->_category;
|
||||
}
|
||||
|
||||
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
|
||||
}
|
||||
$this->_category = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's description.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's description.
|
||||
*/
|
||||
public function getDesc() {
|
||||
if (isset($this->_desc)) {
|
||||
return $this->_desc;
|
||||
}
|
||||
|
||||
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$type = $this->getType();
|
||||
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
|
||||
$result = trim($result);
|
||||
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
|
||||
}
|
||||
$this->_desc = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `example` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's `example` data.
|
||||
*/
|
||||
public function getExample() {
|
||||
if (isset($this->_example)) {
|
||||
return $this->_example;
|
||||
}
|
||||
|
||||
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
|
||||
$result = '```' . $this->lang . "\n" . $result . "\n```";
|
||||
}
|
||||
$this->_example = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is an alias.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `false`.
|
||||
*/
|
||||
public function isAlias() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is a constructor.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if a constructor, else `false`.
|
||||
*/
|
||||
public function isCtor() {
|
||||
if (!isset($this->_isCtor)) {
|
||||
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
|
||||
}
|
||||
return $this->_isCtor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is a license.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if a license, else `false`.
|
||||
*/
|
||||
public function isLicense() {
|
||||
if (!isset($this->_isLicense)) {
|
||||
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
|
||||
}
|
||||
return $this->_isLicense;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry *is* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isPlugin() {
|
||||
if (!isset($this->_isPlugin)) {
|
||||
$this->_isPlugin = !$this->isCtor() && !$this->isPrivate() && !$this->isStatic();
|
||||
}
|
||||
return $this->_isPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is private.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if private, else `false`.
|
||||
*/
|
||||
public function isPrivate() {
|
||||
if (!isset($this->_isPrivate)) {
|
||||
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
|
||||
}
|
||||
return $this->_isPrivate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is *not* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isStatic() {
|
||||
if (isset($this->_isStatic)) {
|
||||
return $this->_isStatic;
|
||||
}
|
||||
|
||||
$public = !$this->isPrivate();
|
||||
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
|
||||
|
||||
// set in cases where it isn't explicitly stated
|
||||
if ($public && !$result) {
|
||||
if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) {
|
||||
foreach (Entry::getEntries($this->source) as $entry) {
|
||||
$entry = new Entry($entry, $this->source);
|
||||
if ($entry->getName() == $parent) {
|
||||
$result = !$entry->isCtor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
$this->_isStatic = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the entry's line number.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {number} The entry's line number.
|
||||
*/
|
||||
public function getLineNumber() {
|
||||
if (!isset($this->_lineNumber)) {
|
||||
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
|
||||
$this->_lineNumber = count(array_pop($lines)) + 1;
|
||||
}
|
||||
return $this->_lineNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `member` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `member` data.
|
||||
*/
|
||||
public function getMembers( $index = null ) {
|
||||
if (!isset($this->_members)) {
|
||||
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
}
|
||||
$this->_members = $result;
|
||||
}
|
||||
return $index !== null
|
||||
? @$this->_members[$index]
|
||||
: $this->_members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `name` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's `name` data.
|
||||
*/
|
||||
public function getName() {
|
||||
if (isset($this->_name)) {
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = array_shift(explode('(', $this->getCall()));
|
||||
}
|
||||
$this->_name = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `param` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array} The entry's `param` data.
|
||||
*/
|
||||
public function getParams( $index = null ) {
|
||||
if (!isset($this->_params)) {
|
||||
preg_match_all('#\*[\t ]*@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $matchTuples);
|
||||
$matchTuples = array_filter(array_slice($matchTuples, 1));
|
||||
$result = array();
|
||||
|
||||
if (count($matchTuples)) {
|
||||
foreach ($matchTuples as $tupleKey => $tuple) {
|
||||
foreach ($tuple as $key => $value) {
|
||||
if (!isset($result[$key])) {
|
||||
$result[$key] = array();
|
||||
}
|
||||
$result[$key][] = $tupleKey
|
||||
? trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value))
|
||||
: trim($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_params = $result;
|
||||
}
|
||||
return $index !== null
|
||||
? @$this->_params[$index]
|
||||
: $this->_params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `returns` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's `returns` data.
|
||||
*/
|
||||
public function getReturns() {
|
||||
if (isset($this->_returns)) {
|
||||
return $this->_returns;
|
||||
}
|
||||
|
||||
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = array_map('trim', array_slice($result, 1));
|
||||
$result[0] = str_replace('|', ', ', $result[0]);
|
||||
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
|
||||
}
|
||||
$this->_returns = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the entry's `type` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {string} The entry's `type` data.
|
||||
*/
|
||||
public function getType() {
|
||||
if (isset($this->_type)) {
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim($result[1]);
|
||||
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
|
||||
$result = ucfirst($result);
|
||||
}
|
||||
} else {
|
||||
$result = $this->isFunction() ? 'Function' : 'unknown';
|
||||
}
|
||||
$this->_type = $result;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
567
vendor/docdown/src/DocDown/MarkdownGenerator.php
vendored
Normal file
@@ -0,0 +1,567 @@
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__) . "/Entry.php");
|
||||
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries.
|
||||
*/
|
||||
class MarkdownGenerator {
|
||||
|
||||
/**
|
||||
* The HTML for the close tag.
|
||||
*
|
||||
* @static
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $closeTag = "\n<!-- /div -->\n";
|
||||
|
||||
/**
|
||||
* An array of JSDoc entries.
|
||||
*
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type Array
|
||||
*/
|
||||
public $entries = array();
|
||||
|
||||
/**
|
||||
* The HTML for the open tag.
|
||||
*
|
||||
* @static
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $openTag = "\n<!-- div -->\n";
|
||||
|
||||
/**
|
||||
* An options array used to configure the generator.
|
||||
*
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type Array
|
||||
*/
|
||||
public $options = array();
|
||||
|
||||
/**
|
||||
* The file's source code.
|
||||
*
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $source = '';
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The MarkdownGenerator constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {string} $source The source code to parse.
|
||||
* @param {Array} $options The options array.
|
||||
*/
|
||||
public function __construct( $source, $options = array() ) {
|
||||
// juggle arguments
|
||||
if (is_array($source)) {
|
||||
$options = $source;
|
||||
} else {
|
||||
$options['source'] = $source;
|
||||
}
|
||||
if (isset($options['source']) && realpath($options['source'])) {
|
||||
$options['path'] = $options['source'];
|
||||
}
|
||||
if (isset($options['path'])) {
|
||||
preg_match('/(?<=\.)[a-z]+$/', $options['path'], $ext);
|
||||
$options['source'] = file_get_contents($options['path']);
|
||||
$ext = array_pop($ext);
|
||||
|
||||
if (!isset($options['lang']) && $ext) {
|
||||
$options['lang'] = $ext;
|
||||
}
|
||||
if (!isset($options['title'])) {
|
||||
$options['title'] = ucfirst(basename($options['path'])) . ' API documentation';
|
||||
}
|
||||
}
|
||||
if (!isset($options['lang'])) {
|
||||
$options['lang'] = 'js';
|
||||
}
|
||||
if (!isset($options['toc'])) {
|
||||
$options['toc'] = 'properties';
|
||||
}
|
||||
|
||||
$this->options = $options;
|
||||
$this->source = str_replace(PHP_EOL, "\n", $options['source']);
|
||||
$this->entries = Entry::getEntries($this->source);
|
||||
|
||||
foreach ($this->entries as $index => $value) {
|
||||
$this->entries[$index] = new Entry($value, $this->source, $options['lang']);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Performs common string formatting operations.
|
||||
*
|
||||
* @private
|
||||
* @static
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {string} $string The string to format.
|
||||
* @returns {string} The formatted string.
|
||||
*/
|
||||
private static function format( $string ) {
|
||||
$counter = 0;
|
||||
|
||||
// tokenize inline code snippets
|
||||
preg_match_all('/`[^`]+`/', $string, $tokenized);
|
||||
$tokenized = $tokenized[0];
|
||||
foreach ($tokenized as $snippet) {
|
||||
$string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
|
||||
}
|
||||
|
||||
// italicize parentheses
|
||||
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
|
||||
|
||||
// mark numbers as inline code
|
||||
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||
|
||||
// detokenize inline code snippets
|
||||
$counter = 0;
|
||||
foreach ($tokenized as $snippet) {
|
||||
$string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
|
||||
}
|
||||
|
||||
return trim($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a string by replacing named tokens with matching assoc. array values.
|
||||
*
|
||||
* @private
|
||||
* @static
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {string} $string The string to modify.
|
||||
* @param {Array|Object} $object The template object.
|
||||
* @returns {string} The modified string.
|
||||
*/
|
||||
private static function interpolate( $string, $object ) {
|
||||
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
|
||||
$tokens = array_unique(array_pop($tokens));
|
||||
|
||||
foreach ($tokens as $token) {
|
||||
$pattern = '/#\{' . preg_replace('/([.*+?^${}()|[\]\\\])/', '\\\$1', $token) . '\}/';
|
||||
$replacement = '';
|
||||
|
||||
if (is_object($object)) {
|
||||
preg_match('/\(([^)]+?)\)$/', $token, $args);
|
||||
$args = preg_split('/,\s*/', array_pop($args));
|
||||
$method = 'get' . ucfirst(preg_replace('/\([^)]+?\)$/', '', $token));
|
||||
|
||||
if (method_exists($object, $method)) {
|
||||
$replacement = (string) call_user_func_array(array($object, $method), $args);
|
||||
} else if (isset($object->{$token})) {
|
||||
$replacement = (string) $object->{$token};
|
||||
}
|
||||
} else if (isset($object[$token])) {
|
||||
$replacement = (string) $object[$token];
|
||||
}
|
||||
$string = preg_replace($pattern, trim($replacement), $string);
|
||||
}
|
||||
return MarkdownGenerator::format($string);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Adds the given `$entries` to the `$result` array.
|
||||
*
|
||||
* @private
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {Array} $result The result array to modify.
|
||||
* @param {Array} $entries The entries to add to the `$result`.
|
||||
*/
|
||||
private function addEntries( &$result, $entries ) {
|
||||
foreach ($entries as $entry) {
|
||||
// skip aliases
|
||||
if ($entry->isAlias()) {
|
||||
continue;
|
||||
}
|
||||
// name and description
|
||||
array_push(
|
||||
$result,
|
||||
$this->openTag,
|
||||
MarkdownGenerator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [Ⓢ](#{href} \"View in source\") [Ⓣ][1]\n\n#{desc}", $entry)
|
||||
);
|
||||
|
||||
// @alias
|
||||
if (count($aliases = $entry->getAliases())) {
|
||||
array_push($result, '', '#### Aliases');
|
||||
foreach ($aliases as $index => $alias) {
|
||||
$aliases[$index] = $alias->getName();
|
||||
}
|
||||
$result[] = '*' . implode(', ', $aliases) . '*';
|
||||
}
|
||||
// @param
|
||||
if (count($params = $entry->getParams())) {
|
||||
array_push($result, '', '#### Arguments');
|
||||
foreach ($params as $index => $param) {
|
||||
$result[] = MarkdownGenerator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
|
||||
'desc' => $param[2],
|
||||
'name' => $param[1],
|
||||
'num' => $index + 1,
|
||||
'type' => preg_replace('/(?<!\\\)(\*)/', '\\\$1', $param[0])
|
||||
));
|
||||
}
|
||||
}
|
||||
// @returns
|
||||
if (count($returns = $entry->getReturns())) {
|
||||
array_push(
|
||||
$result, '',
|
||||
'#### Returns',
|
||||
MarkdownGenerator::interpolate('(#{type}): #{desc}', array(
|
||||
'desc' => $returns[1],
|
||||
'type' => preg_replace('/(?<!\\\)(\*)/', '\\\$1', $returns[0])
|
||||
))
|
||||
);
|
||||
}
|
||||
// @example
|
||||
if ($example = $entry->getExample()) {
|
||||
array_push($result, '', '#### Example', $example);
|
||||
}
|
||||
array_push($result, "\n* * *", $this->closeTag);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the entry's hash used to navigate the documentation.
|
||||
*
|
||||
* @private
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @param {string} $member The name of the member.
|
||||
* @returns {string} The url hash.
|
||||
*/
|
||||
private function getHash( $entry, $member = '' ) {
|
||||
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
|
||||
$member = !$member ? $entry->getMembers(0) : $member;
|
||||
|
||||
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
|
||||
$result = preg_replace('/\(\[|\[\]/', '', $result);
|
||||
$result = preg_replace('/[\t =|\'"{}.()\]]/', '', $result);
|
||||
$result = preg_replace('/[[#,]/', '-', $result);
|
||||
return strtolower($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the entry's url for the specific line number.
|
||||
*
|
||||
* @private
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @returns {string} The url.
|
||||
*/
|
||||
private function getLineUrl( $entry ) {
|
||||
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||
return $this->options['url'] . '#L' . $entry->getLineNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the character used to separate the entry's name from its member.
|
||||
*
|
||||
* @private
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @returns {string} The separator.
|
||||
*/
|
||||
private function getSeparator( $entry ) {
|
||||
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||
return $entry->isPlugin() ? '.prototype.' : '.';
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries.
|
||||
*
|
||||
* @memberOf MarkdownGenerator
|
||||
* @returns {string} The rendered Markdown.
|
||||
*/
|
||||
public function generate() {
|
||||
$api = array();
|
||||
$byCategory = $this->options['toc'] == 'categories';
|
||||
$categories = array();
|
||||
$closeTag = $this->closeTag;
|
||||
$compiling = false;
|
||||
$openTag = $this->openTag;
|
||||
$result = array('# ' . $this->options['title']);
|
||||
$toc = 'toc';
|
||||
|
||||
// initialize $api array
|
||||
foreach ($this->entries as $entry) {
|
||||
// skip invalid or private entries
|
||||
$name = $entry->getName();
|
||||
if (!$name || $entry->isPrivate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$members = $entry->getMembers();
|
||||
$members = count($members) ? $members : array('');
|
||||
|
||||
foreach ($members as $member) {
|
||||
// create api category arrays
|
||||
if ($member && !isset($api[$member])) {
|
||||
// create temporary entry to be replaced later
|
||||
$api[$member] = new stdClass;
|
||||
$api[$member]->static = array();
|
||||
$api[$member]->plugin = array();
|
||||
}
|
||||
|
||||
// append entry to api member
|
||||
if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
|
||||
!preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
|
||||
|
||||
// assign the real entry, replacing the temporary entry if it exist
|
||||
$member = ($member ? $member . ($entry->isPlugin() ? '#' : '.') : '') . $name;
|
||||
$entry->static = @$api[$member] ? $api[$member]->static : array();
|
||||
$entry->plugin = @$api[$member] ? $api[$member]->plugin : array();
|
||||
|
||||
$api[$member] = $entry;
|
||||
foreach ($entry->getAliases() as $alias) {
|
||||
$api[$member]->static[] = $alias;
|
||||
}
|
||||
}
|
||||
else if ($entry->isStatic()) {
|
||||
$api[$member]->static[] = $entry;
|
||||
foreach ($entry->getAliases() as $alias) {
|
||||
$api[$member]->static[] = $alias;
|
||||
}
|
||||
}
|
||||
else if (!$entry->isCtor()) {
|
||||
$api[$member]->plugin[] = $entry;
|
||||
foreach ($entry->getAliases() as $alias) {
|
||||
$api[$member]->plugin[] = $alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add properties to each entry
|
||||
foreach ($api as $entry) {
|
||||
$entry->hash = $this->getHash($entry);
|
||||
$entry->href = $this->getLineUrl($entry);
|
||||
|
||||
$member = $entry->getMembers(0);
|
||||
$member = ($member ? $member . $this->getSeparator($entry) : '') . $entry->getName();
|
||||
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
|
||||
|
||||
// add properties to static and plugin sub-entries
|
||||
foreach (array('static', 'plugin') as $kind) {
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$subentry->hash = $this->getHash($subentry);
|
||||
$subentry->href = $this->getLineUrl($subentry);
|
||||
$subentry->member = $member;
|
||||
$subentry->separator = $this->getSeparator($subentry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// custom sort for root level entries
|
||||
// TODO: see how well it handles deeper namespace traversal
|
||||
function sortCompare($a, $b) {
|
||||
$score = array( 'a' => 0, 'b' => 0);
|
||||
foreach (array( 'a' => $a, 'b' => $b) as $key => $value) {
|
||||
// capitalized properties are last
|
||||
if (preg_match('/[#.][A-Z]/', $value)) {
|
||||
$score[$key] = 0;
|
||||
}
|
||||
// lowercase prototype properties are next to last
|
||||
else if (preg_match('/#[a-z]/', $value)) {
|
||||
$score[$key] = 1;
|
||||
}
|
||||
// lowercase static properties next to first
|
||||
else if (preg_match('/\.[a-z]/', $value)) {
|
||||
$score[$key] = 2;
|
||||
}
|
||||
// root properties are first
|
||||
else if (preg_match('/^[^#.]+$/', $value)) {
|
||||
$score[$key] = 3;
|
||||
}
|
||||
}
|
||||
$score = $score['b'] - $score['a'];
|
||||
return $score ? $score : strcasecmp($a, $b);
|
||||
}
|
||||
|
||||
uksort($api, 'sortCompare');
|
||||
|
||||
// sort static and plugin sub-entries
|
||||
foreach ($api as $entry) {
|
||||
foreach (array('static', 'plugin') as $kind) {
|
||||
$sortBy = array( 'a' => array(), 'b' => array(), 'c' => array() );
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$name = $subentry->getName();
|
||||
// functions w/o ALL-CAPs names are last
|
||||
$sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
|
||||
// ALL-CAPs properties first
|
||||
$sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
|
||||
// lowercase alphanumeric sort
|
||||
$sortBy['c'][] = strtolower($name);
|
||||
}
|
||||
array_multisort($sortBy['a'], SORT_ASC, $sortBy['b'], SORT_DESC, $sortBy['c'], SORT_ASC, $entry->{$kind});
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// add categories
|
||||
foreach ($api as $entry) {
|
||||
$categories[$entry->getCategory()][] = $entry;
|
||||
foreach (array('static', 'plugin') as $kind) {
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$categories[$subentry->getCategory()][] = $subentry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sort categories
|
||||
ksort($categories);
|
||||
|
||||
foreach(array('Methods', 'Properties') as $category) {
|
||||
if (isset($categories[$category])) {
|
||||
$entries = $categories[$category];
|
||||
unset($categories[$category]);
|
||||
$categories[$category] = $entries;
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// compile TOC
|
||||
$result[] = $openTag;
|
||||
|
||||
// compile TOC by categories
|
||||
if ($byCategory) {
|
||||
foreach ($categories as $category => $entries) {
|
||||
if ($compiling) {
|
||||
$result[] = $closeTag;
|
||||
} else {
|
||||
$compiling = true;
|
||||
}
|
||||
// assign TOC hash
|
||||
if (count($result) == 2) {
|
||||
$toc = $category;
|
||||
}
|
||||
// add category
|
||||
array_push(
|
||||
$result,
|
||||
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $category . '`'
|
||||
);
|
||||
// add entries
|
||||
foreach ($entries as $entry) {
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
// compile TOC by namespace
|
||||
else {
|
||||
foreach ($api as $entry) {
|
||||
if ($compiling) {
|
||||
$result[] = $closeTag;
|
||||
} else {
|
||||
$compiling = true;
|
||||
}
|
||||
$member = $entry->member . $entry->getName();
|
||||
|
||||
// assign TOC hash
|
||||
if (count($result) == 2) {
|
||||
$toc = $member;
|
||||
}
|
||||
// add root entry
|
||||
array_push(
|
||||
$result,
|
||||
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
|
||||
MarkdownGenerator::interpolate('* [`' . $member . '`](##{hash})', $entry)
|
||||
);
|
||||
|
||||
// add static and plugin sub-entries
|
||||
foreach (array('static', 'plugin') as $kind) {
|
||||
if ($kind == 'plugin' && count($entry->plugin)) {
|
||||
array_push(
|
||||
$result,
|
||||
$closeTag,
|
||||
$openTag,
|
||||
'## `' . $member . ($entry->isCtor() ? '.prototype`' : '`')
|
||||
);
|
||||
}
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$subentry->member = $member;
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
array_push($result, $closeTag, $closeTag);
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// compile content
|
||||
$compiling = false;
|
||||
$result[] = $openTag;
|
||||
|
||||
if ($byCategory) {
|
||||
foreach ($categories as $category => $entries) {
|
||||
if ($compiling) {
|
||||
$result[] = $closeTag;
|
||||
} else {
|
||||
$compiling = true;
|
||||
}
|
||||
if ($category != 'Methods' && $category != 'Properties') {
|
||||
$category = '“' . $category . '” Methods';
|
||||
}
|
||||
array_push($result, $openTag, '## `' . $category . '`');
|
||||
$this->addEntries($result, $entries);
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($api as $entry) {
|
||||
// skip aliases
|
||||
if ($entry->isAlias()) {
|
||||
continue;
|
||||
}
|
||||
if ($compiling) {
|
||||
$result[] = $closeTag;
|
||||
} else {
|
||||
$compiling = true;
|
||||
}
|
||||
// add root entry name
|
||||
$member = $entry->member . $entry->getName();
|
||||
array_push($result, $openTag, '## `' . $member . '`');
|
||||
|
||||
foreach (array($entry, 'static', 'plugin') as $kind) {
|
||||
$subentries = is_string($kind) ? $entry->{$kind} : array($kind);
|
||||
|
||||
// add sub-entry name
|
||||
if ($kind != 'static' && $entry->getType() != 'Object' &&
|
||||
count($subentries) && $subentries[0] != $kind) {
|
||||
if ($kind == 'plugin') {
|
||||
$result[] = $closeTag;
|
||||
}
|
||||
array_push(
|
||||
$result,
|
||||
$openTag,
|
||||
'## `' . $member . ($kind == 'plugin' ? '.prototype`' : '`')
|
||||
);
|
||||
}
|
||||
$this->addEntries($result, $subentries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// close tags add TOC link reference
|
||||
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
|
||||
|
||||
// cleanup whitespace
|
||||
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
|
||||
}
|
||||
}
|
||||
?>
|
||||
195
vendor/dojo/LICENSE
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
Dojo is available under *either* the terms of the modified BSD license *or* the
|
||||
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
|
||||
license to receive this code under (except as noted in per-module LICENSE
|
||||
files). Some modules may not be the copyright of the Dojo Foundation. These
|
||||
modules contain explicit declarations of copyright in both the LICENSE files in
|
||||
the directories in which they reside and in the code itself. No external
|
||||
contributions are allowed under licenses which are fundamentally incompatible
|
||||
with the AFL or BSD licenses that Dojo is distributed under.
|
||||
|
||||
The text of the AFL and BSD licenses is reproduced below.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The "New" BSD License:
|
||||
**********************
|
||||
|
||||
Copyright (c) 2005-2013, The Dojo Foundation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the Dojo Foundation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The Academic Free License, v. 2.1:
|
||||
**********************************
|
||||
|
||||
This Academic Free License (the "License") applies to any original work of
|
||||
authorship (the "Original Work") whose owner (the "Licensor") has placed the
|
||||
following notice immediately following the copyright notice for the Original
|
||||
Work:
|
||||
|
||||
Licensed under the Academic Free License version 2.1
|
||||
|
||||
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
|
||||
following:
|
||||
|
||||
a) to reproduce the Original Work in copies;
|
||||
|
||||
b) to prepare derivative works ("Derivative Works") based upon the Original
|
||||
Work;
|
||||
|
||||
c) to distribute copies of the Original Work and Derivative Works to the
|
||||
public;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) Grant of Patent License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
|
||||
claims owned or controlled by the Licensor that are embodied in the Original
|
||||
Work as furnished by the Licensor, to make, use, sell and offer for sale the
|
||||
Original Work and Derivative Works.
|
||||
|
||||
3) Grant of Source Code License. The term "Source Code" means the preferred
|
||||
form of the Original Work for making modifications to it and all available
|
||||
documentation describing how to modify the Original Work. Licensor hereby
|
||||
agrees to provide a machine-readable copy of the Source Code of the Original
|
||||
Work along with each copy of the Original Work that Licensor distributes.
|
||||
Licensor reserves the right to satisfy this obligation by placing a
|
||||
machine-readable copy of the Source Code in an information repository
|
||||
reasonably calculated to permit inexpensive and convenient access by You for as
|
||||
long as Licensor continues to distribute the Original Work, and by publishing
|
||||
the address of that information repository in a notice immediately following
|
||||
the copyright notice that applies to the Original Work.
|
||||
|
||||
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
|
||||
of any contributors to the Original Work, nor any of their trademarks or
|
||||
service marks, may be used to endorse or promote products derived from this
|
||||
Original Work without express prior written permission of the Licensor. Nothing
|
||||
in this License shall be deemed to grant any rights to trademarks, copyrights,
|
||||
patents, trade secrets or any other intellectual property of Licensor except as
|
||||
expressly stated herein. No patent license is granted to make, use, sell or
|
||||
offer to sell embodiments of any patent claims other than the licensed claims
|
||||
defined in Section 2. No right is granted to the trademarks of Licensor even if
|
||||
such marks are included in the Original Work. Nothing in this License shall be
|
||||
interpreted to prohibit Licensor from licensing under different terms from this
|
||||
License any Original Work that Licensor otherwise would have a right to
|
||||
license.
|
||||
|
||||
5) This section intentionally omitted.
|
||||
|
||||
6) Attribution Rights. You must retain, in the Source Code of any Derivative
|
||||
Works that You create, all copyright, patent or trademark notices from the
|
||||
Source Code of the Original Work, as well as any notices of licensing and any
|
||||
descriptive text identified therein as an "Attribution Notice." You must cause
|
||||
the Source Code for any Derivative Works that You create to carry a prominent
|
||||
Attribution Notice reasonably calculated to inform recipients that You have
|
||||
modified the Original Work.
|
||||
|
||||
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
|
||||
the copyright in and to the Original Work and the patent rights granted herein
|
||||
by Licensor are owned by the Licensor or are sublicensed to You under the terms
|
||||
of this License with the permission of the contributor(s) of those copyrights
|
||||
and patent rights. Except as expressly stated in the immediately proceeding
|
||||
sentence, the Original Work is provided under this License on an "AS IS" BASIS
|
||||
and WITHOUT WARRANTY, either express or implied, including, without limitation,
|
||||
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
|
||||
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
|
||||
license to Original Work is granted hereunder except under this disclaimer.
|
||||
|
||||
8) Limitation of Liability. Under no circumstances and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise, shall the
|
||||
Licensor be liable to any person for any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License
|
||||
or the use of the Original Work including, without limitation, damages for loss
|
||||
of goodwill, work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses. This limitation of liability shall not
|
||||
apply to liability for death or personal injury resulting from Licensor's
|
||||
negligence to the extent applicable law prohibits such limitation. Some
|
||||
jurisdictions do not allow the exclusion or limitation of incidental or
|
||||
consequential damages, so this exclusion and limitation may not apply to You.
|
||||
|
||||
9) Acceptance and Termination. If You distribute copies of the Original Work or
|
||||
a Derivative Work, You must make a reasonable effort under the circumstances to
|
||||
obtain the express assent of recipients to the terms of this License. Nothing
|
||||
else but this License (or another written agreement between Licensor and You)
|
||||
grants You permission to create Derivative Works based upon the Original Work
|
||||
or to exercise any of the rights granted in Section 1 herein, and any attempt
|
||||
to do so except under the terms of this License (or another written agreement
|
||||
between Licensor and You) is expressly prohibited by U.S. copyright law, the
|
||||
equivalent laws of other countries, and by international treaty. Therefore, by
|
||||
exercising any of the rights granted to You in Section 1 herein, You indicate
|
||||
Your acceptance of this License and all of its terms and conditions.
|
||||
|
||||
10) Termination for Patent Action. This License shall terminate automatically
|
||||
and You may no longer exercise any of the rights granted to You by this License
|
||||
as of the date You commence an action, including a cross-claim or counterclaim,
|
||||
against Licensor or any licensee alleging that the Original Work infringes a
|
||||
patent. This termination provision shall not apply for an action alleging
|
||||
patent infringement by combinations of the Original Work with other software or
|
||||
hardware.
|
||||
|
||||
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
|
||||
License may be brought only in the courts of a jurisdiction wherein the
|
||||
Licensor resides or in which Licensor conducts its primary business, and under
|
||||
the laws of that jurisdiction excluding its conflict-of-law provisions. The
|
||||
application of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any use of the Original Work outside the
|
||||
scope of this License or after its termination shall be subject to the
|
||||
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
|
||||
seq., the equivalent laws of other countries, and international treaty. This
|
||||
section shall survive the termination of this License.
|
||||
|
||||
12) Attorneys Fees. In any action to enforce the terms of this License or
|
||||
seeking damages relating thereto, the prevailing party shall be entitled to
|
||||
recover its costs and expenses, including, without limitation, reasonable
|
||||
attorneys' fees and costs incurred in connection with such action, including
|
||||
any appeal of such action. This section shall survive the termination of this
|
||||
License.
|
||||
|
||||
13) Miscellaneous. This License represents the complete agreement concerning
|
||||
the subject matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent necessary to
|
||||
make it enforceable.
|
||||
|
||||
14) Definition of "You" in This License. "You" throughout this License, whether
|
||||
in upper or lower case, means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License. For legal
|
||||
entities, "You" includes any entity that controls, is controlled by, or is
|
||||
under common control with you. For purposes of this definition, "control" means
|
||||
(i) the power, direct or indirect, to cause the direction or management of such
|
||||
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
||||
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
||||
entity.
|
||||
|
||||
15) Right to Use. You may use the Original Work in all ways not otherwise
|
||||
restricted or conditioned by this License or by law, and Licensor promises not
|
||||
to interfere with or be responsible for such uses by You.
|
||||
|
||||
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
|
||||
Permission is hereby granted to copy and distribute this license without
|
||||
modification. This license may not be modified without the express written
|
||||
permission of its copyright owner.
|
||||
1997
vendor/dojo/dojo.js
vendored
Normal file
0
vendor/firebug-lite/license.txt
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/blank.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/buttonBg.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
0
vendor/firebug-lite/skin/xp/buttonBgHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
0
vendor/firebug-lite/skin/xp/debugger.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/detach.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
vendor/firebug-lite/skin/xp/detachHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |