Compare commits

..

155 Commits

Author SHA1 Message Date
John-David Dalton
e05a40bb16 Bump to v4.14.0. 2016-07-28 23:12:51 -07:00
John-David Dalton
c73bb67486 Rebuild lodash and docs. 2016-07-28 23:12:40 -07:00
John-David Dalton
3ad0cbc86d Minor _.includes test cleanup. 2016-07-24 08:38:09 -07:00
John-David Dalton
6402af7db9 Use String#slice instead of String#indexOf for _.endsWith and _.startsWith. 2016-07-24 08:38:09 -07:00
John-David Dalton
6a41a79ded Move switch optimization to negate. 2016-07-23 23:33:30 -07:00
John-David Dalton
fbd9a804a9 Use negate in reject. 2016-07-23 22:11:34 -07:00
John-David Dalton
694e1175a1 Remove arity hint from lazy reject. 2016-07-23 22:11:34 -07:00
John-David Dalton
80dbd4cbfa Add props param to basePickBy. 2016-07-23 22:11:34 -07:00
John-David Dalton
d459f4ac7c Add more arity hints. 2016-07-23 22:11:34 -07:00
John-David Dalton
2c5c4bfbea Remove switch statement from baseRest. 2016-07-22 21:06:15 -07:00
John-David Dalton
a1a68bb5d7 Update async to 2.0.1 and request to 2.74.0. 2016-07-22 18:51:57 -07:00
John-David Dalton
984a10c1b1 Add isConcatSpreadable to flatten methods. 2016-07-22 18:51:57 -07:00
John-David Dalton
3c4c06cb5e Update benchmark.js to 2.1.1. 2016-07-21 08:39:58 -07:00
John-David Dalton
8d28a5ca3f Minor var palcement nit. 2016-07-19 17:58:58 -07:00
John-David Dalton
801c4a56c3 Remove old browser addListener helper. 2016-07-19 17:58:26 -07:00
John-David Dalton
ea000e6ce7 Style nit in sauce helper. 2016-07-19 17:58:26 -07:00
John-David Dalton
6723cdfa07 Update tested firefox version in sauce. 2016-07-18 11:29:43 -07:00
John-David Dalton
2cf10711f5 Remove toc links from site. 2016-07-18 09:01:25 -07:00
John-David Dalton
bde171e947 Update doc options. 2016-07-18 09:01:25 -07:00
John-David Dalton
2696615523 Update docdown to 0.6.1 and jscs to 3.0.7. 2016-07-18 09:01:13 -07:00
John-David Dalton
f98028d1d8 Cleanup doc notes. [ci skip] 2016-07-17 21:33:41 -07:00
John-David Dalton
97475fc365 Remove checkGlobal helper. 2016-07-17 20:10:01 -07:00
John-David Dalton
ea7aa52ea3 Cleanup “coerce arguments” bits of function descriptions. 2016-07-17 20:10:01 -07:00
John-David Dalton
ec4ae5978b Add baseRest. 2016-07-17 20:10:01 -07:00
Samuel Greene
90d73143e1 Don't rearg zipObjectDeep (#2503) 2016-07-17 20:10:01 -07:00
John-David Dalton
249f0cd72c Add _.isEqual test for transitive equivalence. 2016-07-17 20:10:01 -07:00
John-David Dalton
232cc1ab34 Minor comment typo. [ci skip] 2016-07-17 20:10:01 -07:00
Greenkeeper
2cea31cb1b Update async to version 2.0.0 and coveralls to 2.11.11. 2016-07-17 20:10:01 -07:00
John-David Dalton
02c4d60861 Remove thisGlobal use. 2016-07-17 20:10:01 -07:00
John-David Dalton
8c9073308a Add back excused Underscore isSet test for IE11. 2016-07-17 20:10:01 -07:00
John-David Dalton
8cb5455671 Add fp.zipAll. 2016-07-17 20:10:00 -07:00
John-David Dalton
8bc44e3bff Update qunit-extras to 2.1.0. 2016-07-17 20:10:00 -07:00
John-David Dalton
73f84baaec Add more excused underscore debounce tests. 2016-07-17 20:10:00 -07:00
John-David Dalton
d3acace1c4 Update uglify options to disable negate_iffe. 2016-07-17 20:10:00 -07:00
Greenkeeper
7f3539d001 Update request to 2.73.0. 2016-07-17 20:10:00 -07:00
John-David Dalton
3ef19f1ab1 Add lodash-webpack-plugin reference to readme. [ci skip] 2016-07-17 20:10:00 -07:00
John-David Dalton
749b2db846 Update jquery to 3.1.0 and marky-markdown to 7.0.2.
chore(package): update jquery to version 3.1.0 (#2483)

https://greenkeeper.io/
2016-07-17 20:10:00 -07:00
John-David Dalton
a3e99b5d89 Use optional-dev-dependency. 2016-07-17 20:10:00 -07:00
John-David Dalton
dbbb3fbb55 Add comments and cleanup build-site.js. 2016-07-17 20:10:00 -07:00
John-David Dalton
6eeac45d23 Update vendors. 2016-07-17 20:10:00 -07:00
John-David Dalton
5669cc0a0b Remove hrs. 2016-07-17 20:09:59 -07:00
John-David Dalton
d986901a1c Narrow header anchor selector. 2016-07-17 20:09:59 -07:00
John-David Dalton
5394bbf06a Make newline formatting explicit. 2016-07-17 20:09:59 -07:00
John-David Dalton
d7b2f922b5 Remove "v" prefix from version. 2016-07-17 20:09:59 -07:00
John-David Dalton
9ab55443eb Fix _.isEqualWith and _.isMatchWith test fails. 2016-07-17 20:09:59 -07:00
John-David Dalton
67c7a43e6f Move marky-markdown to an optional dep. 2016-07-17 20:09:59 -07:00
Alex Wachira
26a4bfb838 Make "lodash/fp" doc link point to untagged branch. [ci skip] 2016-07-17 20:09:59 -07:00
John-David Dalton
e7a16b2e64 Make "Contributing" doc link point to untagged branch. [ci skip] 2016-07-17 20:09:45 -07:00
John-David Dalton
a5612ed668 Update uglify-js to 2.7.0 and jscs to 3.0.6. 2016-07-17 20:09:03 -07:00
John-David Dalton
f55d15692b Remove more markymark meta data. 2016-07-17 20:08:13 -07:00
John-David Dalton
107994859b Remove markymark links from h4s. 2016-07-17 20:08:13 -07:00
John-David Dalton
a8d3689061 Ensure _.isEqual works more consistently with circular references. 2016-07-17 20:08:12 -07:00
Y-Less
4fb4ec5328 Links to creation equivalents for in-place modification functions. (#2468)
See issue #2467
2016-07-17 20:08:12 -07:00
John-David Dalton
9bc8519656 Cleanup build-site script. 2016-07-17 20:08:12 -07:00
Benjamin Tan
af36d2d8e5 Ensure proper tags are generated. (#2465) 2016-07-17 20:08:12 -07:00
Zack Hall
6b0069f10f Add doc-site build script (#2461) 2016-07-17 20:08:12 -07:00
John-David Dalton
a64b629333 Combine _.isMatch and _.matches tests. 2016-06-29 12:31:07 -07:00
John-David Dalton
fc4cc977ed Remove backticks from package name. 2016-06-29 12:31:07 -07:00
John-David Dalton
7483520c8c Cleanup .gitignore. 2016-06-29 12:31:07 -07:00
John-David Dalton
5d18fb8c70 Simplify uglify options. 2016-06-29 12:31:07 -07:00
John-David Dalton
1163bfac5c Add _.conformsTo tests. 2016-06-29 12:31:07 -07:00
John-David Dalton
d643bbd7e4 Add conformsTo to lodash doc block. [ci skip] 2016-06-26 09:55:47 -07:00
Dan J Miller
32158935f8 Change second param of _.invokeMap as path in docs. [ci skip] 2016-06-24 19:41:01 -07:00
John-David Dalton
50bf1ea784 Ensure _.first supports shortcut fusion. [closes #2447] 2016-06-24 07:05:27 -07:00
Greenkeeper
fa29123c5e Update deps. 2016-06-22 07:15:55 -07:00
John-David Dalton
314c652818 Update Chrome versions in sauce. 2016-06-22 07:15:45 -07:00
John-David Dalton
a3dd60370e Cleanup fp tests. 2016-06-18 22:31:45 -07:00
John-David Dalton
3d82567118 Add isEvenIndex helper to fp tests. 2016-06-18 22:31:45 -07:00
John-David Dalton
eaac5e02c0 Add fp.propertyOf test. 2016-06-18 21:59:56 -07:00
John-David Dalton
3bd5703bdb Downgrade QUnit for Backbone test support. 2016-06-18 21:30:38 -07:00
John-David Dalton
bf80a75474 Make fp.propertyOf and remap of fp.get. 2016-06-18 12:49:48 -07:00
John-David Dalton
bea7016223 Make fp.property and alias of fp.get. 2016-06-18 12:49:48 -07:00
John-David Dalton
c8ff2b4612 Update qunit to 2.0.0. 2016-06-18 12:49:48 -07:00
John-David Dalton
6c673cd19b Cleanup wrapper details helpers. 2016-06-18 12:49:47 -07:00
John-David Dalton
c1ae43e041 Update glob to 7.0.4 and markdown-doctest to 0.8.0. 2016-06-18 12:49:38 -07:00
Brandon Horst
9605072200 Formalize which value is picked by _.unionBy and _.unionWith to pick the result from the first array in which it occurs. 2016-06-18 12:47:44 -07:00
John-David Dalton
9cabc7c222 Ensute _.assignWith respects customizer results of undefined. [closes #2424] 2016-06-18 12:47:44 -07:00
Dan J Miller
b2b3391827 Fixed display of transforms param in overArgs docs. (#2422) 2016-06-18 12:47:43 -07:00
John-David Dalton
19e94b8889 Move split out functions. 2016-06-18 12:47:43 -07:00
John-David Dalton
4bee8c9ead Add docs for split out functions. [ci skip] 2016-06-18 12:47:43 -07:00
John-David Dalton
3f1ae77306 Assign pair[0] to a variable. 2016-06-18 12:47:43 -07:00
John-David Dalton
9f6d6d7b37 Remove isFlattenableIteratee predicate to resolve regression. [closes #2418] 2016-06-18 12:47:43 -07:00
John-David Dalton
adac412f58 Split out setWrapToString. 2016-06-18 12:47:43 -07:00
John-David Dalton
31ca38515a Make wrap functions more debuggable. 2016-06-18 12:47:43 -07:00
John-David Dalton
4a35929979 Cleanup wrap comments. 2016-06-18 12:47:42 -07:00
John-David Dalton
4a0610f107 Replace _.result use with _.get. 2016-06-18 12:47:42 -07:00
John-David Dalton
9a1b3d813a Rename wrapper function. 2016-06-18 12:47:42 -07:00
John-David Dalton
a7a4862491 Add missing context references. 2016-06-18 12:47:42 -07:00
John-David Dalton
5783536837 Update dojo to 1.11.2 and jquery to 3.0.0. 2016-06-18 12:47:42 -07:00
John-David Dalton
f8646d1a5d Minor space nit. 2016-06-10 12:19:28 -07:00
John-David Dalton
39bb7064e7 Minor doc nits. [ci skip] 2016-06-10 12:19:28 -07:00
John-David Dalton
388bf6934d Ensure fp.rearg returns a curried function. [closes #2413] 2016-06-08 23:55:25 -07:00
John-David Dalton
5122e9271c Add conforms to aliasToReal fp mapping. 2016-06-08 23:26:57 -07:00
John-David Dalton
32b36435f8 Add baseIsXyz helpers. 2016-06-08 10:53:49 -07:00
John-David Dalton
807ad48bbc Add compat note to addSetEntry. [ci skip] 2016-06-07 12:19:35 -07:00
John-David Dalton
b5842314b4 Make LARGE_ARRAY_SIZE check in stackSet align with others. 2016-06-07 08:33:48 -07:00
John-David Dalton
efb4db2b86 Isolate caches of tests. 2016-06-07 07:20:01 -07:00
John-David Dalton
ecbf8cd722 Add map cache test for changing values. 2016-06-07 07:08:33 -07:00
John-David Dalton
9992144130 Cleanup clone tests. 2016-06-07 07:08:14 -07:00
Greenkeeper
1f9cba6f53 Update markdown-doctest to 0.7.0. 2016-06-06 23:46:34 -07:00
John-David Dalton
2465a6bdbd Add fp.mergeAllWith test. 2016-06-06 23:46:06 -07:00
John-David Dalton
1a7199fd6b Cleanup fp tests. 2016-06-06 23:20:13 -07:00
John-David Dalton
57f0a4c6d7 Add conformsTo to fp aryMethod mapping. 2016-06-06 20:00:15 -07:00
John-David Dalton
138cf77916 Add fp.assignAllWith, fp.extendAllWith, and fp.mergeAllWith. 2016-06-06 19:58:51 -07:00
John-David Dalton
43d1ca89c2 Add _.ary and _.unary tests for this binding and minimum arg count. 2016-06-06 17:49:33 -07:00
John-David Dalton
51e619b18f Cleanup this binding test labels. 2016-06-06 17:48:35 -07:00
John-David Dalton
21df7426e2 Ensure _.divide and _.multiply return 1 when no arguments are specified. [closes #2405] 2016-06-06 15:58:24 -07:00
John-David Dalton
2f6b2ca0c7 Add back clearTimeout use for debounced.cancel. 2016-06-06 10:03:43 -07:00
John-David Dalton
cf1b9f9595 Update jscs to 3.0.4. 2016-06-05 22:55:57 -07:00
John-David Dalton
b0ec8339fa Cleanup and simplify doc examples. [ci skip] 2016-06-05 16:43:19 -07:00
John-David Dalton
762748684e Add _.conformsTo. 2016-06-05 15:08:39 -07:00
John-David Dalton
bdfd5880e9 Adjust freeExports and freeModule assignment. 2016-06-03 10:01:46 -07:00
John-David Dalton
9e55e5bcea Move root exposure back to the AMD branch. 2016-06-03 06:27:30 -07:00
John-David Dalton
887576e4a5 Update sauce-tunnel to 2.5.0. 2016-06-02 15:31:48 -07:00
John-David Dalton
ccd1d6ab29 Simplify _.isBuffer. 2016-06-02 14:48:25 -07:00
John-David Dalton
fcbb63ad60 Ensure helpers work when provided < 1 or > 1 argument. 2016-06-02 09:06:02 -07:00
John-David Dalton
1607e7914c Use faster C++ helpers when available. 2016-06-02 08:42:00 -07:00
John-David Dalton
68e98397ab Add matches to aliasToReal fp mapping. 2016-06-01 07:33:57 -07:00
John-David Dalton
3983d4f473 Update whereEq alias. 2016-06-01 00:19:19 -07:00
John-David Dalton
9eda959489 Another round of fp aliases. 2016-06-01 00:18:49 -07:00
John-David Dalton
4880f9923c Add fp.assignAll, fp.assignInAll, fp.defaultsAll, fp.defaultsDeepAll, and fp.mergeAll. 2016-06-01 00:02:23 -07:00
John-David Dalton
87e8a4290e Add more fp aliases. 2016-05-31 20:37:50 -07:00
John-David Dalton
fd96d59963 Add strict mode directive to a few more files. 2016-05-31 10:47:29 -07:00
John-David Dalton
1a1771f0b5 Align method descriptions with "This method" instead of "A method". [ci skip] 2016-05-31 10:46:57 -07:00
John-David Dalton
22ed53260f Add basePropertyOf helper. 2016-05-31 08:27:24 -07:00
John-David Dalton
77cf88a3bf Add util.pitch. 2016-05-30 22:00:20 -07:00
John-David Dalton
695d74d7c5 Add jsdocs to fp build modules. 2016-05-29 17:14:01 -07:00
John-David Dalton
a164735369 Shorten return statement descriptions for isXyz methods. [ci skip] 2016-05-29 17:14:00 -07:00
John-David Dalton
6ccea636b1 Remove argument number specifier in methodSpread note. [closes #2390] [ci skip] 2016-05-29 15:02:27 -07:00
John-David Dalton
0ccaf76661 Cleanup common lib docs. [ci skip] 2016-05-28 23:15:12 -07:00
John-David Dalton
593f6f9f86 Correct doc block for overArg helper in _baseConvert. [ci skip] 2016-05-28 10:16:28 -07:00
John-David Dalton
fbdda6df03 Add overArg helper. 2016-05-27 15:36:48 -07:00
John-David Dalton
a7dcce3e8d Simplify jsdoc arg signatures. 2016-05-27 14:38:32 -07:00
John-David Dalton
ee5718003b Simplify getSymbols fallback. 2016-05-27 13:46:00 -07:00
John-David Dalton
a43065ec08 Add baseGetTag helper. 2016-05-26 08:59:01 -07:00
John-David Dalton
1740ee91da Minor space nit. [ci skip] 2016-05-26 07:15:18 -07:00
John-David Dalton
90f95306f9 Make _.defaultTo return the defaultValue for NaN and nullish values. 2016-05-26 07:15:18 -07:00
John-David Dalton
0964f9175e Cleanup test descriptions with NaN. [ci skip] 2016-05-26 07:15:17 -07:00
John-David Dalton
dbde3f8826 Add link for sorted feature requests to contributing.md. [ci skip] 2016-05-26 07:15:17 -07:00
John-David Dalton
33e08baf3f Update umd doc note. [ci skip] 2016-05-26 07:15:12 -07:00
John-David Dalton
6e67ebab05 Cleanup _.defaultTo. 2016-05-25 08:46:14 -07:00
Mateo Calle
5fbc5303ff Added _.defaultTo. (#2381) 2016-05-24 21:35:56 -07:00
John-David Dalton
e582ad226a Use heavy round-tipped rightwards arrow instead of the plain rightwards arrow. 2016-05-24 21:19:50 -07:00
John-David Dalton
dfb71a3a50 Pop stacks when possible. 2016-05-24 21:15:23 -07:00
John-David Dalton
5355f4f25e Remove indexOfNaN in favor of baseFindIndex. 2016-05-24 12:42:14 -07:00
John-David Dalton
98c422d227 Avoid inspecting the entire key-value array when adding values to a stack. 2016-05-24 09:43:00 -07:00
John-David Dalton
e18b577d20 Add Map guard to stackSet. 2016-05-24 00:23:21 -07:00
John-David Dalton
7226df593e Clarify createSet doc description. [ci skip] 2016-05-24 00:22:59 -07:00
John-David Dalton
8a376f647e Cleanup iteratee arguments test labels. 2016-05-23 23:56:55 -07:00
John-David Dalton
050087f6c4 Cleanup "find" tests. 2016-05-23 23:56:23 -07:00
John-David Dalton
c67e347255 Make _.isEqual treat invalid dates as equiv. 2016-05-23 16:39:54 -07:00
John-David Dalton
3fdac985c7 Reduce createFind. 2016-05-23 16:39:04 -07:00
John-David Dalton
02ff3e6258 Remove "unique" mention from _.difference docs. [ci skip] [closes #2372] 2016-05-23 11:03:10 -07:00
John-David Dalton
65ce1b0bb5 Remove unnecessary type tag. [ci skip] 2016-05-23 10:07:25 -07:00
John-David Dalton
7e8528104b Increment package version to enable ci tests. 2016-05-23 10:07:25 -07:00
55 changed files with 4816 additions and 3940 deletions

View File

@@ -13,8 +13,8 @@ Feature requests should be submitted in the
[issue tracker](https://github.com/lodash/lodash/issues), with a description of [issue tracker](https://github.com/lodash/lodash/issues), with a description of
the expected behavior & use case, where theyll remain closed until sufficient interest, the expected behavior & use case, where theyll remain closed until sufficient interest,
[e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/), [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 has been [shown by the community](https://github.com/lodash/lodash/issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).
similar ones in the 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). [closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
## Pull Requests ## Pull Requests

6
.gitignore vendored
View File

@@ -1,9 +1,5 @@
.DS_Store .DS_Store
*.custom.*
*.log *.log
*.map
lodash.compat.min.js
coverage coverage
node_modules node_modules
.opt-in doc/*.html
.opt-out

View File

@@ -25,7 +25,7 @@ module.exports = {
'batchLog': _.noop, 'batchLog': _.noop,
'calculateLayout': _.noop, 'calculateLayout': _.noop,
'createApplication': _.noop, 'createApplication': _.noop,
'data': { 'user': 'mock'}, 'data': { 'user': 'mock' },
'mainText': '', 'mainText': '',
'renewToken': _.noop, 'renewToken': _.noop,
'sendMail': _.noop, 'sendMail': _.noop,

View File

@@ -1,9 +1,9 @@
# lodash v4.13.1 # lodash v4.14.0
[Site](https://lodash.com/) | [Site](https://lodash.com/) |
[Docs](https://lodash.com/docs) | [Docs](https://lodash.com/docs) |
[FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide) | [FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide) |
[Contributing](https://github.com/lodash/lodash/blob/4.13.1/.github/CONTRIBUTING.md) | [Contributing](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md) |
[Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") | [Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") |
[Code of Conduct](https://jquery.org/conduct/) | [Code of Conduct](https://jquery.org/conduct/) |
[Twitter](https://twitter.com/bestiejs) | [Twitter](https://twitter.com/bestiejs) |
@@ -20,11 +20,11 @@ $ lodash core -o ./dist/lodash.core.js
## Download ## Download
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.13.1/LICENSE) & supports [modern environments](#support).<br> Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.14.0/LICENSE) & supports [modern environments](#support).<br>
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one thats right for you. Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one thats right for you.
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.13.1/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.13.1/dist/lodash.core.min.js)) * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.14.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.14.0/dist/lodash.core.min.js))
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.13.1/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.13.1/dist/lodash.min.js)) * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.14.0/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.14.0/dist/lodash.min.js))
* [CDN copies](https://www.jsdelivr.com/projects/lodash) * [CDN copies](https://www.jsdelivr.com/projects/lodash)
## Why Lodash? ## Why Lodash?
@@ -41,6 +41,6 @@ numbers, objects, strings, etc. Lodashs modular methods are great for:
Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats. Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized) * [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
* [lodash-es](https://www.npmjs.com/package/lodash-es), [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash), & [lodash-webpack-plugin](https://www.npmjs.com/package/lodash-webpack-plugin)
* [lodash/fp](https://github.com/lodash/lodash/tree/npm/fp)
* [lodash-amd](https://www.npmjs.com/package/lodash-amd) * [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.13.1-npm/fp)

413
dist/lodash.core.js vendored
View File

@@ -13,12 +13,12 @@
var undefined; var undefined;
/** Used as the semantic version number. */ /** Used as the semantic version number. */
var VERSION = '4.13.1'; var VERSION = '4.14.0';
/** Used as the `TypeError` message for "Functions" methods. */ /** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function'; var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for wrapper metadata. */ /** Used to compose bitmasks for function metadata. */
var BIND_FLAG = 1, var BIND_FLAG = 1,
PARTIAL_FLAG = 32; PARTIAL_FLAG = 32;
@@ -57,24 +57,21 @@
'`': '&#96;' '`': '&#96;'
}; };
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */ /** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports; var freeExports = freeGlobal && typeof exports == 'object' && exports;
/** Detect free variable `module`. */ /** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module; var freeModule = freeExports && typeof module == 'object' && module;
/** Detect free variable `global` from Node.js. */
var freeGlobal = checkGlobal(typeof global == 'object' && global);
/** Detect free variable `self`. */
var freeSelf = checkGlobal(typeof self == 'object' && self);
/** Detect `this` as the global object. */
var thisGlobal = checkGlobal(typeof this == 'object' && this);
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || thisGlobal || Function('return this')();
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
@@ -113,6 +110,32 @@
return -1; return -1;
} }
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
/** /**
* The base implementation of `_.reduce` and `_.reduceRight`, without support * The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
@@ -151,17 +174,6 @@
}); });
} }
/**
* Checks if `value` is a global object.
*
* @private
* @param {*} value The value to check.
* @returns {null|Object} Returns `value` if it's a global object, else `null`.
*/
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
/** /**
* Used by `_.escape` to convert characters to HTML entities. * Used by `_.escape` to convert characters to HTML entities.
* *
@@ -169,9 +181,7 @@
* @param {string} chr The matched character to escape. * @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character. * @returns {string} Returns the escaped character.
*/ */
function escapeHtmlChar(chr) { var escapeHtmlChar = basePropertyOf(htmlEscapes);
return htmlEscapes[chr];
}
/** /**
* Checks if `value` is a host object in IE < 9. * Checks if `value` is a host object in IE < 9.
@@ -184,6 +194,20 @@
return false; return false;
} }
/**
* Creates a function that invokes `func` with its first argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** Used for built-in method references. */ /** Used for built-in method references. */
@@ -283,16 +307,16 @@
* *
* The wrapper methods that are **not** chainable by default are: * The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
@@ -407,13 +431,13 @@
} }
/** /**
* The base implementation of `_.delay` and `_.defer` which accepts an array * The base implementation of `_.delay` and `_.defer` which accepts `args`
* of `func` arguments. * to provide to `func`.
* *
* @private * @private
* @param {Function} func The function to delay. * @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation. * @param {number} wait The number of milliseconds to delay invocation.
* @param {Object} args The arguments to provide to `func`. * @param {Array} args The arguments to provide to `func`.
* @returns {number} Returns the timer id. * @returns {number} Returns the timer id.
*/ */
function baseDelay(func, wait, args) { function baseDelay(func, wait, args) {
@@ -573,7 +597,7 @@
} }
/** /**
* The base implementation of `_.gt` which doesn't coerce arguments to numbers. * The base implementation of `_.gt` which doesn't coerce arguments.
* *
* @private * @private
* @param {*} value The value to compare. * @param {*} value The value to compare.
@@ -585,6 +609,17 @@
return value > other; return value > other;
} }
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && objectToString.call(value) == dateTag;
}
/** /**
* The base implementation of `_.isEqual` which supports partial comparisons * The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects. * and tracks traversed objects.
@@ -644,13 +679,17 @@
isSameTag = objTag == othTag; isSameTag = objTag == othTag;
stack || (stack = []); stack || (stack = []);
var stacked = find(stack, function(entry) { var objStack = find(stack, function(entry) {
return entry[0] === object; return entry[0] == object;
}); });
if (stacked && stacked[1]) { var othStack = find(stack, function(entry) {
return stacked[1] == other; return entry[0] == other;
});
if (objStack && othStack) {
return objStack[1] == other;
} }
stack.push([object, other]); stack.push([object, other]);
stack.push([other, object]);
if (isSameTag && !objIsObj) { if (isSameTag && !objIsObj) {
var result = (objIsArr) var result = (objIsArr)
? equalArrays(object, other, equalFunc, customizer, bitmask, stack) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
@@ -679,6 +718,17 @@
return result; return result;
} }
/**
* The base implementation of `_.isRegExp` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
*/
function baseIsRegExp(value) {
return isObject(value) && objectToString.call(value) == regexpTag;
}
/** /**
* The base implementation of `_.iteratee`. * The base implementation of `_.iteratee`.
* *
@@ -704,9 +754,7 @@
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */
function baseKeys(object) { var baseKeys = overArg(nativeKeys, Object);
return nativeKeys(Object(object));
}
/** /**
* The base implementation of `_.keysIn` which doesn't skip the constructor * The base implementation of `_.keysIn` which doesn't skip the constructor
@@ -727,7 +775,7 @@
} }
/** /**
* The base implementation of `_.lt` which doesn't coerce arguments to numbers. * The base implementation of `_.lt` which doesn't coerce arguments.
* *
* @private * @private
* @param {*} value The value to compare. * @param {*} value The value to compare.
@@ -804,15 +852,31 @@
} }
/** /**
* The base implementation of `_.property` without support for deep paths. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
* *
* @private * @private
* @param {string} key The key of the property to get. * @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new accessor function. * @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/ */
function baseProperty(key) { function baseRest(func, start) {
return function(object) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return object == null ? undefined : object[key]; return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = array;
return func.apply(this, otherArgs);
}; };
} }
@@ -953,9 +1017,9 @@
var newValue = customizer var newValue = customizer
? customizer(object[key], source[key], key, object, source) ? customizer(object[key], source[key], key, object, source)
: source[key]; : undefined;
assignValue(object, key, newValue); assignValue(object, key, newValue === undefined ? source[key] : newValue);
} }
return object; return object;
} }
@@ -968,7 +1032,7 @@
* @returns {Function} Returns the new assigner function. * @returns {Function} Returns the new assigner function.
*/ */
function createAssigner(assigner) { function createAssigner(assigner) {
return rest(function(object, sources) { return baseRest(function(object, sources) {
var index = -1, var index = -1,
length = sources.length, length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined; customizer = length > 1 ? sources[length - 1] : undefined;
@@ -1049,7 +1113,7 @@
* @param {Function} Ctor The constructor to wrap. * @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function. * @returns {Function} Returns the new wrapped function.
*/ */
function createCtorWrapper(Ctor) { function createCtor(Ctor) {
return function() { return function() {
// Use a `switch` statement to work with class constructors. See // Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
@@ -1074,18 +1138,13 @@
function createFind(findIndexFunc) { function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) { return function(collection, predicate, fromIndex) {
var iterable = Object(collection); var iterable = Object(collection);
predicate = baseIteratee(predicate, 3);
if (!isArrayLike(collection)) { if (!isArrayLike(collection)) {
var props = keys(collection); var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
} }
var index = findIndexFunc(props || collection, function(value, key) { var index = findIndexFunc(collection, predicate, fromIndex);
if (props) { return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
key = value;
value = iterable[key];
}
return predicate(value, key, iterable);
}, fromIndex);
return index > -1 ? collection[props ? props[index] : index] : undefined;
}; };
} }
@@ -1095,19 +1154,18 @@
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* for more details.
* @param {*} thisArg The `this` binding of `func`. * @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to * @param {Array} partials The arguments to prepend to those provided to
* the new function. * the new function.
* @returns {Function} Returns the new wrapped function. * @returns {Function} Returns the new wrapped function.
*/ */
function createPartialWrapper(func, bitmask, thisArg, partials) { function createPartial(func, bitmask, thisArg, partials) {
if (typeof func != 'function') { if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT); throw new TypeError(FUNC_ERROR_TEXT);
} }
var isBind = bitmask & BIND_FLAG, var isBind = bitmask & BIND_FLAG,
Ctor = createCtorWrapper(func); Ctor = createCtor(func);
function wrapper() { function wrapper() {
var argsIndex = -1, var argsIndex = -1,
@@ -1212,18 +1270,14 @@
case boolTag: case boolTag:
case dateTag: case dateTag:
// Coerce dates and booleans to numbers, dates to milliseconds and case numberTag:
// booleans to `1` or `0` treating invalid dates coerced to `NaN` as // Coerce booleans to `1` or `0` and dates to milliseconds.
// not equal. // Invalid dates are coerced to `NaN`.
return +object == +other; return eq(+object, +other);
case errorTag: case errorTag:
return object.name == other.name && object.message == other.message; return object.name == other.name && object.message == other.message;
case numberTag:
// Treat `NaN` vs. `NaN` as equal.
return (object != +object) ? other != +other : object == +other;
case regexpTag: case regexpTag:
case stringTag: case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects, // Coerce regexes to strings and treat strings, primitives and objects,
@@ -1399,7 +1453,7 @@
* @since 1.1.0 * @since 1.1.0
* @category Array * @category Array
* @param {Array} array The array to search. * @param {Array} array The array to search.
* @param {Array|Function|Object|string} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from. * @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`. * @returns {number} Returns the index of the found element, else `-1`.
@@ -1735,7 +1789,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|Object|string} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check, * @returns {boolean} Returns `true` if all elements pass the predicate check,
@@ -1772,12 +1826,14 @@
* `predicate` returns truthy for. The predicate is invoked with three * `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection). * arguments: (value, index|key, collection).
* *
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|Object|string} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @returns {Array} Returns the new filtered array. * @returns {Array} Returns the new filtered array.
* @see _.reject * @see _.reject
@@ -1817,7 +1873,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to search. * @param {Array|Object} collection The collection to search.
* @param {Array|Function|Object|string} [predicate=_.identity] * @param {Function} [predicate=_.identity]
* The function invoked per iteration. * The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from. * @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`. * @returns {*} Returns the matched element, else `undefined`.
@@ -1899,8 +1955,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|Object|string} [iteratee=_.identity] * @param {Function} [iteratee=_.identity] The function invoked per iteration.
* The function invoked per iteration.
* @returns {Array} Returns the new mapped array. * @returns {Array} Returns the new mapped array.
* @example * @example
* *
@@ -2007,8 +2062,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|Object|string} [predicate=_.identity] * @param {Function} [predicate=_.identity] The function invoked per iteration.
* The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check, * @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`. * else `false`.
@@ -2050,8 +2104,8 @@
* @since 0.1.0 * @since 0.1.0
* @category Collection * @category Collection
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} * @param {...(Function|Function[])} [iteratees=[_.identity]]
* [iteratees=[_.identity]] The iteratees to sort by. * The iteratees to sort by.
* @returns {Array} Returns the new sorted array. * @returns {Array} Returns the new sorted array.
* @example * @example
* *
@@ -2101,7 +2155,7 @@
* @example * @example
* *
* jQuery(element).on('click', _.before(5, addContactToList)); * jQuery(element).on('click', _.before(5, addContactToList));
* // => allows adding up to 4 contacts to the list * // => Allows adding up to 4 contacts to the list.
*/ */
function before(n, func) { function before(n, func) {
var result; var result;
@@ -2140,9 +2194,9 @@
* @returns {Function} Returns the new bound function. * @returns {Function} Returns the new bound function.
* @example * @example
* *
* var greet = function(greeting, punctuation) { * function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation; * return greeting + ' ' + this.user + punctuation;
* }; * }
* *
* var object = { 'user': 'fred' }; * var object = { 'user': 'fred' };
* *
@@ -2155,8 +2209,8 @@
* bound('hi'); * bound('hi');
* // => 'hi fred!' * // => 'hi fred!'
*/ */
var bind = rest(function(func, thisArg, partials) { var bind = baseRest(function(func, thisArg, partials) {
return createPartialWrapper(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials); return createPartial(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials);
}); });
/** /**
@@ -2177,7 +2231,7 @@
* }, 'deferred'); * }, 'deferred');
* // => Logs 'deferred' after one or more milliseconds. * // => Logs 'deferred' after one or more milliseconds.
*/ */
var defer = rest(function(func, args) { var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args); return baseDelay(func, 1, args);
}); });
@@ -2200,7 +2254,7 @@
* }, 1000, 'later'); * }, 1000, 'later');
* // => Logs 'later' after one second. * // => Logs 'later' after one second.
*/ */
var delay = rest(function(func, wait, args) { var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args); return baseDelay(func, toNumber(wait) || 0, args);
}); });
@@ -2229,7 +2283,8 @@
throw new TypeError(FUNC_ERROR_TEXT); throw new TypeError(FUNC_ERROR_TEXT);
} }
return function() { return function() {
return !predicate.apply(this, arguments); var args = arguments;
return !predicate.apply(this, args);
}; };
} }
@@ -2249,61 +2304,12 @@
* var initialize = _.once(createApplication); * var initialize = _.once(createApplication);
* initialize(); * initialize();
* initialize(); * initialize();
* // `initialize` invokes `createApplication` once * // => `createApplication` is invoked once
*/ */
function once(func) { function once(func) {
return before(2, func); return before(2, func);
} }
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
var otherArgs = Array(start + 1);
index = -1;
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = array;
return func.apply(this, otherArgs);
};
}
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/** /**
@@ -2353,8 +2359,8 @@
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example * @example
* *
* var object = { 'user': 'fred' }; * var object = { 'a': 1 };
* var other = { 'user': 'fred' }; * var other = { 'a': 1 };
* *
* _.eq(object, object); * _.eq(object, object);
* // => true * // => true
@@ -2383,7 +2389,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`. * else `false`.
* @example * @example
* *
@@ -2405,11 +2411,9 @@
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0 * @since 0.1.0
* @type {Function}
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is an array, else `false`.
* else `false`.
* @example * @example
* *
* _.isArray([1, 2, 3]); * _.isArray([1, 2, 3]);
@@ -2492,8 +2496,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* else `false`.
* @example * @example
* *
* _.isBoolean(false); * _.isBoolean(false);
@@ -2515,8 +2518,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
* else `false`.
* @example * @example
* *
* _.isDate(new Date); * _.isDate(new Date);
@@ -2525,9 +2527,7 @@
* _.isDate('Mon April 23 2012'); * _.isDate('Mon April 23 2012');
* // => false * // => false
*/ */
function isDate(value) { var isDate = baseIsDate;
return isObjectLike(value) && objectToString.call(value) == dateTag;
}
/** /**
* Checks if `value` is an empty object, collection, map, or set. * Checks if `value` is an empty object, collection, map, or set.
@@ -2591,8 +2591,8 @@
* else `false`. * else `false`.
* @example * @example
* *
* var object = { 'user': 'fred' }; * var object = { 'a': 1 };
* var other = { 'user': 'fred' }; * var other = { 'a': 1 };
* *
* _.isEqual(object, other); * _.isEqual(object, other);
* // => true * // => true
@@ -2643,8 +2643,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a function, else `false`.
* else `false`.
* @example * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -2818,8 +2817,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a number, else `false`.
* else `false`.
* @example * @example
* *
* _.isNumber(3); * _.isNumber(3);
@@ -2847,8 +2845,7 @@
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
* else `false`.
* @example * @example
* *
* _.isRegExp(/abc/); * _.isRegExp(/abc/);
@@ -2857,9 +2854,7 @@
* _.isRegExp('/abc/'); * _.isRegExp('/abc/');
* // => false * // => false
*/ */
function isRegExp(value) { var isRegExp = baseIsRegExp;
return isObject(value) && objectToString.call(value) == regexpTag;
}
/** /**
* Checks if `value` is classified as a `String` primitive or object. * Checks if `value` is classified as a `String` primitive or object.
@@ -2869,8 +2864,7 @@
* @memberOf _ * @memberOf _
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a string, else `false`.
* else `false`.
* @example * @example
* *
* _.isString('abc'); * _.isString('abc');
@@ -3037,18 +3031,18 @@
* @example * @example
* *
* function Foo() { * function Foo() {
* this.c = 3; * this.a = 1;
* } * }
* *
* function Bar() { * function Bar() {
* this.e = 5; * this.c = 3;
* } * }
* *
* Foo.prototype.d = 4; * Foo.prototype.b = 2;
* Bar.prototype.f = 6; * Bar.prototype.d = 4;
* *
* _.assign({ 'a': 1 }, new Foo, new Bar); * _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3, 'e': 5 } * // => { 'a': 1, 'c': 3 }
*/ */
var assign = createAssigner(function(object, source) { var assign = createAssigner(function(object, source) {
copyObject(source, keys(source), object); copyObject(source, keys(source), object);
@@ -3072,18 +3066,18 @@
* @example * @example
* *
* function Foo() { * function Foo() {
* this.b = 2; * this.a = 1;
* } * }
* *
* function Bar() { * function Bar() {
* this.d = 4; * this.c = 3;
* } * }
* *
* Foo.prototype.c = 3; * Foo.prototype.b = 2;
* Bar.prototype.e = 5; * Bar.prototype.d = 4;
* *
* _.assignIn({ 'a': 1 }, new Foo, new Bar); * _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/ */
var assignIn = createAssigner(function(object, source) { var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object); copyObject(source, keysIn(source), object);
@@ -3179,10 +3173,10 @@
* @see _.defaultsDeep * @see _.defaultsDeep
* @example * @example
* *
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'user': 'barney', 'age': 36 } * // => { 'a': 1, 'b': 2 }
*/ */
var defaults = rest(function(args) { var defaults = baseRest(function(args) {
args.push(undefined, assignInDefaults); args.push(undefined, assignInDefaults);
return assignInWith.apply(undefined, args); return assignInWith.apply(undefined, args);
}); });
@@ -3290,7 +3284,7 @@
* _.pick(object, ['a', 'c']); * _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 } * // => { 'a': 1, 'c': 3 }
*/ */
var pick = rest(function(object, props) { var pick = baseRest(function(object, props) {
return object == null ? {} : basePick(object, baseMap(baseFlatten(props, 1), toKey)); return object == null ? {} : basePick(object, baseMap(baseFlatten(props, 1), toKey));
}); });
@@ -3407,7 +3401,7 @@
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/** /**
* This method returns the first argument given to it. * This method returns the first argument it receives.
* *
* @static * @static
* @since 0.1.0 * @since 0.1.0
@@ -3417,7 +3411,7 @@
* @returns {*} Returns `value`. * @returns {*} Returns `value`.
* @example * @example
* *
* var object = { 'user': 'fred' }; * var object = { 'a': 1 };
* *
* console.log(_.identity(object) === object); * console.log(_.identity(object) === object);
* // => true * // => true
@@ -3486,13 +3480,13 @@
* @returns {Function} Returns the new spec function. * @returns {Function} Returns the new spec function.
* @example * @example
* *
* var users = [ * var objects = [
* { 'user': 'barney', 'age': 36, 'active': true }, * { 'a': 1, 'b': 2, 'c': 3 },
* { 'user': 'fred', 'age': 40, 'active': false } * { 'a': 4, 'b': 5, 'c': 6 }
* ]; * ];
* *
* _.filter(users, _.matches({ 'age': 40, 'active': false })); * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
* // => [{ 'user': 'fred', 'age': 40, 'active': false }] * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
*/ */
function matches(source) { function matches(source) {
return baseMatches(assign({}, source)); return baseMatches(assign({}, source));
@@ -3591,7 +3585,7 @@
} }
/** /**
* A method that returns `undefined`. * This method returns `undefined`.
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -3801,22 +3795,21 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
// Expose Lodash on the free variable `window` or `self` when available so it's // Some AMD build optimizers, like r.js, check for condition patterns like:
// globally accessible, even when bundled with Browserify, Webpack, etc. This
// also prevents errors in cases where Lodash is loaded by a script tag in the
// presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
// for more details. Use `_.noConflict` to remove Lodash from the global object.
(freeSelf || {})._ = lodash;
// Some AMD build optimizers like r.js check for condition patterns like the following:
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// Expose Lodash on the global object to prevent errors when Lodash is
// loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object.
root._ = lodash;
// Define as an anonymous module so, through path mapping, it can be // Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module. // referenced as the "underscore" module.
define(function() { define(function() {
return lodash; return lodash;
}); });
} }
// Check for `exports` after `define` in case a build optimizer adds an `exports` object. // Check for `exports` after `define` in case a build optimizer adds it.
else if (freeModule) { else if (freeModule) {
// Export for Node.js. // Export for Node.js.
(freeModule.exports = lodash)._ = lodash; (freeModule.exports = lodash)._ = lodash;

View File

@@ -3,26 +3,26 @@
* lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE * lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE
* Build: `lodash core -o ./dist/lodash.core.js` * Build: `lodash core -o ./dist/lodash.core.js`
*/ */
;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n){return mn(Object(n))}function r(n,t){return n.push.apply(n,t),n}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 x(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return cn[n]}function c(n){return n instanceof f?n:new f(n)}function f(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r,e){ ;(function(){function n(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}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 m(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r,e){return n===Z||J(n,an[r])&&!ln.call(e,r)?t:n;
var u;return(u=n===rn)||(u=hn[r],u=(n===u||n!==n&&u!==u)&&!vn.call(e,r)),u?t:n}function l(n){return L(n)?_n(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(rn,r)},t)}function s(n,t){var r=true;return xn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===rn?i===i:r(i,c)))var c=i,f=o}return f}function v(n,t){var r=[];return xn(n,function(n,e,u){t(n,e,u)&&r.push(n); }function f(n){return V(n)?vn(n):{}}function a(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(Z,r)},t)}function l(n,t){var r=true;return jn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function p(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===Z?i===i:r(i,c)))var c=i,f=o}return f}function s(n,t){var r=[];return jn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function h(n,r,e,u,o){var i=-1,c=n.length;for(e||(e=I),o||(o=[]);++i<c;){
}),r}function y(n,t,e,u,o){var i=-1,c=n.length;for(e||(e=z),o||(o=[]);++i<c;){var f=n[i];t>0&&e(f)?t>1?y(f,t-1,e,u,o):r(o,f):u||(o[o.length]=f)}return o}function b(n,r){return n&&En(n,r,t)}function g(n,t){return v(t,function(t){return K(n[t])})}function _(n,t){return n>t}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!L(n)&&!Q(t)?n!==n&&t!==t:d(n,t,j,r,e,u)}function d(n,t,r,e,u,o){var i=Tn(n),c=Tn(t),f="[object Array]",a="[object Array]";i||(f=bn.call(n),f="[object Arguments]"==f?"[object Object]":f), var f=n[i];0<r&&e(f)?1<r?h(f,r-1,e,u,o):t(o,f):u||(o[o.length]=f)}return o}function v(n,t){return n&&dn(n,t,Dn)}function b(n,t){return s(t,function(t){return U(n[t])})}function y(n,t){return n>t}function g(n,t,r,e,u){return n===t||(null==n||null==t||!V(n)&&!H(t)?n!==n&&t!==t:_(n,t,g,r,e,u))}function _(n,t,r,e,u,o){var i=kn(n),c=kn(t),f="[object Array]",a="[object Array]";i||(f=sn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=sn.call(t),a="[object Arguments]"==a?"[object Object]":a);
c||(a=bn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=kn(o,function(t){return t[0]===n});return p&&p[1]?p[1]==t:(o.push([n,t]),a&&!l?(r=i?I(n,t,r,e,u,o):q(n,t,f),o.pop(),r):2&u||(i=l&&vn.call(n,"__wrapped__"),f=c&&vn.call(t,"__wrapped__"),!i&&!f)?a?(r=$(n,t,r,e,u,o),o.pop(),r):false:(i=i?n.value():n,t=f?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?nn:(typeof n=="object"?E:w)(n); var l="[object Object]"==f&&true,c="[object Object]"==a&&true,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&ln.call(n,"__wrapped__"),
}function O(n,t){return t>n}function x(n,t){var r=-1,e=H(n)?Array(n.length):[];return xn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function E(n){var r=t(n);return function(t){var e=r.length;if(null==t)return!e;for(t=Object(t);e--;){var u=r[e];if(!(u in t&&j(n[u],t[u],rn,3)))return false}return true}}function A(n,t){return n=Object(n),M(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function w(n){return function(t){return null==t?rn: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, f=c&&ln.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=D(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t,r=r(i,f,e,u,o),o.pop(),r)}function j(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?O:r)(n)}function d(n,t){return n<t}function m(n,t){var r=-1,e=P(n)?Array(n.length):[];return jn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function O(n){var t=Dn(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&&g(n[u],r[u],Z,3)))return false}return true}}
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 xn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(n,t){return M(t,function(n,t){return t.func.apply(t.thisArg,r([n],t.args))},n)}function T(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];vn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==rn||i in f)||(f[i]=c)}return r}function B(n){return U(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:rn,o=n.length>3&&typeof o=="function"?(u--, function x(n,t){return n=Object(n),C(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function A(n){var t;return t=_n(t===Z?n.length-1:t,0),function(){for(var r=arguments,e=-1,u=_n(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(e=-1,u=Array(t+1);++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function E(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 w(n){return E(n,0,n.length)}function k(n,t){var r;return jn(n,function(n,e,u){
o):rn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function R(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return L(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!==pn&&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=R(n);return e}function I(n,t,r,e,u,o){var i=n.length,c=t.length; return r=t(n,e,u),!r}),!!r}function N(n,r){return C(r,function(n,r){return r.func.apply(r.thisArg,t([n],r.args))},n)}function S(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):Z,f=r,a=i,i=c===Z?n[i]:c,c=f[a];ln.call(f,a)&&J(c,i)&&(i!==Z||a in f)||(f[a]=i)}return r}function F(n){return A(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:Z,o=3<n.length&&typeof o=="function"?(u--,o):Z;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){
if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:rn;++c<i;){var l=n[c],p=t[c];if(void 0!==rn){f=false;break}if(a){if(!S(t,function(n,t){return G(a,t)||l!==n&&!r(l,n,e,u,o)?void 0:a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function q(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+""; var t=arguments,r=f(n.prototype),t=n.apply(r,t);return V(t)?t:r}}function R(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==on&&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 T(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:Z;++c<i;){var l=n[c],p=t[c];if(void 0!==Z){
}return false}function $(n,r,e,u,o,i){var c=2&o,f=t(n),a=f.length,l=t(r).length;if(a!=l&&!c)return false;for(var p=a;p--;){var s=f[p];if(!(c?s in r:vn.call(r,s)))return false}for(l=true;++p<a;){var s=f[p],h=n[s],v=r[s];if(void 0!==rn||h!==v&&!e(h,v,u,o,i)){l=false;break}c||(c="constructor"==s)}return l&&!c&&(e=n.constructor,u=r.constructor,e!=u&&"constructor"in n&&"constructor"in r&&!(typeof e=="function"&&e instanceof e&&typeof u=="function"&&u instanceof u)&&(l=false)),l}function z(n){return Tn(n)||V(n)}function C(n){ f=false;break}if(a){if(!k(t,function(n,t){if(!$(a,t)&&(l===n||r(l,n,e,u,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function D(n,t,r,e,u,o){var i=2&u,c=Dn(n),f=c.length,a=Dn(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:ln.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==Z||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)),
return n&&n.length?n[0]:rn}function G(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?On(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}function J(n,t){return xn(n,m(t))}function M(n,t,r){return e(n,m(t),r,3>arguments.length,xn)}function P(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Bn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=rn),r}}function U(n){var t;if(typeof n!="function")throw new TypeError("Expected a function"); a}function I(n){return kn(n)||M(n)}function q(n){return n&&n.length?n[0]:Z}function $(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?_n(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}function z(n,t){return jn(n,j(t))}function C(n,t,r){return e(n,j(t),r,3>arguments.length,jn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Nn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){
return t=On(t===rn?n.length-1:Bn(t),0),function(){for(var r=arguments,e=-1,u=On(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 V(n){return Q(n)&&H(n)&&vn.call(n,"callee")&&(!jn.call(n,"callee")||"[object Arguments]"==bn.call(n))}function H(n){var t;return(t=null!=n)&&(t=An(n),t=typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t),t&&!K(n)}function K(n){return n=L(n)?bn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n; return n===t||n!==n&&t!==t}function M(n){return H(n)&&P(n)&&ln.call(n,"callee")&&(!bn.call(n,"callee")||"[object Arguments]"==sn.call(n))}function P(n){var t;return(t=null!=n)&&(t=On(n),t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!U(n)}function U(n){return n=V(n)?sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function V(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function H(n){return!!n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==sn.call(n);
}function L(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Q(n){return!!n&&typeof n=="object"}function W(n){return typeof n=="number"||Q(n)&&"[object Number]"==bn.call(n)}function X(n){return typeof n=="string"||!Tn(n)&&Q(n)&&"[object String]"==bn.call(n)}function Y(n){return typeof n=="string"?n:null==n?"":n+""}function Z(n){return n?u(n,t(n)):[]}function nn(n){return n}function tn(n,e,u){var o=t(e),i=g(e,o);null!=u||L(e)&&(i.length||!o.length)||(u=e,e=n,n=this,i=g(e,t(e)));var c=!(L(u)&&"chain"in u&&!u.chain),f=K(n); }function L(n){return typeof n=="string"||!kn(n)&&H(n)&&"[object String]"==sn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return n?u(n,Dn(n)):[]}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=b(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=b(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return jn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=w(this.__actions__)).push({
return xn(i,function(t){var u=e[t];n[t]=u,f&&(n.prototype[t]=function(){var t=this.__chain__;if(c||t){var e=n(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=t,e}return u.apply(n,r([this.value()],arguments))})}),n}var rn,en=1/0,un=/[&<>"'`]/g,on=RegExp(un.source),cn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},fn=typeof exports=="object"&&exports,an=fn&&typeof module=="object"&&module,ln=o(typeof self=="object"&&self),pn=o(typeof global=="object"&&global)||ln||o(typeof this=="object"&&this)||Function("return this")(),sn=Array.prototype,hn=Object.prototype,vn=hn.hasOwnProperty,yn=0,bn=hn.toString,gn=pn._,_n=Object.create,jn=hn.propertyIsEnumerable,dn=pn.isFinite,mn=Object.keys,On=Math.max; func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"'`]/g,rn=RegExp(tn.source),en=typeof global=="object"&&global&&global.Object===Object&&global,un=typeof self=="object"&&self&&self.Object===Object&&self,on=en||un||Function("return this")(),un=(en=en&&typeof exports=="object"&&exports)&&typeof module=="object"&&module,cn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;",
f.prototype=l(c.prototype),f.prototype.constructor=f;var xn=function(n,t){return function(r,e){if(null==r)return r;if(!H(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),En=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}}(),An=w("length"),wn=String,kn=function(n){return function(r,e,u){var o=Object(r);if(e=m(e),!H(r))var i=t(r);return u=n(i||r,function(n,t){ "`":"&#96;"}),fn=Array.prototype,an=Object.prototype,ln=an.hasOwnProperty,pn=0,sn=an.toString,hn=on._,vn=Object.create,bn=an.propertyIsEnumerable,yn=on.isFinite,gn=Object.keys,_n=Math.max;i.prototype=f(o.prototype),i.prototype.constructor=i;var jn=function(n,t){return function(r,e){if(null==r)return r;if(!P(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}}(v),dn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){
return i&&(t=n,n=o[t]),e(n,t,o)},u),u>-1?r[i?i[u]:u]:rn}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Bn(r),0>r&&(r=On(e+r,0));n:{for(t=m(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),Nn=U(function(n,t,r){return D(n,t,r)}),Sn=U(function(n,t){return p(n,1,t)}),Fn=U(function(n,t,r){return p(n,Rn(t)||0,r)}),Tn=Array.isArray,Bn=Number,Rn=Number,Dn=B(function(n,r){T(r,t(r),n)}),In=B(function(t,r){T(r,n(r),t)}),qn=B(function(t,r,e,u){T(r,n(r),t,u)}),$n=U(function(n){ var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}(),mn=function(n,t){return function(r){return n(t(r))}}(gn,Object),On=r("length"),xn=String,An=function(n){return function(t,r,e){var u=Object(t);if(!P(t)){var o=j(r);t=Dn(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:Z}}(function(n,t,r){var e=n?n.length:0;if(!e)return-1;r=null==r?0:Nn(r),0>r&&(r=_n(e+r,0));n:{for(t=j(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),gn=A(function(n,t,r){return R(n,t,r);
return n.push(rn,a),qn.apply(rn,n)}),zn=U(function(n,t){return null==n?{}:A(n,x(y(t,1),wn))});c.assignIn=In,c.before=P,c.bind=Nn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){for(var n=arguments.length,t=Array(n?n-1:0),e=arguments[0],u=n;u--;)t[u-1]=arguments[u];return n?r(Tn(e)?N(e):[e],y(t,1)):[]},c.create=function(n,t){var r=l(n);return t?Dn(r,t):r},c.defaults=$n,c.defer=Sn,c.delay=Fn,c.filter=function(n,t){return v(n,m(t))}, }),En=A(function(n,t){return a(n,1,t)}),wn=A(function(n,t,r){return a(n,Sn(t)||0,r)}),kn=Array.isArray,Nn=Number,Sn=Number,Fn=F(function(n,t){S(t,Dn(t),n)}),Bn=F(function(t,r){S(r,n(r),t)}),Rn=F(function(t,r,e,u){S(r,n(r),t,u)}),Tn=A(function(n){return n.push(Z,c),Rn.apply(Z,n)}),Dn=mn,mn=A(function(n,t){return null==n?{}:x(n,m(h(t,1),xn))});o.assignIn=Bn,o.before=G,o.bind=gn,o.chain=function(n){return n=o(n),n.__chain__=true,n},o.compact=function(n){return s(n,Boolean)},o.concat=function(){for(var n=arguments.length,r=Array(n?n-1:0),e=arguments[0],u=n;u--;)r[u-1]=arguments[u];
c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,en):[]},c.iteratee=m,c.keys=t,c.map=function(n,t){return x(n,m(t))},c.matches=function(n){return E(Dn({},n))},c.mixin=tn,c.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return P(2,n)},c.pick=zn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===rn?e:+r,e?k(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){ return n?t(kn(e)?w(e):[e],h(r,1)):[]},o.create=function(n,t){var r=f(n);return t?Fn(r,t):r},o.defaults=Tn,o.defer=En,o.delay=wn,o.filter=function(n,t){return s(n,j(t))},o.flatten=function(n){return n&&n.length?h(n,1):[]},o.flattenDeep=function(n){return n&&n.length?h(n,nn):[]},o.iteratee=j,o.keys=Dn,o.map=function(n,t){return m(n,j(t))},o.matches=function(n){return O(Fn({},n))},o.mixin=Y,o.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments);
var r=0;return t=m(t),x(x(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==rn,o=null===r,i=r===r,c=e!==rn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),w("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return H(n)?n.length?N(n):[]:Z(n)},c.values=Z,c.extend=In, }},o.once=function(n){return G(2,n)},o.pick=mn,o.slice=function(n,t,r){var e=n?n.length:0;return r=r===Z?e:+r,e?E(n,null==t?0:+t,r):[]},o.sortBy=function(n,t){var e=0;return t=j(t),m(m(n,function(n,r,u){return{value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==Z,o=null===r,i=r===r,c=e!==Z,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),r("value"));
tn(c,c),c.clone=function(n){return L(n)?Tn(n)?N(n):T(n,t(n)):n},c.escape=function(n){return(n=Y(n))&&on.test(n)?n.replace(un,i):n},c.every=function(n,t,r){return t=r?rn:t,s(n,m(t))},c.find=kn,c.forEach=J,c.has=function(n,t){return null!=n&&vn.call(n,t)},c.head=C,c.identity=nn,c.indexOf=G,c.isArguments=V,c.isArray=Tn,c.isBoolean=function(n){return true===n||false===n||Q(n)&&"[object Boolean]"==bn.call(n)},c.isDate=function(n){return Q(n)&&"[object Date]"==bn.call(n)},c.isEmpty=function(n){return H(n)&&(Tn(n)||X(n)||K(n.splice)||V(n))?!n.length:!t(n).length; },o.tap=function(n,t){return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return P(n)?n.length?w(n):[]:W(n)},o.values=W,o.extend=Bn,Y(o,o),o.clone=function(n){return V(n)?kn(n)?w(n):S(n,Dn(n)):n},o.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,cn):n},o.every=function(n,t,r){return t=r?Z:t,l(n,j(t))},o.find=An,o.forEach=z,o.has=function(n,t){return null!=n&&ln.call(n,t)},o.head=q,o.identity=X,o.indexOf=$,o.isArguments=M,o.isArray=kn,o.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==sn.call(n);
},c.isEqual=function(n,t){return j(n,t)},c.isFinite=function(n){return typeof n=="number"&&dn(n)},c.isFunction=K,c.isNaN=function(n){return W(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=W,c.isObject=L,c.isRegExp=function(n){return L(n)&&"[object RegExp]"==bn.call(n)},c.isString=X,c.isUndefined=function(n){return n===rn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:rn},c.max=function(n){return n&&n.length?h(n,nn,_):rn},c.min=function(n){return n&&n.length?h(n,nn,O):rn},c.noConflict=function(){ },o.isDate=function(n){return H(n)&&"[object Date]"==sn.call(n)},o.isEmpty=function(n){return P(n)&&(kn(n)||L(n)||U(n.splice)||M(n))?!n.length:!Dn(n).length},o.isEqual=function(n,t){return g(n,t)},o.isFinite=function(n){return typeof n=="number"&&yn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return V(n)&&"[object RegExp]"==sn.call(n)},o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){
return pn._===this&&(pn._=gn),this},c.noop=function(){},c.reduce=M,c.result=function(n,t,r){return t=null==n?rn:n[t],t===rn&&(t=r),K(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=H(n)?n:t(n),n.length)},c.some=function(n,t,r){return t=r?rn:t,S(n,m(t))},c.uniqueId=function(n){var t=++yn;return Y(n)+t},c.each=J,c.first=C,tn(c,function(){var n={};return b(c,function(t,r){vn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.13.1",xn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){ var t=n?n.length:0;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?p(n,X,y):Z},o.min=function(n){return n&&n.length?p(n,X,d):Z},o.noConflict=function(){return on._===this&&(on._=hn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=P(n)?n:Dn(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,k(n,j(t))},o.uniqueId=function(n){var t=++pn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){
var t=(/^(?:replace|split)$/.test(n)?String.prototype:sn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Tn(u)?u:[],n)}return this[r](function(r){return t.apply(Tn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(ln||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){ var n={};return v(o,function(t,r){ln.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.14.0",jn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:fn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(kn(u)?u:[],n)}return this[r](function(r){return t.apply(kn(r)?r:[],n);
return c}):an?((an.exports=c)._=c,fn._=c):pn._=c}).call(this); })}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return N(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):un?((un.exports=o)._=o,en._=o):on._=o}).call(this);

230
dist/lodash.fp.js vendored
View File

@@ -151,11 +151,11 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {Function} cloner The function to clone arguments. * @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function. * @returns {Function} Returns the new immutable function.
*/ */
function immutWrap(func, cloner) { function wrapImmutable(func, cloner) {
return function() { return function() {
var length = arguments.length; var length = arguments.length;
if (!length) { if (!length) {
return result; return;
} }
var args = Array(length); var args = Array(length);
while (length--) { while (length--) {
@@ -289,6 +289,12 @@ return /******/ (function(modules) { // webpackBootstrap
return func; return func;
}; };
}, },
'rearg': function(rearg) {
return function(func, indexes) {
var n = indexes ? indexes.length : 0;
return curry(rearg(func, indexes), n);
};
},
'runInContext': function(runInContext) { 'runInContext': function(runInContext) {
return function(context) { return function(context) {
return baseConvert(util, runInContext(context), options); return baseConvert(util, runInContext(context), options);
@@ -298,6 +304,77 @@ return /******/ (function(modules) { // webpackBootstrap
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* Casts `func` to a function with an arity capped iteratee if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @returns {Function} Returns the cast function.
*/
function castCap(name, func) {
if (config.cap) {
var indexes = mapping.iterateeRearg[name];
if (indexes) {
return iterateeRearg(func, indexes);
}
var n = !isLib && mapping.iterateeAry[name];
if (n) {
return iterateeAry(func, n);
}
}
return func;
}
/**
* Casts `func` to a curried function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castCurry(name, func, n) {
return (forceCurry || (config.curry && n > 1))
? curry(func, n)
: func;
}
/**
* Casts `func` to a fixed arity function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity cap.
* @returns {Function} Returns the cast function.
*/
function castFixed(name, func, n) {
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
var data = mapping.methodSpread[name],
start = data && data.start;
return start === undefined ? ary(func, n) : spread(func, start);
}
return func;
}
/**
* Casts `func` to an rearged function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castRearg(name, func, n) {
return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
: func;
}
/** /**
* Creates a clone of `object` by `path`. * Creates a clone of `object` by `path`.
* *
@@ -390,12 +467,11 @@ return /******/ (function(modules) { // webpackBootstrap
} }
/** /**
* Creates a function that invokes `func` with its first argument passed * Creates a function that invokes `func` with its first argument transformed.
* thru `transform`.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
* @param {...Function} transform The functions to transform the first argument. * @param {Function} transform The argument transform.
* @returns {Function} Returns the new function. * @returns {Function} Returns the new function.
*/ */
function overArg(func, transform) { function overArg(func, transform) {
@@ -435,42 +511,27 @@ return /******/ (function(modules) { // webpackBootstrap
} }
else if (config.immutable) { else if (config.immutable) {
if (mutateMap.array[name]) { if (mutateMap.array[name]) {
wrapped = immutWrap(func, cloneArray); wrapped = wrapImmutable(func, cloneArray);
} }
else if (mutateMap.object[name]) { else if (mutateMap.object[name]) {
wrapped = immutWrap(func, createCloner(func)); wrapped = wrapImmutable(func, createCloner(func));
} }
else if (mutateMap.set[name]) { else if (mutateMap.set[name]) {
wrapped = immutWrap(func, cloneByPath); wrapped = wrapImmutable(func, cloneByPath);
} }
} }
each(aryMethodKeys, function(aryKey) { each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) { each(mapping.aryMethod[aryKey], function(otherName) {
if (name == otherName) { if (name == otherName) {
var aryN = !isLib && mapping.iterateeAry[name], var spreadData = mapping.methodSpread[name],
reargIndexes = mapping.iterateeRearg[name], afterRearg = spreadData && spreadData.afterRearg;
spreadStart = mapping.methodSpread[name];
result = wrapped; result = afterRearg
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { ? castFixed(name, castRearg(name, wrapped, aryKey), aryKey)
result = spreadStart === undefined : castRearg(name, castFixed(name, wrapped, aryKey), aryKey);
? ary(result, aryKey)
: spread(result, spreadStart); result = castCap(name, result);
} result = castCurry(name, result, aryKey);
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 false;
} }
}); });
@@ -559,11 +620,20 @@ return /******/ (function(modules) { // webpackBootstrap
'entries': 'toPairs', 'entries': 'toPairs',
'entriesIn': 'toPairsIn', 'entriesIn': 'toPairsIn',
'extend': 'assignIn', 'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith', 'extendWith': 'assignInWith',
'first': 'head', 'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases. // Ramda aliases.
'__': 'placeholder', '__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every', 'all': 'every',
'allPass': 'overEvery', 'allPass': 'overEvery',
'always': 'constant', 'always': 'constant',
@@ -577,8 +647,11 @@ return /******/ (function(modules) { // webpackBootstrap
'contains': 'includes', 'contains': 'includes',
'dissoc': 'unset', 'dissoc': 'unset',
'dissocPath': 'unset', 'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual', 'equals': 'isEqual',
'identical': 'eq', 'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial', 'init': 'initial',
'invertObj': 'invert', 'invertObj': 'invert',
'juxt': 'over', 'juxt': 'over',
@@ -595,36 +668,44 @@ return /******/ (function(modules) { // webpackBootstrap
'propEq': 'matchesProperty', 'propEq': 'matchesProperty',
'propOr': 'getOr', 'propOr': 'getOr',
'props': 'at', 'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest', 'unapply': 'rest',
'unnest': 'flatten', 'unnest': 'flatten',
'useWith': 'overArgs', 'useWith': 'overArgs',
'whereEq': 'filter', 'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject' 'zipObj': 'zipObject'
}; };
/** Used to map ary to method names. */ /** Used to map ary to method names. */
exports.aryMethod = { exports.aryMethod = {
'1': [ '1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest',
'uniqueId', 'words' 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd',
'trimStart', 'uniqueId', 'words', 'zipAll'
], ],
'2': [ '2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
@@ -703,7 +784,9 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to rearg configs. */ /** Used to map method names to rearg configs. */
exports.methodRearg = { exports.methodRearg = {
'assignInAllWith': [1, 2, 0],
'assignInWith': [1, 2, 0], 'assignInWith': [1, 2, 0],
'assignAllWith': [1, 2, 0],
'assignWith': [1, 2, 0], 'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0], 'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0], 'differenceWith': [1, 2, 0],
@@ -712,6 +795,7 @@ return /******/ (function(modules) { // webpackBootstrap
'intersectionWith': [1, 2, 0], 'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0], 'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0], 'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 2, 0],
'mergeWith': [1, 2, 0], 'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0], 'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0], 'padCharsEnd': [2, 1, 0],
@@ -731,11 +815,20 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to spread configs. */ /** Used to map method names to spread configs. */
exports.methodSpread = { exports.methodSpread = {
'invokeArgs': 2, 'assignAll': { 'start': 0 },
'invokeArgsMap': 2, 'assignAllWith': { 'afterRearg': true, 'start': 1 },
'partial': 1, 'assignInAll': { 'start': 0 },
'partialRight': 1, 'assignInAllWith': { 'afterRearg': true, 'start': 1 },
'without': 1 'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'afterRearg': true, 'start': 1 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
}; };
/** Used to identify methods which mutate arrays or objects. */ /** Used to identify methods which mutate arrays or objects. */
@@ -752,13 +845,21 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
'object': { 'object': {
'assign': true, 'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true, 'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true, 'assignInWith': true,
'assignWith': true, 'assignWith': true,
'defaults': true, 'defaults': true,
'defaultsAll': true,
'defaultsDeep': true, 'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true, 'merge': true,
'mergeWith': true 'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
}, },
'set': { 'set': {
'set': true, 'set': true,
@@ -798,8 +899,14 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to other names. */ /** Used to map method names to other names. */
exports.remap = { exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry', 'curryN': 'curry',
'curryRightN': 'curryRight', 'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find', 'findFrom': 'find',
'findIndexFrom': 'findIndex', 'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast', 'findLastFrom': 'findLast',
@@ -810,14 +917,18 @@ return /******/ (function(modules) { // webpackBootstrap
'invokeArgs': 'invoke', 'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap', 'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf', 'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad', 'padChars': 'pad',
'padCharsEnd': 'padEnd', 'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart', 'padCharsStart': 'padStart',
'propertyOf': 'get',
'restFrom': 'rest', 'restFrom': 'rest',
'spreadFrom': 'spread', 'spreadFrom': 'spread',
'trimChars': 'trim', 'trimChars': 'trim',
'trimCharsEnd': 'trimEnd', 'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart' 'trimCharsStart': 'trimStart',
'zipAll': 'zip'
}; };
/** Used to track methods that skip fixing their arity. */ /** Used to track methods that skip fixing their arity. */
@@ -827,6 +938,7 @@ return /******/ (function(modules) { // webpackBootstrap
'flowRight': true, 'flowRight': true,
'iteratee': true, 'iteratee': true,
'mixin': true, 'mixin': true,
'rearg': true,
'runInContext': true 'runInContext': true
}; };
@@ -852,12 +964,14 @@ return /******/ (function(modules) { // webpackBootstrap
'overArgs': true, 'overArgs': true,
'partial': true, 'partial': true,
'partialRight': true, 'partialRight': true,
'propertyOf': true,
'random': true, 'random': true,
'range': true, 'range': true,
'rangeRight': true, 'rangeRight': true,
'subtract': true, 'subtract': true,
'zip': true, 'zip': true,
'zipObject': true 'zipObject': true,
'zipObjectDeep': true
}; };

33
dist/lodash.fp.min.js vendored
View File

@@ -1,17 +1,20 @@
!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())), (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), 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){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,c){function f(t,e){e=D(e);for(var r=-1,n=e.length,i=n-1,a=w(Object(t)),o=a;null!=o&&++r<n;){var s=e[r],u=o[s];null!=u&&(o[e[r]]=w(r==i?u:Object(u))),o=o[s]}return a}function h(t){return N.runInContext.convert(t)(void 0)}function y(t,e){var r=c;return function(n){var i=I?E:F,a=I?E[t]:e,o=C(C({},r),n);return u(i,t,a,o)}}function m(t,e){return v(t,function(t){return"function"==typeof t?i(t,e):t})}function g(t,e){return v(t,function(t){var r=e.length;return n(z(i(t,r),e),r)})}function v(t,e){ i}}}function l(t,e,r,d){function c(t,e){if(B.cap){var r=u.iterateeRearg[t];if(r)return x(e,r);var n=!b&&u.iterateeAry[t];if(n)return W(e,n)}return e}function h(t,e,r){return E||B.curry&&r>1?q(e,r):e}function g(t,e,r){if(B.fixed&&(F||!u.skipFixed[t])){var n=u.methodSpread[t],i=n&&n.start;return void 0===i?M(e,r):N(e,i)}return e}function y(t,e,r){return B.rearg&&r>1&&(j||!u.skipRearg[t])?_(e,u.methodRearg[t]||u.aryRearg[r]):e}function m(t,e){e=V(e);for(var r=-1,n=e.length,i=n-1,a=z(Object(t)),o=a;null!=o&&++r<n;){
return function(){var r=arguments.length;if(!r)return t();for(var n=Array(r);r--;)n[r]=arguments[r];var i=A.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):A.immutable&&(d.array[t]?n=s(e,a):d.object[t]?n=s(e,o(e)):d.set[t]&&(n=s(e,f))),M(T,function(e){return M(p.aryMethod[e],function(i){if(t==i){var a=!I&&p.iterateeAry[t],o=p.iterateeRearg[t],s=p.methodSpread[t];return r=n,!A.fixed||!b&&p.skipFixed[t]||(r=void 0===s?j(r,e):K(r,s)), var s=e[r],l=o[s];null!=l&&(o[e[r]]=z(r==i?l:Object(l))),o=o[s]}return a}function v(t){return H.runInContext.convert(t)(void 0)}function A(t,e){var r=d;return function(n){var i=b?C:w,a=b?C[t]:e,o=D(D({},r),n);return l(i,t,a,o)}}function W(t,e){return I(t,function(t){return"function"==typeof t?i(t,e):t})}function x(t,e){return I(t,function(t){var r=e.length;return n(_(i(t,r),e),r)})}function I(t,e){return function(){var r=arguments.length;if(!r)return t();for(var n=Array(r);r--;)n[r]=arguments[r];var i=B.rearg?0:r-1;
A.rearg&&e>1&&(k||!p.skipRearg[t])&&(r=z(r,p.methodRearg[t]||p.aryRearg[e])),A.cap&&(o?r=g(r,o):a&&(r=m(r,a))),(O||A.curry&&e>1)&&(O&&console.log(O,t),r=L(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=O?L(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=B),r}var W,I="function"==typeof e,R=e===Object(e);if(R&&(c=r,r=e,e=void 0),null==r)throw new TypeError;c||(c={});var A={cap:"cap"in c?c.cap:!0,curry:"curry"in c?c.curry:!0,fixed:"fixed"in c?c.fixed:!0, return n[i]=e(n[i]),t.apply(void 0,n)}}function R(t,e){t=u.aliasToReal[t]||t;var r,n=e,i=G[t];return i?n=i(e):B.immutable&&(p.array[t]?n=s(e,a):p.object[t]?n=s(e,o(e)):p.set[t]&&(n=s(e,m))),P(U,function(e){return P(u.aryMethod[e],function(i){if(t==i){var a=u.methodSpread[t],o=a&&a.afterRearg;return r=o?g(t,y(t,n,e),e):y(t,g(t,n,e),e),r=c(t,r),r=h(t,r,e),!1}}),!r}),r||(r=n),r==e&&(r=E?q(r,1):function(){return e.apply(this,arguments)}),r.convert=A(t,e),u.placeholder[t]&&(O=!0,r.placeholder=e.placeholder=L),
immutable:"immutable"in c?c.immutable:!0,rearg:"rearg"in c?c.rearg:!0},O="curry"in c&&c.curry,b="fixed"in c&&c.fixed,k="rearg"in c&&c.rearg,B=I?r:l,E=I?r.runInContext():void 0,F=I?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},j=F.ary,C=F.assign,w=F.clone,L=F.curry,M=F.forEach,q=F.isArray,P=F.isFunction,S=F.keys,z=F.rearg,K=F.spread,D=F.toPath,T=S(p.aryMethod),_={ r}var O,b="function"==typeof e,k=e===Object(e);if(k&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var B={cap:!("cap"in d)||d.cap,curry:!("curry"in d)||d.curry,fixed:!("fixed"in d)||d.fixed,immutable:!("immutable"in d)||d.immutable,rearg:!("rearg"in d)||d.rearg},E="curry"in d&&d.curry,F="fixed"in d&&d.fixed,j="rearg"in d&&d.rearg,L=b?r:f,C=b?r.runInContext():void 0,w=b?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,
castArray:function(t){return function(){var e=arguments[0];return q(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 A.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(!P(r))return t(r,Object(e));var n=[];return M(S(e),function(t){P(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),M(n,function(t){var e=t[1];P(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]]; keys:t.keys,rearg:t.rearg,spread:t.spread,toPath:t.toPath},M=w.ary,D=w.assign,z=w.clone,q=w.curry,P=w.forEach,S=w.isArray,T=w.isFunction,K=w.keys,_=w.rearg,N=w.spread,V=w.toPath,U=K(u.aryMethod),G={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 B.cap&&"number"==typeof r?(r=r>2?r-2:1,a&&a<=r?n:i(n,r)):n}},mixin:function(t){return function(e){
}),r}},runInContext:function(e){return function(r){return u(t,e(r),c)}}};if(!R)return x(e,r);var N=r,V=[];return M(T,function(t){M(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),M(S(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])}}),M(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=B),M(S(N),function(t){M(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),d=p.mutate,l=r(3); var r=this;if(!T(r))return t(r,Object(e));var n=[];return P(K(e),function(t){T(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),P(n,function(t){var e=t[1];T(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]]}),r}},rearg:function(t){return function(e,r){var n=r?r.length:0;return q(t(e,r),n)}},runInContext:function(e){return function(r){return l(t,e(r),d)}}};if(!k)return R(e,r);var H=r,J=[];return P(U,function(t){P(u.aryMethod[t],function(t){var e=H[u.remap[t]||t];e&&J.push([t,R(t,e)])})}),P(K(H),function(t){
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",omitAll:"omit", var e=H[t];if("function"==typeof e){for(var r=J.length;r--;)if(J[r][0]==t)return;e.convert=A(t,e),J.push([t,e])}}),P(J,function(t){H[t[0]]=t[1]}),H.convert=v,O&&(H.placeholder=L),P(K(H),function(t){P(u.realToAlias[t]||[],function(e){H[e]=H[t]})}),H}var u=r(2),p=u.mutate,f=r(3);t.exports=l},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",
nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",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"], conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",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",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",
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","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","nth","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"], pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],
2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","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","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","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","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"], 3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","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,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom: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, 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,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom: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],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,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],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0], transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInAllWith:[1,2,0],assignInWith:[1,2,0],assignAllWith:[1,2,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,2,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],unionBy:[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={}; unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{afterRearg:!0,start:1},assignInAll:{start:0},assignInAllWith:{afterRearg:!0,start:1},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{afterRearg:!0,start:1},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,
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",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart" pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!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={};
},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,zip:!0,zipObject:!0}},function(t,e){t.exports={}}])}); for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",
mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!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,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e){t.exports={}}])});

1353
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

245
dist/lodash.min.js vendored
View File

@@ -4,124 +4,127 @@
*/ */
;(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?t.length:0;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t?t.length:0;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=t?t.length:0;r--&&false!==n(t[r],r,t);); ;(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?t.length:0;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t?t.length:0;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=t?t.length:0;r--&&false!==n(t[r],r,t););
return t}function i(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(!n(t[r],r,t))return false;return true}function f(t,n){for(var r=-1,e=t?t.length:0,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function c(t,n){return!(!t||!t.length)&&-1<d(t,n,0)}function a(t,n,r){for(var e=-1,u=t?t.length:0;++e<u;)if(r(n,t[e]))return true;return false}function l(t,n){for(var r=-1,e=t?t.length:0,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function s(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function h(t,n,r,e){ return t}function i(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(!n(t[r],r,t))return false;return true}function f(t,n){for(var r=-1,e=t?t.length:0,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function c(t,n){return!(!t||!t.length)&&-1<d(t,n,0)}function a(t,n,r){for(var e=-1,u=t?t.length:0;++e<u;)if(r(n,t[e]))return true;return false}function l(t,n){for(var r=-1,e=t?t.length:0,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function s(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function h(t,n,r,e){
var u=-1,o=t?t.length:0;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function p(t,n,r,e){var u=t?t.length:0;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function _(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(n(t[r],r,t))return true;return false}function v(t,n,r){var e;return r(t,function(t,r,u){return n(t,r,u)?(e=r,false):void 0}),e}function g(t,n,r,e){var u=t.length;for(r+=e?1:-1;e?r--:++r<u;)if(n(t[r],r,t))return r;return-1}function d(t,n,r){if(n!==n)return M(t,r);--r;for(var e=t.length;++r<e;)if(t[r]===n)return r; var u=-1,o=t?t.length:0;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function p(t,n,r,e){var u=t?t.length:0;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function _(t,n){for(var r=-1,e=t?t.length:0;++r<e;)if(n(t[r],r,t))return true;return false}function v(t,n,r){var e;return r(t,function(t,r,u){if(n(t,r,u))return e=r,false}),e}function g(t,n,r,e){var u=t.length;for(r+=e?1:-1;e?r--:++r<u;)if(n(t[r],r,t))return r;return-1}function d(t,n,r){if(n!==n)return g(t,b,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?w(t,n)/r:V}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 w(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 m(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function A(t,n){return l(n,function(n){return[n,t[n]]; 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){return t!==t}function x(t,n){var r=t?t.length:0;return r?O(t,n)/r:q}function j(t){return function(n){return null==n?P:n[t]}}function w(t){return function(n){return null==t?P:t[n]}}function m(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=false,t):n(r,t,u,o)}),r}function A(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].c;return t}function O(t,n){for(var r,e=-1,u=t.length;++e<u;){var o=n(t[e]);o!==P&&(r=r===P?o:r+o);
})}function O(t){return function(n){return t(n)}}function k(t,n){return l(n,function(n){return t[n]})}function E(t,n){return t.has(n)}function S(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 R(t){return t&&t.Object===Object?t:null}function W(t){return zt[t]}function B(t){return Ut[t]}function L(t){return"\\"+Dt[t]}function M(t,n,r){var e=t.length;for(n+=r?1:-1;r?n--:++n<e;){var u=t[n];if(u!==u)return n}return-1; }return r}function k(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function E(t,n){return l(n,function(n){return[n,t[n]]})}function S(t){return function(n){return t(n)}}function R(t,n){return l(n,function(n){return t[n]})}function I(t,n){return t.has(n)}function W(t,n){for(var r=-1,e=t.length;++r<e&&-1<d(n,t[r],0););return r}function B(t,n){for(var r=t.length;r--&&-1<d(n,t[r],0););return r}function M(t){return"\\"+Ft[t]}function C(t){var n=false;if(null!=t&&typeof t.toString!="function")try{
}function C(t){var n=false;if(null!=t&&typeof t.toString!="function")try{n=!!(t+"")}catch(r){}return n}function z(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function U(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function $(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 D(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function F(t){ n=!!(t+"")}catch(t){}return n}function L(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function z(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function U(t){var n=Object;return function(r){return t(n(r))}}function D(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 $(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function F(t){
var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=[t,t]}),r}function N(t){if(!t||!Wt.test(t))return t.length;for(var n=It.lastIndex=0;It.test(t);)n++;return n}function P(t){return $t[t]}function Z(R){function At(t,n){return R.setTimeout.call(Kt,t,n)}function Ot(t){if(Te(t)&&!yi(t)&&!(t instanceof Ut)){if(t instanceof zt)return t;if(Wu.call(t,"__wrapped__"))return ae(t)}return new zt(t)}function kt(){}function zt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0, var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=[t,t]}),r}function T(t){if(!t||!Ct.test(t))return t.length;for(var n=Bt.lastIndex=0;Bt.test(t);)n++;return n}function N(w){function Et(t){return Qu.call(t)}function St(t,n){return w.setTimeout.call(qt,t,n)}function Rt(t){if(cu(t)&&!Pi(t)&&!(t instanceof Pt)){if(t instanceof Ft)return t;if(Ju.call(t,"__wrapped__"))return Ee(t)}return new Ft(t)}function $t(){}function Ft(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,
this.__values__=T}function Ut(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function $t(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 Dt(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 Pt(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){var n=-1,r=t?t.length:0; this.__values__=P}function Pt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Zt(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 Vt(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 Kt(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 Jt(t){var n=-1,r=t?t.length:0;
for(this.__data__=new Pt;++n<r;)this.add(t[n])}function qt(t){this.__data__=new Dt(t)}function Vt(t,n,r,e){return t===T||Ce(t,ku[r])&&!Wu.call(e,r)?n:t}function Jt(t,n,r){(r===T||Ce(t[n],r))&&(typeof n!="number"||r!==T||n in t)||(t[n]=r)}function Yt(t,n,r){var e=t[n];Wu.call(t,n)&&Ce(e,r)&&(r!==T||n in t)||(t[n]=r)}function Ht(t,n){for(var r=t.length;r--;)if(Ce(t[r][0],n))return r;return-1}function Qt(t,n,r,e){return Ao(t,function(t,u,o){n(e,t,r(t),o)}),e}function Xt(t,n){return t&&sr(n,iu(n),t)} for(this.__data__=new Kt;++n<r;)this.add(t[n])}function fn(t){this.__data__=new Vt(t)}function cn(t,n,r,e){return t===P||Xe(t,Zu[r])&&!Ju.call(e,r)?n:t}function an(t,n,r){(r===P||Xe(t[n],r))&&(typeof n!="number"||r!==P||n in t)||(t[n]=r)}function ln(t,n,r){var e=t[n];Ju.call(t,n)&&Xe(e,r)&&(r!==P||n in t)||(t[n]=r)}function sn(t,n){for(var r=t.length;r--;)if(Xe(t[r][0],n))return r;return-1}function hn(t,n,r,e){return qo(t,function(t,u,o){n(e,t,r(t),o)}),e}function pn(t,n){return t&&Wr(n,wu(n),t)}
function tn(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r<u;)o[r]=e?T:uu(t,n[r]);return o}function nn(t,n,r){return t===t&&(r!==T&&(t=r>=t?t:r),n!==T&&(t=t>=n?t:n)),t}function rn(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(!Ze(t))return t;if(o=yi(t)){if(c=Kr(t),!n)return lr(t,c)}else{var a=qr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(bi(t))return or(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=Gr(l?{}:t), function _n(t,n){for(var r=-1,e=null==t,u=n.length,o=Uu(u);++r<u;)o[r]=e?P:xu(t,n[r]);return o}function vn(t,n,r){return t===t&&(r!==P&&(t=t<=r?t:r),n!==P&&(t=t>=n?t:n)),t}function gn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==P)return c;if(!fu(t))return t;if(o=Pi(t)){if(c=se(t),!n)return Ir(t,c)}else{var a=Et(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(qi(t))return Or(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=he(l?{}:t),
!n)return hr(t,Xt(c,t))}else{if(!Ct[a])return i?t:{};c=Jr(t,a,rn,n)}}if(f||(f=new qt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?gn(t,iu,Tr):iu(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,rn(u,n,r,e,o,t,f))}),c}function en(t){var n=iu(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 un(t){return Ze(t)?Tu(t):{}}function on(t,n,r){if(typeof t!="function")throw new Au("Expected a function"); !n)return Br(t,pn(c,t))}else{if(!Dt[a])return i?t:{};c=pe(t,a,gn,n)}}if(f||(f=new fn),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?In(t,wu,ni):wu(t);return u(s||t,function(u,o){s&&(o=u,u=t[o]),ln(c,o,gn(u,n,r,e,o,t,f))}),r||f.delete(t),c}function dn(t){var n=wu(t);return function(r){return yn(r,t,n)}}function yn(t,n,r){var e=r.length;if(null==t)return!e;for(;e--;){var u=r[e],o=n[u],i=t[u];if(i===P&&!(u in Object(t))||!o(i))return false}return true}function bn(t){return fu(t)?fo(t):{}}function xn(t,n,r){
return At(function(){t.apply(T,r)},n)}function fn(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,O(r))),e?(o=a,i=false):n.length>=200&&(o=E,i=false,n=new Zt(n));t:for(;++u<f;){var p=t[u],_=r?r(p):p,p=e||0!==p?p:0;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 cn(t,n){var r=true;return Ao(t,function(t,e,u){return r=!!n(t,e,u)}),r}function an(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&&!Je(i):r(i,f)))var f=i,c=o; if(typeof t!="function")throw new Nu("Expected a function");return St(function(){t.apply(P,r)},n)}function jn(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,S(r))),e?(o=a,i=false):200<=n.length&&(o=I,i=false,n=new Jt(n));t:for(;++u<f;){var p=t[u],_=r?r(p):p,p=e||0!==p?p:0;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 wn(t,n){var r=true;return qo(t,function(t,e,u){return r=!!n(t,e,u)}),r}function mn(t,n,r){for(var e=-1,u=t.length;++e<u;){
}return c}function ln(t,n){var r=[];return Ao(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function sn(t,n,r,e,u){var o=-1,i=t.length;for(r||(r=Hr),u||(u=[]);++o<i;){var f=t[o];n>0&&r(f)?n>1?sn(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function hn(t,n){return t&&ko(t,n,iu)}function pn(t,n){return t&&Eo(t,n,iu)}function _n(t,n){return f(n,function(n){return Fe(t[n])})}function vn(t,n){n=ne(n,t)?[n]:er(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[fe(n[r++])];return r&&r==e?t:T}function gn(t,n,r){ var o=t[e],i=n(o);if(null!=i&&(f===P?i===i&&!hu(i):r(i,f)))var f=i,c=o}return c}function An(t,n){var r=[];return qo(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function On(t,n,r,e,u){var o=-1,i=t.length;for(r||(r=ve),u||(u=[]);++o<i;){var f=t[o];0<n&&r(f)?1<n?On(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function kn(t,n){return t&&Ko(t,n,wu)}function En(t,n){return t&&Go(t,n,wu)}function Sn(t,n){return f(n,function(n){return uu(t[n])})}function Rn(t,n){n=ye(n,t)?[n]:mr(n);for(var r=0,e=n.length;null!=t&&r<e;)t=t[Ae(n[r++])];
return n=n(t),yi(t)?n:s(n,r(t))}function dn(t,n){return t>n}function yn(t,n){return null!=t&&(Wu.call(t,n)||typeof t=="object"&&n in t&&null===Ju(Object(t)))}function bn(t,n){return null!=t&&n in Object(t)}function xn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,O(n))),s=to(p.length,s),f[i]=!r&&(n||u>=120&&p.length>=120)?new Zt(i&&p):T}var p=t[0],_=-1,v=f[0];t:for(;++_<u&&s>h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!E(v,d):!e(h,d,r)){ return r&&r==e?t:P}function In(t,n,r){return n=n(t),Pi(t)?n:s(n,r(t))}function Wn(t,n){return t>n}function Bn(t,n){return null!=t&&(Ju.call(t,n)||typeof t=="object"&&n in t&&null===ti(t))}function Mn(t,n){return null!=t&&n in Object(t)}function Cn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Uu(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,S(n))),s=jo(p.length,s),f[i]=!r&&(n||120<=u&&120<=p.length)?new Jt(i&&p):P}var p=t[0],_=-1,v=f[0];t:for(;++_<u&&h.length<s;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;
for(i=o;--i;){var y=f[i];if(y?!E(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function jn(t,n,r){var e={};return hn(t,function(t,u,o){n(e,r(t),u,o)}),e}function wn(t,n,e){return ne(n,t)||(n=er(n),t=ie(t,n),n=ve(n)),n=null==t?t:t[fe(n)],null==n?T:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Ze(t)&&!Te(n))n=t!==t&&n!==n;else t:{var o=yi(t),i=yi(n),f="[object Array]",c="[object Array]";o||(f=qr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=qr(n), if(v?!I(v,d):!e(h,d,r)){for(i=o;--i;){var y=f[i];if(y?!I(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function Ln(t,n,r){var e={};return kn(t,function(t,u,o){n(e,r(t),u,o)}),e}function zn(t,n,e){return ye(n,t)||(n=mr(n),t=me(t,n),n=Me(n)),n=null==t?t:t[Ae(n)],null==n?P:r(n,t,e)}function Un(t){return cu(t)&&"[object ArrayBuffer]"==Qu.call(t)}function Dn(t){return cu(t)&&"[object Date]"==Qu.call(t)}function $n(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!fu(t)&&!cu(n))n=t!==t&&n!==n;else t:{
c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!C(t),i="[object Object]"==c&&!C(n);if((c=f==c)&&!a)u||(u=new qt),n=o||Ye(t)?zr(t,n,mn,r,e,u):Ur(t,n,f,mn,r,e,u);else{if(!(2&e)&&(o=a&&Wu.call(t,"__wrapped__"),f=i&&Wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new qt),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new qt),o=2&e,f=iu(t),i=f.length,c=iu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:yn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{ var o=Pi(t),i=Pi(n),f="[object Array]",c="[object Array]";o||(f=Et(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Et(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!C(t),i="[object Object]"==c&&!C(n);if((c=f==c)&&!a)u||(u=new fn),n=o||Yi(t)?re(t,n,$n,r,e,u):ee(t,n,f,$n,r,e,u);else{if(!(2&e)&&(o=a&&Ju.call(t,"__wrapped__"),f=i&&Ju.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new fn),n=$n(t,n,r,e,u);break t}if(c)n:if(u||(u=new fn),o=2&e,
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&&!mn(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 An(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; f=wu(t),i=f.length,c=wu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:Bn(n,l))){n=false;break n}}if((c=u.get(t))&&u.get(n))n=c==n;else{c=true,u.set(t,n),u.set(n,t);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(_===P?h!==p&&!$n(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),
}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 qt,e)var s=e(a,l,c,t,n,f);if(s===T?!mn(l,a,e,3,f):!s)return false}}return true}function On(t){return!Ze(t)||Iu&&Iu in t?false:(Fe(t)||C(t)?zu:yt).test(ce(t))}function kn(t){return typeof t=="function"?t:null==t?pu:typeof t=="object"?yi(t)?Wn(t[0],t[1]):Rn(t):du(t)}function En(t){t=null==t?t:Object(t);var n,r=[];for(n in t)r.push(n);return r}function Sn(t,n){return n>t}function In(t,n){var r=-1,e=Ue(t)?Array(t.length):[]; n=c}}else n=false;else n=false}}return n}function Fn(t){return cu(t)&&"[object Map]"==Et(t)}function Tn(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===P&&!(c in t))return false}else{if(f=new fn,e)var s=e(a,l,c,t,n,f);if(s===P?!$n(l,a,e,3,f):!s)return false}}return true}function Nn(t){return!(!fu(t)||Ku&&Ku in t)&&(uu(t)||C(t)?to:jt).test(Oe(t))}function Pn(t){return fu(t)&&"[object RegExp]"==Qu.call(t);
return Ao(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function Rn(t){var n=Pr(t);return 1==n.length&&n[0][2]?ue(n[0][0],n[0][1]):function(r){return r===t||An(r,t,n)}}function Wn(t,n){return ne(t)&&n===n&&!Ze(n)?ue(fe(t),n):function(r){var e=uu(r,t);return e===T&&e===n?ou(r,t):mn(n,e,T,3)}}function Bn(t,n,r,e,o){if(t!==n){if(!yi(n)&&!Ye(n))var i=fu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Ze(u)){o||(o=new qt);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Jt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s, }function Zn(t){return cu(t)&&"[object Set]"==Et(t)}function qn(t){return cu(t)&&iu(t.length)&&!!Ut[Qu.call(t)]}function Vn(t){return typeof t=="function"?t:null==t?Iu:typeof t=="object"?Pi(t)?Hn(t[0],t[1]):Yn(t):Cu(t)}function Kn(t){t=null==t?t:Object(t);var n,r=[];for(n in t)r.push(n);return r}function Gn(t,n){return t<n}function Jn(t,n){var r=-1,e=nu(t)?Uu(t.length):[];return qo(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function Yn(t){var n=ce(t);return 1==n.length&&n[0][2]?je(n[0][0],n[0][1]):function(r){
yi(s)||Ye(s)?yi(l)?h=l:$e(l)?h=lr(l):(p=false,h=rn(s,true)):Ve(s)||ze(s)?ze(l)?h=ru(l):!Ze(l)||r&&Fe(l)?(p=false,h=rn(s,true)):h=l:p=false),a.set(s,h),p&&Bn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u),Jt(t,f,c)})}}function Ln(t,n){var r=t.length;return r?(n+=0>n?r:0,Xr(n,r)?t[n]:T):void 0}function Mn(t,n,r){var e=-1;return n=l(n.length?n:[pu],O(Fr())),t=In(t,function(t){return{a:l(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;){ return r===t||Tn(r,t,n)}}function Hn(t,n){return ye(t)&&n===n&&!fu(n)?je(Ae(t),n):function(r){var e=xu(r,t);return e===P&&e===n?ju(r,t):$n(n,e,P,3)}}function Qn(t,n,r,e,o){if(t!==n){if(!Pi(n)&&!Yi(n))var i=mu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),fu(u)){o||(o=new fn);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)an(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):P,p=h===P;p&&(h=s,Pi(s)||Yi(s)?Pi(l)?h=l:ru(l)?h=Ir(l):(p=false,h=gn(s,true)):lu(s)||tu(s)?tu(l)?h=yu(l):!fu(l)||r&&uu(l)?(p=false,h=gn(s,true)):h=l:p=false),
var c=fr(u[e],o[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Cn(t,n){return t=Object(t),h(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function zn(t,n){for(var r=-1,e=gn(t,fu,Bo),u=e.length,o={};++r<u;){var i=e[r],f=t[i];n(f,i)&&(o[i]=f)}return o}function Un(t){return function(n){return null==n?T:n[t]}}function $n(t){return function(n){return vn(n,t)}}function Dn(t,n,r,e){var u=e?y:d,o=-1,i=n.length,f=t;for(t===n&&(n=lr(n)),r&&(f=l(t,O(r)));++o<i;)for(var c=0,a=n[o],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==t&&Vu.call(f,c,1), p&&(a.set(s,h),Qn(h,s,r,e,a),a.delete(s)),an(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):P,c===P&&(c=u),an(t,f,c)})}}function Xn(t,n){var r=t.length;if(r)return n+=0>n?r:0,ge(n,r)?t[n]:P}function tr(t,n,r){var e=-1;return n=l(n.length?n:[Iu],S(ie())),t=Jn(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),A(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=Er(u[e],o[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function nr(t,n){
Vu.call(t,c,1);return t}function Fn(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(r==e||u!==o){var o=u;if(Xr(u))Vu.call(t,u,1);else if(ne(u,t))delete t[fe(u)];else{var u=er(u),i=ie(t,u);null!=i&&delete i[fe(ve(u))]}}}}function Nn(t,n){return t+Gu(ro()*(n-t+1))}function Pn(t,n){var r="";if(!t||1>n||n>9007199254740991)return r;do n%2&&(r+=t),(n=Gu(n/2))&&(t+=t);while(n);return r}function Zn(t,n,r,e){n=ne(n,t)?[n]:er(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){var c=fe(n[u]);if(Ze(f)){ return t=Object(t),rr(t,n,function(n,r){return r in t})}function rr(t,n,r){for(var e=-1,u=n.length,o={};++e<u;){var i=n[e],f=t[i];r(f,i)&&(o[i]=f)}return o}function er(t){return function(n){return Rn(n,t)}}function ur(t,n,r,e){var u=e?y:d,o=-1,i=n.length,f=t;for(t===n&&(n=Ir(n)),r&&(f=l(t,S(r)));++o<i;)for(var c=0,a=n[o],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==t&&ao.call(f,c,1),ao.call(t,c,1);return t}function or(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(r==e||u!==o){var o=u;if(ge(u))ao.call(t,u,1);else if(ye(u,t))delete t[Ae(u)];else{
var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):T;a===T&&(a=null==l?Xr(n[u+1])?[]:{}:l)}Yt(f,c,a)}f=f[c]}return t}function Tn(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 Vn(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];null!==i&&!Je(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u} var u=mr(u),i=me(t,u);null!=i&&delete i[Ae(Me(u))]}}}}function ir(t,n){return t+ho(mo()*(n-t+1))}function fr(t,n){var r="";if(!t||1>n||9007199254740991<n)return r;do n%2&&(r+=t),(n=ho(n/2))&&(t+=t);while(n);return r}function cr(t,n){return n=xo(n===P?t.length-1:n,0),function(){for(var e=arguments,u=-1,o=xo(e.length-n,0),i=Uu(o);++u<o;)i[u]=e[n+u];for(u=-1,o=Uu(n+1);++u<n;)o[u]=e[u];return o[n]=i,r(t,this,o)}}function ar(t,n,r,e){n=ye(n,t)?[n]:mr(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){
return Kn(t,n,pu,r)}function Kn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Je(n),a=n===T;o>u;){var l=Gu((u+o)/2),s=r(t[l]),h=s!==T,p=null===s,_=s===s,v=Je(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l}return to(o,4294967294)}function Gn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r],f=n?n(i):i;if(!r||!Ce(f,c)){var c=f;o[u++]=0===i?0:i}}return o}function Jn(t){return typeof t=="number"?t:Je(t)?V:+t}function Yn(t){if(typeof t=="string")return t; var c=Ae(n[u]);if(fu(f)){var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):P;a===P&&(a=null==l?ge(n[u+1])?[]:{}:l)}ln(f,c,a)}f=f[c]}return t}function lr(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=Uu(u);++e<u;)r[e]=t[e+n];return r}function sr(t,n){var r;return qo(t,function(t,e,u){return r=n(t,e,u),!r}),!!r}function hr(t,n,r){var e=0,u=t?t.length:e;if(typeof n=="number"&&n===n&&2147483647>=u){for(;e<u;){var o=e+u>>>1,i=t[o];null!==i&&!hu(i)&&(r?i<=n:i<n)?e=o+1:u=o;
if(Je(t))return mo?mo.call(t):"";var n=t+"";return"0"==n&&1/t==-q?"-0":n}function Hn(t,n,r){var e=-1,u=c,o=t.length,i=true,f=[],l=f;if(r)i=false,u=a;else if(o>=200){if(u=n?null:Io(t))return D(u);i=false,u=E,l=new Zt}else l=n?[]:f;t:for(;++e<o;){var s=t[e],h=n?n(s):s,s=r||0!==s?s:0;if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function Qn(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?Tn(t,e?0:o,e?o+1:u):Tn(t,e?o+1:0,e?u:o); }return u}return pr(t,n,Iu,r)}function pr(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=hu(n),a=n===P;u<o;){var l=ho((u+o)/2),s=r(t[l]),h=s!==P,p=null===s,_=s===s,v=hu(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?s<=n:s<n)?u=l+1:o=l}return jo(o,4294967294)}function _r(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r],f=n?n(i):i;if(!r||!Xe(f,c)){var c=f;o[u++]=0===i?0:i}}return o}function vr(t){return typeof t=="number"?t:hu(t)?q:+t}function gr(t){if(typeof t=="string")return t;
}function Xn(t,n){var r=t;return r instanceof Ut&&(r=r.value()),h(n,function(t,n){return n.func.apply(n.thisArg,s([t],n.args))},r)}function tr(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?s(fn(o,t[e],n,r),fn(t[e],o,n,r)):t[e];return o&&o.length?Hn(o,n,r):[]}function nr(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 rr(t){return $e(t)?t:[]}function er(t){return yi(t)?t:Co(t)}function ur(t,n,r){var e=t.length;return r=r===T?e:r,!n&&r>=e?t:Tn(t,n,r)}function or(t,n){ if(hu(t))return Zo?Zo.call(t):"";var n=t+"";return"0"==n&&1/t==-Z?"-0":n}function dr(t,n,r){var e=-1,u=c,o=t.length,i=true,f=[],l=f;if(r)i=false,u=a;else if(200<=o){if(u=n?null:Ho(t))return $(u);i=false,u=I,l=new Jt}else l=n?[]:f;t:for(;++e<o;){var s=t[e],h=n?n(s):s,s=r||0!==s?s:0;if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function yr(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?lr(t,e?0:o,e?o+1:u):lr(t,e?o+1:0,e?u:o);
if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ir(t){var n=new t.constructor(t.byteLength);return new Fu(n).set(new Fu(t)),n}function fr(t,n){if(t!==n){var r=t!==T,e=null===t,u=t===t,o=Je(t),i=n!==T,f=null===n,c=n===n,a=Je(n);if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function cr(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Xu(o-i,0),l=Array(c+a);for(e=!e;++f<c;)l[f]=n[f]; }function br(t,n){var r=t;return r instanceof Pt&&(r=r.value()),h(n,function(t,n){return n.func.apply(n.thisArg,s([t],n.args))},r)}function xr(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?s(jn(o,t[e],n,r),jn(t[e],o,n,r)):t[e];return o&&o.length?dr(o,n,r):[]}function jr(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;)r(i,t[e],e<o?n[e]:P);return i}function wr(t){return ru(t)?t:[]}function mr(t){return Pi(t)?t:ii(t)}function Ar(t,n,r){var e=t.length;return r=r===P?e:r,!n&&r>=e?t:lr(t,n,r)}function Or(t,n){
for(;++u<i;)(e||o>u)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function ar(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Xu(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 lr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function sr(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];Yt(r,i,f)}return r}function hr(t,n){return sr(t,Tr(t),n); if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function kr(t){var n=new t.constructor(t.byteLength);return new uo(n).set(new uo(t)),n}function Er(t,n){if(t!==n){var r=t!==P,e=null===t,u=t===t,o=hu(t),i=n!==P,f=null===n,c=n===n,a=hu(n);if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&t<n||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function Sr(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=xo(o-i,0),l=Uu(c+a);for(e=!e;++f<c;)l[f]=n[f];
}function pr(t,n){return function(r,u){var o=yi(r)?e:Qt,i=n?n():{};return o(r,t,Fr(u),i)}}function _r(t){return Me(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:T,i=u>2?r[2]:T,o=t.length>3&&typeof o=="function"?(u--,o):T;for(i&&te(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 vr(t,n){return function(r,e){if(null==r)return r;if(!Ue(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 gr(t){return function(n,r,e){ for(;++u<i;)(e||u<o)&&(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=xo(o-f,0),s=Uu(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||u<o)&&(s[l+r[i]]=t[u++]);return s}function Ir(t,n){var r=-1,e=t.length;for(n||(n=Uu(e));++r<e;)n[r]=t[r];return n}function Wr(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):P;ln(r,i,f===P?t[i]:f)}return r}function Br(t,n){return Wr(t,ni(t),n);
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 dr(t,n,r){function e(){return(this&&this!==Kt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=xr(t);return e}function yr(t){return function(n){n=eu(n);var r=Wt.test(n)?n.match(It):T,e=r?r[0]:n.charAt(0);return n=r?ur(r,1).join(""):n.slice(1),e[t]()+n}}function br(t){return function(n){return h(su(lu(n).replace(Et,"")),t,"")}}function xr(t){return function(){var n=arguments; }function Mr(t,n){return function(r,u){var o=Pi(r)?e:hn,i=n?n():{};return o(r,t,ie(u,2),i)}}function Cr(t){return cr(function(n,r){var e=-1,u=r.length,o=1<u?r[u-1]:P,i=2<u?r[2]:P,o=3<t.length&&typeof o=="function"?(u--,o):P;for(i&&de(r[0],r[1],i)&&(o=3>u?P:o,u=1),n=Object(n);++e<u;)(i=r[e])&&t(n,i,e,o);return n})}function Lr(t,n){return function(r,e){if(null==r)return r;if(!nu(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 zr(t){return function(n,r,e){
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=un(t.prototype),n=t.apply(r,n);return Ze(n)?n:r}}function jr(t,n,e){function u(){for(var i=arguments.length,f=Array(i),c=i,a=Dr(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:$(f,a), 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 Ur(t,n,r){function e(){return(this&&this!==qt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=Fr(t);return e}function Dr(t){return function(n){n=bu(n);var r=Ct.test(n)?n.match(Bt):P,e=r?r[0]:n.charAt(0);return n=r?Ar(r,1).join(""):n.slice(1),e[t]()+n}}function $r(t){return function(n){return h(Su(Eu(n).replace(It,"")),t,"")}}function Fr(t){return function(){var n=arguments;
i-=c.length,e>i?Br(t,n,Ar,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Kt&&this instanceof u?o:t,this,f)}var o=xr(t);return u}function wr(t){return function(n,r,e){var u=Object(n);if(r=Fr(r,3),!Ue(n))var o=iu(n);return e=t(o||n,function(t,n){return o&&(n=t,t=u[n]),r(t,n,u)},e),e>-1?n[o?o[e]:e]:T}}function mr(t){return Me(function(n){n=sn(n,1);var r=n.length,e=r,u=zt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new Au("Expected a function");if(u&&!i&&"wrapper"==$r(o))var i=new zt([],true); 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=bn(t.prototype),n=t.apply(r,n);return fu(n)?n:r}}function Tr(t,n,e){function u(){for(var i=arguments.length,f=Uu(i),c=i,a=oe(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:D(f,a),
}for(e=i?e:r;++e<r;)var o=n[e],u=$r(o),f="wrapper"==u?Ro(o):T,i=f&&re(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[$r(f[0])].apply(i,f[3]):1==o.length&&re(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&yi(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 Ar(t,n,r,e,u,o,i,f,c,a){function l(){for(var d=arguments.length,y=Array(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=Dr(l),b=y.length;for(x=0;b--;)y[b]===j&&x++; i-=c.length,i<e?Qr(t,n,Zr,u.placeholder,P,f,c,P,P,e-i):r(this&&this!==qt&&this instanceof u?o:t,this,f)}var o=Fr(t);return u}function Nr(t){return function(n,r,e){var u=Object(n);if(!nu(n)){var o=ie(r,3);n=wu(n),r=function(t){return o(u[t],t,u)}}return r=t(n,r,e),-1<r?u[o?n[r]:r]:P}}function Pr(t){return cr(function(n){n=On(n,1);var r=n.length,e=r,u=Ft.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new Nu("Expected a function");if(u&&!i&&"wrapper"==ue(o))var i=new Ft([],(true));
}if(e&&(y=cr(y,e,u,_)),o&&(y=ar(y,o,i,_)),d-=x,_&&a>d)return j=$(y,j),Br(t,n,Ar,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[t]:t,d=y.length,f){x=y.length;for(var w=to(f.length,x),m=lr(y);w--;){var A=f[w];y[w]=Xr(A,x)?m[A]:T}}else v&&d>1&&y.reverse();return s&&d>c&&(y.length=c),this&&this!==Kt&&this instanceof l&&(b=g||xr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:xr(t);return l}function Or(t,n){return function(r,e){return jn(r,t,n(e))}}function kr(t){return function(n,r){var e; }for(e=i?e:r;++e<r;)var o=n[e],u=ue(o),f="wrapper"==u?Qo(o):P,i=f&&be(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[ue(f[0])].apply(i,f[3]):1==o.length&&be(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&Pi(e)&&200<=e.length)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 Zr(t,n,r,e,u,o,i,f,c,a){function l(){for(var d=arguments.length,y=Uu(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=oe(l),b=y.length;for(x=0;b--;)y[b]===j&&x++;
if(n===T&&r===T)return 0;if(n!==T&&(e=n),r!==T){if(e===T)return r;typeof n=="string"||typeof r=="string"?(n=Yn(n),r=Yn(r)):(n=Jn(n),r=Jn(r)),e=t(n,r)}return e}}function Er(t){return Me(function(n){return n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr())),Me(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Sr(t,n){n=n===T?" ":Yn(n);var r=n.length;return 2>r?r?Pn(n,t):n:(r=Pn(n,Ku(t/N(n))),Wt.test(n)?ur(r.match(It),0,t).join(""):r.slice(0,t))}function Ir(t,n,e,u){ }if(e&&(y=Sr(y,e,u,_)),o&&(y=Rr(y,o,i,_)),d-=x,_&&d<a)return j=D(y,j),Qr(t,n,Zr,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[t]:t,d=y.length,f){x=y.length;for(var w=jo(f.length,x),m=Ir(y);w--;){var A=f[w];y[w]=ge(A,x)?m[A]:P}}else v&&1<d&&y.reverse();return s&&c<d&&(y.length=c),this&&this!==qt&&this instanceof l&&(b=g||Fr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?P:Fr(t);return l}function qr(t,n){return function(r,e){return Ln(r,t,n(e))}}function Vr(t,n){return function(r,e){
function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Kt&&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=xr(t);return o}function Rr(t){return function(n,r,e){e&&typeof e!="number"&&te(n,r,e)&&(r=e=T),n=nu(n),n=n===n?n:0,r===T?(r=n,n=0):r=nu(r)||0,e=e===T?r>n?1:-1:nu(e)||0;var u=-1;r=Xu(Ku((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Wr(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=nu(n), var u;if(r===P&&e===P)return n;if(r!==P&&(u=r),e!==P){if(u===P)return e;typeof r=="string"||typeof e=="string"?(r=gr(r),e=gr(e)):(r=vr(r),e=vr(e)),u=t(r,e)}return u}}function Kr(t){return cr(function(n){return n=1==n.length&&Pi(n[0])?l(n[0],S(ie())):l(On(n,1),S(ie())),cr(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Gr(t,n){n=n===P?" ":gr(n);var r=n.length;return 2>r?r?fr(n,t):n:(r=fr(n,so(t/T(n))),Ct.test(n)?Ar(r.match(Bt),0,t).join(""):r.slice(0,t))}function Jr(t,n,e,u){
r=nu(r)),t(n,r)}}function Br(t,n,r,e,u,o,i,f,c,a){var l=8&n,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),re(t)&&Mo(r,n),r.placeholder=e,r}function Lr(t){var n=wu[t];return function(t,r){if(t=nu(t),r=to(Xe(r),292)){var e=(eu(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(eu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Mr(t){return function(n){var r=qr(n);return"[object Map]"==r?U(n):"[object Set]"==r?F(n):A(n,t(n)); function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Uu(l+c),h=this&&this!==qt&&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=Fr(t);return o}function Yr(t){return function(n,r,e){e&&typeof e!="number"&&de(n,r,e)&&(r=e=P),n=du(n),n=n===n?n:0,r===P?(r=n,n=0):r=du(r)||0,e=e===P?n<r?1:-1:du(e)||0;var u=-1;r=xo(so((r-n)/(e||1)),0);for(var o=Uu(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Hr(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=du(n),
}}function Cr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new Au("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Xu(Xe(i),0),f=f===T?f:Xe(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:Ro(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?cr(e,r,h[4]):r,o[4]=e?$(o[3],"__lodash_placeholder__"):h[4]), r=du(r)),t(n,r)}}function Qr(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:P;i=l?P:i;var h=l?o:P;return o=l?P:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),u=[t,n,u,h,s,o,i,f,c,a],r=r.apply(P,u),be(t)&&ui(r,u),r.placeholder=e,oi(r,t,n)}function Xr(t){var n=Fu[t];return function(t,r){if(t=du(t),r=jo(vu(r),292)){var e=(bu(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(bu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function te(t){return function(n){var r=Et(n);return"[object Map]"==r?z(n):"[object Set]"==r?F(n):E(n,t(n));
(r=h[5])&&(e=o[5],o[5]=e?ar(e,r,h[6]):r,o[6]=e?$(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:to(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:Xu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?So:Mo)(n&&1!=n?8==n||16==n?jr(t,n,f):32!=n&&33!=n||u.length?Ar.apply(T,o):Ir(t,n,r,e):dr(t,n,r),o)}function zr(t,n,r,e,u,o){var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if(c=o.get(t))return c==n; }}function ne(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new Nu("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=P),i=i===P?i:xo(vu(i),0),f=f===P?f:vu(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=P}var h=c?P:Qo(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&&o[7].length<=h[8]||384==t&&h[7].length<=h[8]&&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?Sr(e,r,h[4]):r,o[4]=e?D(o[3],"__lodash_placeholder__"):h[4]),
var c=-1,a=true,l=1&u?new Zt:T;for(o.set(t,n);++c<f;){var s=t[c],h=n[c];if(e)var p=i?e(h,s,c,n,t,o):e(s,h,c,t,n,o);if(p!==T){if(p)continue;a=false;break}if(l){if(!_(n,function(t,n){return l.has(n)||s!==t&&!r(s,t,e,u,o)?void 0:l.add(n)})){a=false;break}}else if(s!==h&&!r(s,h,e,u,o)){a=false;break}}return o["delete"](t),a}function Ur(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 Fu(t),new Fu(n)))break; (r=h[5])&&(e=o[5],o[5]=e?Rr(e,r,h[6]):r,o[6]=e?D(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:jo(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:xo(o[9]-a,0),!f&&24&n&&(n&=-25),oi((h?Yo:ui)(n&&1!=n?8==n||16==n?Tr(t,n,f):32!=n&&33!=n||u.length?Zr.apply(P,o):Jr(t,n,r,e):Ur(t,n,r),o),t,n)}function re(t,n,r,e,u,o){var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if((c=o.get(t))&&o.get(n))return c==n;
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=U;case"[object Set]":if(f||(f=D),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),zr(f(t),f(n),e,u,o,i));case"[object Symbol]":if(wo)return wo.call(t)==wo.call(n)}return false}function $r(t){for(var n=t.name+"",r=_o[n],e=Wu.call(_o,n)?r.length:0;e--;){ var c=-1,a=true,l=1&u?new Jt:P;for(o.set(t,n),o.set(n,t);++c<f;){var s=t[c],h=n[c];if(e)var p=i?e(h,s,c,n,t,o):e(s,h,c,t,n,o);if(p!==P){if(p)continue;a=false;break}if(l){if(!_(n,function(t,n){if(!l.has(n)&&(s===t||r(s,t,e,u,o)))return l.add(n)})){a=false;break}}else if(s!==h&&!r(s,h,e,u,o)){a=false;break}}return o.delete(t),a}function ee(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 uo(t),new uo(n)))break;
var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function Dr(t){return(Wu.call(Ot,"placeholder")?Ot:t).placeholder}function Fr(){var t=Ot.iteratee||_u,t=t===_u?kn:t;return arguments.length?t(arguments[0],arguments[1]):t}function Nr(t,n){var r=t.__data__,e=typeof n;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n)?r[typeof n=="string"?"string":"hash"]:r.map}function Pr(t){for(var n=iu(t),r=n.length;r--;){var e=n[r],u=t[e];n[r]=[e,u,u===u&&!Ze(u)]}return n; return true;case"[object Boolean]":case"[object Date]":case"[object Number]":return Xe(+t,+n);case"[object Error]":return t.name==n.name&&t.message==n.message;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var f=z;case"[object Set]":if(f||(f=$),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),n=re(f(t),f(n),e,u,o,i),i.delete(t),n);case"[object Symbol]":if(Po)return Po.call(t)==Po.call(n)}return false}function ue(t){for(var n=t.name+"",r=zo[n],e=Ju.call(zo,n)?r.length:0;e--;){
}function Zr(t,n){var r=null==t?T:t[n];return On(r)?r:T}function Tr(t){return Pu(Object(t))}function qr(t){return Mu.call(t)}function Vr(t,n,r){n=ne(n,t)?[n]:er(n);for(var e,u=-1,o=n.length;++u<o;){var i=fe(n[u]);if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&Pe(o)&&Xr(i,o)&&(yi(t)||Ge(t)||ze(t)))}function Kr(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&Wu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Gr(t){return typeof t.constructor!="function"||ee(t)?{}:un(Ju(Object(t))); var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function oe(t){return(Ju.call(Rt,"placeholder")?Rt:t).placeholder}function ie(){var t=Rt.iteratee||Wu,t=t===Wu?Vn:t;return arguments.length?t(arguments[0],arguments[1]):t}function fe(t,n){var r=t.__data__,e=typeof n;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n)?r[typeof n=="string"?"string":"hash"]:r.map}function ce(t){for(var n=wu(t),r=n.length;r--;){var e=n[r],u=t[e];n[r]=[e,u,u===u&&!fu(u)]}return n;
}function Jr(r,e,u,o){var i=r.constructor;switch(e){case"[object ArrayBuffer]":return ir(r);case"[object Boolean]":case"[object Date]":return new i(+r);case"[object DataView]":return e=o?ir(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]": }function ae(t,n){var r=null==t?P:t[n];return Nn(r)?r:P}function le(t,n,r){n=ye(n,t)?[n]:mr(n);for(var e,u=-1,o=n.length;++u<o;){var i=Ae(n[u]);if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&iu(o)&&ge(i,o)&&(Pi(t)||su(t)||tu(t)))}function se(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&Ju.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function he(t){return typeof t.constructor!="function"||xe(t)?{}:bn(ti(t))}function pe(r,e,u,o){var i=r.constructor;
return e=o?ir(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);case"[object Map]":return e=o?u(U(r),true):U(r),h(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(D(r),true):D(r),h(e,n,new r.constructor);case"[object Symbol]":return wo?Object(wo.call(r)):{}}}function Yr(t){var n=t?t.length:T;return Pe(n)&&(yi(t)||Ge(t)||ze(t))?m(n,String):null; switch(e){case"[object ArrayBuffer]":return kr(r);case"[object Boolean]":case"[object Date]":return new i((+r));case"[object DataView]":return e=o?kr(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?kr(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);
}function Hr(t){return yi(t)||ze(t)}function Qr(t){return yi(t)&&!(2==t.length&&!Fe(t[0]))}function Xr(t,n){return n=null==n?9007199254740991:n,!!n&&(typeof t=="number"||xt.test(t))&&t>-1&&0==t%1&&n>t}function te(t,n,r){if(!Ze(r))return false;var e=typeof n;return("number"==e?Ue(r)&&Xr(n,r.length):"string"==e&&n in r)?Ce(r[n],t):false}function ne(t,n){if(yi(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Je(t)?true:ut.test(t)||!et.test(t)||null!=n&&t in Object(n)}function re(t){ case"[object Map]":return e=o?u(z(r),true):z(r),h(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,dt.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=o?u($(r),true):$(r),h(e,n,new r.constructor);case"[object Symbol]":return Po?Object(Po.call(r)):{}}}function _e(t){var n=t?t.length:P;return iu(n)&&(Pi(t)||su(t)||tu(t))?k(n,String):null}function ve(t){return Pi(t)||tu(t)||!!(lo&&t&&t[lo])}function ge(t,n){
var n=$r(t),r=Ot[n];return typeof r=="function"&&n in Ut.prototype?t===r?true:(n=Ro(r),!!n&&t===n[0]):false}function ee(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||ku)}function ue(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function oe(t,n,r,e,u,o){return Ze(t)&&Ze(n)&&Bn(t,n,T,oe,o.set(n,t)),t}function ie(t,n){return 1==n.length?t:vn(t,Tn(n,0,-1))}function fe(t){if(typeof t=="string"||Je(t))return t;var n=t+"";return"0"==n&&1/t==-q?"-0":n}function ce(t){ return n=null==n?9007199254740991:n,!!n&&(typeof t=="number"||mt.test(t))&&-1<t&&0==t%1&&t<n}function de(t,n,r){if(!fu(r))return false;var e=typeof n;return!!("number"==e?nu(r)&&ge(n,r.length):"string"==e&&n in r)&&Xe(r[n],t)}function ye(t,n){if(Pi(t))return false;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!hu(t))||(ut.test(t)||!et.test(t)||null!=n&&t in Object(n))}function be(t){var n=ue(t),r=Rt[n];return typeof r=="function"&&n in Pt.prototype&&(t===r||(n=Qo(r),!!n&&t===n[0]));
if(null!=t){try{return Ru.call(t)}catch(n){}return t+""}return""}function ae(t){if(t instanceof Ut)return t.clone();var n=new zt(t.__wrapped__,t.__chain__);return n.__actions__=lr(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function le(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),Tn(t,0>n?0:n,e)):[]}function se(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0,0>n?0:n)):[]}function he(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:Xe(r),0>r&&(r=Xu(e+r,0)), }function xe(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||Zu)}function je(t,n){return function(r){return null!=r&&(r[t]===n&&(n!==P||t in Object(r)))}}function we(t,n,r,e,u,o){return fu(t)&&fu(n)&&(o.set(n,t),Qn(t,n,P,we,o),o.delete(n)),t}function me(t,n){return 1==n.length?t:Rn(t,lr(n,0,-1))}function Ae(t){if(typeof t=="string"||hu(t))return t;var n=t+"";return"0"==n&&1/t==-Z?"-0":n}function Oe(t){if(null!=t){try{return Gu.call(t)}catch(t){}return t+""}return""}function ke(t,n){
g(t,Fr(n,3),r)):-1}function pe(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==T&&(u=Xe(r),u=0>r?Xu(e+u,0):to(u,e-1)),g(t,Fr(n,3),u,true)}function _e(t){return t&&t.length?t[0]:T}function ve(t){var n=t?t.length:0;return n?t[n-1]:T}function ge(t,n){return t&&t.length&&n&&n.length?Dn(t,n):t}function de(t){return t?uo.call(t):t}function ye(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){return $e(t)?(n=Xu(t.length,n),true):void 0}),m(n,function(n){return l(t,Un(n))})}function be(t,n){ return u(V,function(r){var e="_."+r[0];n&r[1]&&!c(t,e)&&t.push(e)}),t.sort()}function Ee(t){if(t instanceof Pt)return t.clone();var n=new Ft(t.__wrapped__,t.__chain__);return n.__actions__=Ir(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function Se(t,n,r){var e=t?t.length:0;return e?(n=r||n===P?1:vu(n),lr(t,0>n?0:n,e)):[]}function Re(t,n,r){var e=t?t.length:0;return e?(n=r||n===P?1:vu(n),n=e-n,lr(t,0,0>n?0:n)):[]}function Ie(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:vu(r),
if(!t||!t.length)return[];var e=ye(t);return null==n?e:l(e,function(t){return r(n,T,t)})}function xe(t){return t=Ot(t),t.__chain__=true,t}function je(t,n){return n(t)}function we(){return this}function me(t,n){return(yi(t)?u:Ao)(t,Fr(n,3))}function Ae(t,n){return(yi(t)?o:Oo)(t,Fr(n,3))}function Oe(t,n){return(yi(t)?l:In)(t,Fr(n,3))}function ke(t,n,r){var e=-1,u=He(t),o=u.length,i=o-1;for(n=(r?te(t,n,r):n===T)?1:nn(Xe(n),0,o);++e<n;)t=Nn(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,u}function Ee(){ 0>r&&(r=xo(e+r,0)),g(t,ie(n,3),r)):-1}function We(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==P&&(u=vu(r),u=0>r?xo(e+u,0):jo(u,e-1)),g(t,ie(n,3),u,true)}function Be(t){return t&&t.length?t[0]:P}function Me(t){var n=t?t.length:0;return n?t[n-1]:P}function Ce(t,n){return t&&t.length&&n&&n.length?ur(t,n):t}function Le(t){return t?Oo.call(t):t}function ze(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){if(ru(t))return n=xo(t.length,n),true}),k(n,function(n){return l(t,j(n));
return xu.now()}function Se(t,n,r){return n=r?T:n,n=t&&null==n?t.length:n,Cr(t,128,T,T,T,T,n)}function Ie(t,n){var r;if(typeof n!="function")throw new Au("Expected a function");return t=Xe(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=T),r}}function Re(t,n,r){return n=r?T:n,t=Cr(t,8,T,T,T,T,T,n),t.placeholder=Re.placeholder,t}function We(t,n,r){return n=r?T:n,t=Cr(t,16,T,T,T,T,T,n),t.placeholder=We.placeholder,t}function Be(t,n,r){function e(n){var r=c,e=a;return c=a=T,_=n,s=t.apply(e,r); })}function Ue(t,n){if(!t||!t.length)return[];var e=ze(t);return null==n?e:l(e,function(t){return r(n,P,t)})}function De(t){return t=Rt(t),t.__chain__=true,t}function $e(t,n){return n(t)}function Fe(){return this}function Te(t,n){return(Pi(t)?u:qo)(t,ie(n,3))}function Ne(t,n){return(Pi(t)?o:Vo)(t,ie(n,3))}function Pe(t,n){return(Pi(t)?l:Jn)(t,ie(n,3))}function Ze(t,n,r){var e=-1,u=pu(t),o=u.length,i=o-1;for(n=(r?de(t,n,r):n===P)?1:vn(vu(n),0,o);++e<n;)t=ir(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,
}function u(t){var r=t-p;return t-=_,p===T||r>=n||0>r||g&&t>=l}function o(){var t=Ee();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?to(t,l-r):t,h=At(o,r)}function i(t){return h=T,d&&c?e(t):(c=a=T,s)}function f(){var t=Ee(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===T)return _=t=p,h=At(o,n),v?e(t):s;if(g)return h=At(o,n),e(p)}return h===T&&(h=At(o,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Au("Expected a function");return n=nu(n)||0,Ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Xu(nu(r.maxWait)||0,n):l, u}function qe(){return Du.now()}function Ve(t,n,r){return n=r?P:n,n=t&&null==n?t.length:n,ne(t,128,P,P,P,P,n)}function Ke(t,n){var r;if(typeof n!="function")throw new Nu("Expected a function");return t=vu(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=P),r}}function Ge(t,n,r){return n=r?P:n,t=ne(t,8,P,P,P,P,P,n),t.placeholder=Ge.placeholder,t}function Je(t,n,r){return n=r?P:n,t=ne(t,16,P,P,P,P,P,n),t.placeholder=Je.placeholder,t}function Ye(t,n,r){function e(n){var r=c,e=a;return c=a=P,
d="trailing"in r?!!r.trailing:d),f.cancel=function(){_=0,c=p=a=h=T},f.flush=function(){return h===T?s:i(Ee())},f}function Le(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 Au("Expected a function");return r.cache=new(Le.Cache||Pt),r}function Me(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=Xu(n===T?t.length-1:Xe(n),0),function(){ _=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,p===P||r>=n||0>r||g&&t>=l}function o(){var t=qe();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?jo(t,l-r):t,h=St(o,r)}function i(t){return h=P,d&&c?e(t):(c=a=P,s)}function f(){var t=qe(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===P)return _=t=p,h=St(o,n),v?e(t):s;if(g)return h=St(o,n),e(p)}return h===P&&(h=St(o,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Nu("Expected a function");return n=du(n)||0,fu(r)&&(v=!!r.leading,
for(var e=arguments,u=-1,o=Xu(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 Ce(t,n){return t===n||t!==t&&n!==n}function ze(t){return $e(t)&&Wu.call(t,"callee")&&(!qu.call(t,"callee")||"[object Arguments]"==Mu.call(t))}function Ue(t){return null!=t&&Pe(Wo(t))&&!Fe(t)}function $e(t){return Te(t)&&Ue(t)}function De(t){ l=(g="maxWait"in r)?xo(du(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==P&&w.clearTimeout.call(qt,h),_=0,c=p=a=h=P},f.flush=function(){return h===P?s:i(qe())},f}function He(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 Nu("Expected a function");return r.cache=new(He.Cache||Kt),r}function Qe(t){if(typeof t!="function")throw new Nu("Expected a function");
return Te(t)?"[object Error]"==Mu.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Fe(t){return t=Ze(t)?Mu.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function Ne(t){return typeof t=="number"&&t==Xe(t)}function Pe(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t}function Ze(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Te(t){return!!t&&typeof t=="object"}function qe(t){return typeof t=="number"||Te(t)&&"[object Number]"==Mu.call(t); return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function Xe(t,n){return t===n||t!==t&&n!==n}function tu(t){return ru(t)&&Ju.call(t,"callee")&&(!co.call(t,"callee")||"[object Arguments]"==Qu.call(t))}function nu(t){return null!=t&&iu(Xo(t))&&!uu(t)}function ru(t){return cu(t)&&nu(t)}function eu(t){return!!cu(t)&&("[object Error]"==Qu.call(t)||typeof t.message=="string"&&typeof t.name=="string");
}function Ve(t){return!Te(t)||"[object Object]"!=Mu.call(t)||C(t)?false:(t=Ju(Object(t)),null===t?true:(t=Wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&Ru.call(t)==Lu))}function Ke(t){return Ze(t)&&"[object RegExp]"==Mu.call(t)}function Ge(t){return typeof t=="string"||!yi(t)&&Te(t)&&"[object String]"==Mu.call(t)}function Je(t){return typeof t=="symbol"||Te(t)&&"[object Symbol]"==Mu.call(t)}function Ye(t){return Te(t)&&Pe(t.length)&&!!Mt[Mu.call(t)]}function He(t){if(!t)return[]; }function uu(t){return t=fu(t)?Qu.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function ou(t){return typeof t=="number"&&t==vu(t)}function iu(t){return typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t}function fu(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function cu(t){return!!t&&typeof t=="object"}function au(t){return typeof t=="number"||cu(t)&&"[object Number]"==Qu.call(t)}function lu(t){return!(!cu(t)||"[object Object]"!=Qu.call(t)||C(t))&&(t=ti(t),null===t||(t=Ju.call(t,"constructor")&&t.constructor,
if(Ue(t))return Ge(t)?t.match(It):lr(t);if(Zu&&t[Zu])return z(t[Zu]());var n=qr(t);return("[object Map]"==n?U:"[object Set]"==n?D:cu)(t)}function Qe(t){return t?(t=nu(t),t===q||t===-q?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function Xe(t){t=Qe(t);var n=t%1;return t===t?n?t-n:t:0}function tu(t){return t?nn(Xe(t),0,4294967295):0}function nu(t){if(typeof t=="number")return t;if(Je(t))return V;if(Ze(t)&&(t=Fe(t.valueOf)?t.valueOf():t,t=Ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t; typeof t=="function"&&t instanceof t&&Gu.call(t)==Hu))}function su(t){return typeof t=="string"||!Pi(t)&&cu(t)&&"[object String]"==Qu.call(t)}function hu(t){return typeof t=="symbol"||cu(t)&&"[object Symbol]"==Qu.call(t)}function pu(t){if(!t)return[];if(nu(t))return su(t)?t.match(Bt):Ir(t);if(io&&t[io])return L(t[io]());var n=Et(t);return("[object Map]"==n?z:"[object Set]"==n?$:Ou)(t)}function _u(t){return t?(t=du(t),t===Z||t===-Z?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function vu(t){
t=t.replace(ct,"");var n=dt.test(t);return n||bt.test(t)?Nt(t.slice(2),n?2:8):gt.test(t)?V:+t}function ru(t){return sr(t,fu(t))}function eu(t){return null==t?"":Yn(t)}function uu(t,n,r){return t=null==t?T:vn(t,n),t===T?r:t}function ou(t,n){return null!=t&&Vr(t,n,bn)}function iu(t){var n=ee(t);if(!n&&!Ue(t))return Qu(Object(t));var r,e=Yr(t),u=!!e,e=e||[],o=e.length;for(r in t)!yn(t,r)||u&&("length"==r||Xr(r,o))||n&&"constructor"==r||e.push(r);return e}function fu(t){for(var n=-1,r=ee(t),e=En(t),u=e.length,o=Yr(t),i=!!o,o=o||[],f=o.length;++n<u;){ t=_u(t);var n=t%1;return t===t?n?t-n:t:0}function gu(t){return t?vn(vu(t),0,4294967295):0}function du(t){if(typeof t=="number")return t;if(hu(t))return q;if(fu(t)&&(t=uu(t.valueOf)?t.valueOf():t,t=fu(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ct,"");var n=xt.test(t);return n||wt.test(t)?Nt(t.slice(2),n?2:8):bt.test(t)?q:+t}function yu(t){return Wr(t,mu(t))}function bu(t){return null==t?"":gr(t)}function xu(t,n,r){return t=null==t?P:Rn(t,n),t===P?r:t}function ju(t,n){return null!=t&&le(t,n,Mn);
var c=e[n];i&&("length"==c||Xr(c,f))||"constructor"==c&&(r||!Wu.call(t,c))||o.push(c)}return o}function cu(t){return t?k(t,iu(t)):[]}function au(t){return qi(eu(t).toLowerCase())}function lu(t){return(t=eu(t))&&t.replace(jt,W).replace(St,"")}function su(t,n,r){return t=eu(t),n=r?T:n,n===T&&(n=Bt.test(t)?Rt:st),t.match(n)||[]}function hu(t){return function(){return t}}function pu(t){return t}function _u(t){return kn(typeof t=="function"?t:rn(t,true))}function vu(t,n,r){var e=iu(n),o=_n(n,e);null!=r||Ze(n)&&(o.length||!e.length)||(r=n, }function wu(t){var n=xe(t);if(!n&&!nu(t))return Jo(t);var r,e=_e(t),u=!!e,e=e||[],o=e.length;for(r in t)!Bn(t,r)||u&&("length"==r||ge(r,o))||n&&"constructor"==r||e.push(r);return e}function mu(t){for(var n=-1,r=xe(t),e=Kn(t),u=e.length,o=_e(t),i=!!o,o=o||[],f=o.length;++n<u;){var c=e[n];i&&("length"==c||ge(c,f))||"constructor"==c&&(r||!Ju.call(t,c))||o.push(c)}return o}function Au(t,n){return null==t?{}:rr(t,In(t,mu,ri),ie(n))}function Ou(t){return t?R(t,wu(t)):[]}function ku(t){return mf(bu(t).toLowerCase());
n=t,t=this,o=_n(n,iu(n)));var i=!(Ze(r)&&"chain"in r&&!r.chain),f=Fe(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__=lr(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function gu(){}function du(t){return ne(t)?Un(fe(t)):$n(t)}function yu(){return[]}function bu(){return false}R=R?Gt.defaults({},R,Gt.pick(Kt,Lt)):Kt;var xu=R.Date,ju=R.Error,wu=R.Math,mu=R.RegExp,Au=R.TypeError,Ou=R.Array.prototype,ku=R.Object.prototype,Eu=R.String.prototype,Su=R["__core-js_shared__"],Iu=function(){ }function Eu(t){return(t=bu(t))&&t.replace(At,rn).replace(Wt,"")}function Su(t,n,r){return t=bu(t),n=r?P:n,n===P&&(n=Lt.test(t)?Mt:_t),t.match(n)||[]}function Ru(t){return function(){return t}}function Iu(t){return t}function Wu(t){return Vn(typeof t=="function"?t:gn(t,true))}function Bu(t,n,r){var e=wu(n),o=Sn(n,e);null!=r||fu(n)&&(o.length||!e.length)||(r=n,n=t,t=this,o=Sn(n,wu(n)));var i=!(fu(r)&&"chain"in r&&!r.chain),f=uu(t);return u(o,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){
var t=/[^.]+$/.exec(Su&&Su.keys&&Su.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ru=R.Function.prototype.toString,Wu=ku.hasOwnProperty,Bu=0,Lu=Ru.call(Object),Mu=ku.toString,Cu=Kt._,zu=mu("^"+Ru.call(Wu).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Uu=Tt?R.Buffer:T,$u=R.Reflect,Du=R.Symbol,Fu=R.Uint8Array,Nu=$u?$u.f:T,Pu=Object.getOwnPropertySymbols,Zu=typeof(Zu=Du&&Du.iterator)=="symbol"?Zu:T,Tu=Object.create,qu=ku.propertyIsEnumerable,Vu=Ou.splice,Ku=wu.ceil,Gu=wu.floor,Ju=Object.getPrototypeOf,Yu=R.isFinite,Hu=Ou.join,Qu=Object.keys,Xu=wu.max,to=wu.min,no=R.parseInt,ro=wu.random,eo=Eu.replace,uo=Ou.reverse,oo=Eu.split,io=Zr(R,"DataView"),fo=Zr(R,"Map"),co=Zr(R,"Promise"),ao=Zr(R,"Set"),lo=Zr(R,"WeakMap"),so=Zr(Object,"create"),ho=lo&&new lo,po=!qu.call({ var n=this.__chain__;if(i||n){var r=t(this.__wrapped__);return(r.__actions__=Ir(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function Mu(){}function Cu(t){return ye(t)?j(Ae(t)):er(t)}function Lu(){return[]}function zu(){return false}w=w?on.defaults({},w,on.pick(qt,zt)):qt;var Uu=w.Array,Du=w.Date,$u=w.Error,Fu=w.Math,Tu=w.RegExp,Nu=w.TypeError,Pu=w.Array.prototype,Zu=w.Object.prototype,qu=w.String.prototype,Vu=w["__core-js_shared__"],Ku=function(){
valueOf:1},"valueOf"),_o={},vo=ce(io),go=ce(fo),yo=ce(co),bo=ce(ao),xo=ce(lo),jo=Du?Du.prototype:T,wo=jo?jo.valueOf:T,mo=jo?jo.toString:T;Ot.templateSettings={escape:tt,evaluate:nt,interpolate:rt,variable:"",imports:{_:Ot}},Ot.prototype=kt.prototype,Ot.prototype.constructor=Ot,zt.prototype=un(kt.prototype),zt.prototype.constructor=zt,Ut.prototype=un(kt.prototype),Ut.prototype.constructor=Ut,$t.prototype.clear=function(){this.__data__=so?so(null):{}},$t.prototype["delete"]=function(t){return this.has(t)&&delete this.__data__[t]; var t=/[^.]+$/.exec(Vu&&Vu.keys&&Vu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Gu=w.Function.prototype.toString,Ju=Zu.hasOwnProperty,Yu=0,Hu=Gu.call(Object),Qu=Zu.toString,Xu=qt._,to=Tu("^"+Gu.call(Ju).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),no=Gt?w.Buffer:P,ro=w.Reflect,eo=w.Symbol,uo=w.Uint8Array,oo=ro?ro.g:P,io=eo?eo.iterator:P,fo=w.Object.create,co=Zu.propertyIsEnumerable,ao=Pu.splice,lo=eo?eo.isConcatSpreadable:P,so=Fu.ceil,ho=Fu.floor,po=Object.getPrototypeOf,_o=Object.getOwnPropertySymbols,vo=no?no.isBuffer:P,go=w.isFinite,yo=Pu.join,bo=Object.keys,xo=Fu.max,jo=Fu.min,wo=w.parseInt,mo=Fu.random,Ao=qu.replace,Oo=Pu.reverse,ko=qu.split,Eo=ae(w,"DataView"),So=ae(w,"Map"),Ro=ae(w,"Promise"),Io=ae(w,"Set"),Wo=ae(w,"WeakMap"),Bo=ae(w.Object,"create"),Mo=function(){
},$t.prototype.get=function(t){var n=this.__data__;return so?(t=n[t],"__lodash_hash_undefined__"===t?T:t):Wu.call(n,t)?n[t]:T},$t.prototype.has=function(t){var n=this.__data__;return so?n[t]!==T:Wu.call(n,t)},$t.prototype.set=function(t,n){return this.__data__[t]=so&&n===T?"__lodash_hash_undefined__":n,this},Dt.prototype.clear=function(){this.__data__=[]},Dt.prototype["delete"]=function(t){var n=this.__data__;return t=Ht(n,t),0>t?false:(t==n.length-1?n.pop():Vu.call(n,t,1),true)},Dt.prototype.get=function(t){ var t=ae(w.Object,"defineProperty"),n=ae.name;return n&&2<n.length?t:P}(),Co=Wo&&new Wo,Lo=!co.call({valueOf:1},"valueOf"),zo={},Uo=Oe(Eo),Do=Oe(So),$o=Oe(Ro),Fo=Oe(Io),To=Oe(Wo),No=eo?eo.prototype:P,Po=No?No.valueOf:P,Zo=No?No.toString:P;Rt.templateSettings={escape:tt,evaluate:nt,interpolate:rt,variable:"",imports:{_:Rt}},Rt.prototype=$t.prototype,Rt.prototype.constructor=Rt,Ft.prototype=bn($t.prototype),Ft.prototype.constructor=Ft,Pt.prototype=bn($t.prototype),Pt.prototype.constructor=Pt,Zt.prototype.clear=function(){
var n=this.__data__;return t=Ht(n,t),0>t?T:n[t][1]},Dt.prototype.has=function(t){return-1<Ht(this.__data__,t)},Dt.prototype.set=function(t,n){var r=this.__data__,e=Ht(r,t);return 0>e?r.push([t,n]):r[e][1]=n,this},Pt.prototype.clear=function(){this.__data__={hash:new $t,map:new(fo||Dt),string:new $t}},Pt.prototype["delete"]=function(t){return Nr(this,t)["delete"](t)},Pt.prototype.get=function(t){return Nr(this,t).get(t)},Pt.prototype.has=function(t){return Nr(this,t).has(t)},Pt.prototype.set=function(t,n){ this.__data__=Bo?Bo(null):{}},Zt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Zt.prototype.get=function(t){var n=this.__data__;return Bo?(t=n[t],"__lodash_hash_undefined__"===t?P:t):Ju.call(n,t)?n[t]:P},Zt.prototype.has=function(t){var n=this.__data__;return Bo?n[t]!==P:Ju.call(n,t)},Zt.prototype.set=function(t,n){return this.__data__[t]=Bo&&n===P?"__lodash_hash_undefined__":n,this},Vt.prototype.clear=function(){this.__data__=[]},Vt.prototype.delete=function(t){var n=this.__data__;
return Nr(this,t).set(t,n),this},Zt.prototype.add=Zt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Zt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.clear=function(){this.__data__=new Dt},qt.prototype["delete"]=function(t){return this.__data__["delete"](t)},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,n){var r=this.__data__;return r instanceof Dt&&200==r.__data__.length&&(r=this.__data__=new Pt(r.__data__)), return t=sn(n,t),!(0>t)&&(t==n.length-1?n.pop():ao.call(n,t,1),true)},Vt.prototype.get=function(t){var n=this.__data__;return t=sn(n,t),0>t?P:n[t][1]},Vt.prototype.has=function(t){return-1<sn(this.__data__,t)},Vt.prototype.set=function(t,n){var r=this.__data__,e=sn(r,t);return 0>e?r.push([t,n]):r[e][1]=n,this},Kt.prototype.clear=function(){this.__data__={hash:new Zt,map:new(So||Vt),string:new Zt}},Kt.prototype.delete=function(t){return fe(this,t).delete(t)},Kt.prototype.get=function(t){return fe(this,t).get(t);
r.set(t,n),this};var Ao=vr(hn),Oo=vr(pn,true),ko=gr(),Eo=gr(true);Nu&&!qu.call({valueOf:1},"valueOf")&&(En=function(t){return z(Nu(t))});var So=ho?function(t,n){return ho.set(t,n),t}:pu,Io=ao&&1/D(new ao([,-0]))[1]==q?function(t){return new ao(t)}:gu,Ro=ho?function(t){return ho.get(t)}:gu,Wo=Un("length");Pu||(Tr=yu);var Bo=Pu?function(t){for(var n=[];t;)s(n,Tr(t)),t=Ju(Object(t));return n}:Tr;(io&&"[object DataView]"!=qr(new io(new ArrayBuffer(1)))||fo&&"[object Map]"!=qr(new fo)||co&&"[object Promise]"!=qr(co.resolve())||ao&&"[object Set]"!=qr(new ao)||lo&&"[object WeakMap]"!=qr(new lo))&&(qr=function(t){ },Kt.prototype.has=function(t){return fe(this,t).has(t)},Kt.prototype.set=function(t,n){return fe(this,t).set(t,n),this},Jt.prototype.add=Jt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Jt.prototype.has=function(t){return this.__data__.has(t)},fn.prototype.clear=function(){this.__data__=new Vt},fn.prototype.delete=function(t){return this.__data__.delete(t)},fn.prototype.get=function(t){return this.__data__.get(t)},fn.prototype.has=function(t){return this.__data__.has(t);
var n=Mu.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?ce(t):T)switch(t){case vo:return"[object DataView]";case go:return"[object Map]";case yo:return"[object Promise]";case bo:return"[object Set]";case xo:return"[object WeakMap]"}return n});var Lo=Su?Fe:bu,Mo=function(){var t=0,n=0;return function(r,e){var u=Ee(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return So(r,e)}}(),Co=Le(function(t){var n=[];return eu(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}), },fn.prototype.set=function(t,n){var r=this.__data__;if(r instanceof Vt){if(r=r.__data__,!So||199>r.length)return r.push([t,n]),this;r=this.__data__=new Kt(r)}return r.set(t,n),this};var qo=Lr(kn),Vo=Lr(En,true),Ko=zr(),Go=zr(true),Jo=U(bo);oo&&!co.call({valueOf:1},"valueOf")&&(Kn=function(t){return L(oo(t))});var Yo=Co?function(t,n){return Co.set(t,n),t}:Iu,Ho=Io&&1/$(new Io([,-0]))[1]==Z?function(t){return new Io(t)}:Mu,Qo=Co?function(t){return Co.get(t)}:Mu,Xo=j("length"),ti=U(po),ni=_o?U(_o):Lu,ri=_o?function(t){
n}),zo=Me(function(t,n){return $e(t)?fn(t,sn(n,1,$e,true)):[]}),Uo=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),Fr(r)):[]}),$o=Me(function(t,n){var r=ve(n);return $e(r)&&(r=T),$e(t)?fn(t,sn(n,1,$e,true),T,r):[]}),Do=Me(function(t){var n=l(t,rr);return n.length&&n[0]===t[0]?xn(n):[]}),Fo=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,Fr(n)):[]}),No=Me(function(t){var n=ve(t),r=l(t,rr);return n===ve(r)?n=T:r.pop(),r.length&&r[0]===t[0]?xn(r,T,n):[]; for(var n=[];t;)s(n,ni(t)),t=ti(t);return n}:ni;(Eo&&"[object DataView]"!=Et(new Eo(new ArrayBuffer(1)))||So&&"[object Map]"!=Et(new So)||Ro&&"[object Promise]"!=Et(Ro.resolve())||Io&&"[object Set]"!=Et(new Io)||Wo&&"[object WeakMap]"!=Et(new Wo))&&(Et=function(t){var n=Qu.call(t);if(t=(t="[object Object]"==n?t.constructor:P)?Oe(t):P)switch(t){case Uo:return"[object DataView]";case Do:return"[object Map]";case $o:return"[object Promise]";case Fo:return"[object Set]";case To:return"[object WeakMap]";
}),Po=Me(ge),Zo=Me(function(t,n){n=sn(n,1);var r=t?t.length:0,e=tn(t,n);return Fn(t,l(n,function(t){return Xr(t,r)?+t:t}).sort(fr)),e}),To=Me(function(t){return Hn(sn(t,1,$e,true))}),qo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),Fr(n))}),Vo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),Hn(sn(t,1,$e,true),T,n)}),Ko=Me(function(t,n){return $e(t)?fn(t,n):[]}),Go=Me(function(t){return tr(f(t,$e))}),Jo=Me(function(t){var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),Fr(n))}),Yo=Me(function(t){ }return n});var ei=Vu?uu:zu,ui=function(){var t=0,n=0;return function(r,e){var u=qe(),o=16-(u-n);if(n=u,0<o){if(150<=++t)return r}else t=0;return Yo(r,e)}}(),oi=Mo?function(t,n,r){n+="";var e;e=(e=n.match(ht))?e[1].split(pt):[],r=ke(e,r),e=r.length;var u=e-1;return r[u]=(1<e?"& ":"")+r[u],r=r.join(2<e?", ":" "),n=n.replace(st,"{\n/* [wrapped with "+r+"] */\n"),Mo(t,"toString",{configurable:true,enumerable:false,value:Ru(n)})}:Iu,ii=He(function(t){var n=[];return bu(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(vt,"$1"):r||t);
var n=ve(t);return $e(n)&&(n=T),tr(f(t,$e),T,n)}),Ho=Me(ye),Qo=Me(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return be(t,n)}),Xo=Me(function(t){function n(n){return tn(n,t)}t=sn(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Ut&&Xr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:je,args:[n],thisArg:T}),new zt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),ti=pr(function(t,n,r){ }),n}),fi=cr(function(t,n){return ru(t)?jn(t,On(n,1,ru,true)):[]}),ci=cr(function(t,n){var r=Me(n);return ru(r)&&(r=P),ru(t)?jn(t,On(n,1,ru,true),ie(r,2)):[]}),ai=cr(function(t,n){var r=Me(n);return ru(r)&&(r=P),ru(t)?jn(t,On(n,1,ru,true),P,r):[]}),li=cr(function(t){var n=l(t,wr);return n.length&&n[0]===t[0]?Cn(n):[]}),si=cr(function(t){var n=Me(t),r=l(t,wr);return n===Me(r)?n=P:r.pop(),r.length&&r[0]===t[0]?Cn(r,ie(n,2)):[]}),hi=cr(function(t){var n=Me(t),r=l(t,wr);return n===Me(r)?n=P:r.pop(),r.length&&r[0]===t[0]?Cn(r,P,n):[];
Wu.call(t,r)?++t[r]:t[r]=1}),ni=wr(he),ri=wr(pe),ei=pr(function(t,n,r){Wu.call(t,r)?t[r].push(n):t[r]=[n]}),ui=Me(function(t,n,e){var u=-1,o=typeof n=="function",i=ne(n),f=Ue(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):wn(t,n,e)}),f}),oi=pr(function(t,n,r){t[r]=n}),ii=pr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),fi=Me(function(t,n){if(null==t)return[];var r=n.length;return r>1&&te(t,n[0],n[1])?n=[]:r>2&&te(n[0],n[1],n[2])&&(n=[n[0]]), }),pi=cr(Ce),_i=cr(function(t,n){n=On(n,1);var r=t?t.length:0,e=_n(t,n);return or(t,l(n,function(t){return ge(t,r)?+t:t}).sort(Er)),e}),vi=cr(function(t){return dr(On(t,1,ru,true))}),gi=cr(function(t){var n=Me(t);return ru(n)&&(n=P),dr(On(t,1,ru,true),ie(n,2))}),di=cr(function(t){var n=Me(t);return ru(n)&&(n=P),dr(On(t,1,ru,true),P,n)}),yi=cr(function(t,n){return ru(t)?jn(t,n):[]}),bi=cr(function(t){return xr(f(t,ru))}),xi=cr(function(t){var n=Me(t);return ru(n)&&(n=P),xr(f(t,ru),ie(n,2))}),ji=cr(function(t){
n=1==n.length&&yi(n[0])?n[0]:sn(n,1,Qr),Mn(t,n,[])}),ci=Me(function(t,n,r){var e=1;if(r.length)var u=$(r,Dr(ci)),e=32|e;return Cr(t,e,n,r,u)}),ai=Me(function(t,n,r){var e=3;if(r.length)var u=$(r,Dr(ai)),e=32|e;return Cr(n,e,t,r,u)}),li=Me(function(t,n){return on(t,1,n)}),si=Me(function(t,n,r){return on(t,nu(n)||0,r)});Le.Cache=Pt;var hi=Me(function(t,n){n=1==n.length&&yi(n[0])?l(n[0],O(Fr())):l(sn(n,1,Qr),O(Fr()));var e=n.length;return Me(function(u){for(var o=-1,i=to(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]); var n=Me(t);return ru(n)&&(n=P),xr(f(t,ru),P,n)}),wi=cr(ze),mi=cr(function(t){var n=t.length,n=1<n?t[n-1]:P,n=typeof n=="function"?(t.pop(),n):P;return Ue(t,n)}),Ai=cr(function(t){function n(n){return _n(n,t)}t=On(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(1<r||this.__actions__.length)&&u instanceof Pt&&ge(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:$e,args:[n],thisArg:P}),new Ft(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(P),t})):this.thru(n)}),Oi=Mr(function(t,n,r){
return r(t,this,u)})}),pi=Me(function(t,n){var r=$(n,Dr(pi));return Cr(t,32,T,n,r)}),_i=Me(function(t,n){var r=$(n,Dr(_i));return Cr(t,64,T,n,r)}),vi=Me(function(t,n){return Cr(t,256,T,T,T,sn(n,1))}),gi=Wr(dn),di=Wr(function(t,n){return t>=n}),yi=Array.isArray,bi=Uu?function(t){return t instanceof Uu}:bu,xi=Wr(Sn),ji=Wr(function(t,n){return n>=t}),wi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,iu(n),t);else for(var r in n)Wu.call(n,r)&&Yt(t,r,n[r])}),mi=_r(function(t,n){if(po||ee(n)||Ue(n))sr(n,fu(n),t);else for(var r in n)Yt(t,r,n[r]); Ju.call(t,r)?++t[r]:t[r]=1}),ki=Nr(Ie),Ei=Nr(We),Si=Mr(function(t,n,r){Ju.call(t,r)?t[r].push(n):t[r]=[n]}),Ri=cr(function(t,n,e){var u=-1,o=typeof n=="function",i=ye(n),f=nu(t)?Uu(t.length):[];return qo(t,function(t){var c=o?n:i&&null!=t?t[n]:P;f[++u]=c?r(c,t,e):zn(t,n,e)}),f}),Ii=Mr(function(t,n,r){t[r]=n}),Wi=Mr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Bi=cr(function(t,n){if(null==t)return[];var r=n.length;return 1<r&&de(t,n[0],n[1])?n=[]:2<r&&de(n[0],n[1],n[2])&&(n=[n[0]]),
}),Ai=_r(function(t,n,r,e){sr(n,fu(n),t,e)}),Oi=_r(function(t,n,r,e){sr(n,iu(n),t,e)}),ki=Me(function(t,n){return tn(t,sn(n,1))}),Ei=Me(function(t){return t.push(T,Vt),r(Ai,T,t)}),Si=Me(function(t){return t.push(T,oe),r(Li,T,t)}),Ii=Or(function(t,n,r){t[n]=r},hu(pu)),Ri=Or(function(t,n,r){Wu.call(t,n)?t[n].push(r):t[n]=[r]},Fr),Wi=Me(wn),Bi=_r(function(t,n,r){Bn(t,n,r)}),Li=_r(function(t,n,r,e){Bn(t,n,r,e)}),Mi=Me(function(t,n){return null==t?{}:(n=l(sn(n,1),fe),Cn(t,fn(gn(t,fu,Bo),n)))}),Ci=Me(function(t,n){ tr(t,On(n,1),[])}),Mi=cr(function(t,n,r){var e=1;if(r.length)var u=D(r,oe(Mi)),e=32|e;return ne(t,e,n,r,u)}),Ci=cr(function(t,n,r){var e=3;if(r.length)var u=D(r,oe(Ci)),e=32|e;return ne(n,e,t,r,u)}),Li=cr(function(t,n){return xn(t,1,n)}),zi=cr(function(t,n,r){return xn(t,du(n)||0,r)});He.Cache=Kt;var Ui=cr(function(t,n){n=1==n.length&&Pi(n[0])?l(n[0],S(ie())):l(On(n,1),S(ie()));var e=n.length;return cr(function(u){for(var o=-1,i=jo(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]);return r(t,this,u)});
return null==t?{}:Cn(t,l(sn(n,1),fe))}),zi=Mr(iu),Ui=Mr(fu),$i=br(function(t,n,r){return n=n.toLowerCase(),t+(r?au(n):n)}),Di=br(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Fi=br(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Ni=yr("toLowerCase"),Pi=br(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Zi=br(function(t,n,r){return t+(r?" ":"")+qi(n)}),Ti=br(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),qi=yr("toUpperCase"),Vi=Me(function(t,n){try{return r(t,T,n)}catch(e){ }),Di=cr(function(t,n){var r=D(n,oe(Di));return ne(t,32,P,n,r)}),$i=cr(function(t,n){var r=D(n,oe($i));return ne(t,64,P,n,r)}),Fi=cr(function(t,n){return ne(t,256,P,P,P,On(n,1))}),Ti=Hr(Wn),Ni=Hr(function(t,n){return t>=n}),Pi=Uu.isArray,Zi=Yt?S(Yt):Un,qi=vo||zu,Vi=Ht?S(Ht):Dn,Ki=Qt?S(Qt):Fn,Gi=Xt?S(Xt):Pn,Ji=tn?S(tn):Zn,Yi=nn?S(nn):qn,Hi=Hr(Gn),Qi=Hr(function(t,n){return t<=n}),Xi=Cr(function(t,n){if(Lo||xe(n)||nu(n))Wr(n,wu(n),t);else for(var r in n)Ju.call(n,r)&&ln(t,r,n[r])}),tf=Cr(function(t,n){
return De(e)?e:new ju(e)}}),Ki=Me(function(t,n){return u(sn(n,1),function(n){n=fe(n),t[n]=ci(t[n],t)}),t}),Gi=mr(),Ji=mr(true),Yi=Me(function(t,n){return function(r){return wn(r,t,n)}}),Hi=Me(function(t,n){return function(r){return wn(t,r,n)}}),Qi=Er(l),Xi=Er(i),tf=Er(_),nf=Rr(),rf=Rr(true),ef=kr(function(t,n){return t+n}),uf=Lr("ceil"),of=kr(function(t,n){return t/n}),ff=Lr("floor"),cf=kr(function(t,n){return t*n}),af=Lr("round"),lf=kr(function(t,n){return t-n});return Ot.after=function(t,n){if(typeof n!="function")throw new Au("Expected a function"); if(Lo||xe(n)||nu(n))Wr(n,mu(n),t);else for(var r in n)ln(t,r,n[r])}),nf=Cr(function(t,n,r,e){Wr(n,mu(n),t,e)}),rf=Cr(function(t,n,r,e){Wr(n,wu(n),t,e)}),ef=cr(function(t,n){return _n(t,On(n,1))}),uf=cr(function(t){return t.push(P,cn),r(nf,P,t)}),of=cr(function(t){return t.push(P,we),r(sf,P,t)}),ff=qr(function(t,n,r){t[n]=r},Ru(Iu)),cf=qr(function(t,n,r){Ju.call(t,n)?t[n].push(r):t[n]=[r]},ie),af=cr(zn),lf=Cr(function(t,n,r){Qn(t,n,r)}),sf=Cr(function(t,n,r,e){Qn(t,n,r,e)}),hf=cr(function(t,n){return null==t?{}:(n=l(On(n,1),Ae),
return t=Xe(t),function(){return 1>--t?n.apply(this,arguments):void 0}},Ot.ary=Se,Ot.assign=wi,Ot.assignIn=mi,Ot.assignInWith=Ai,Ot.assignWith=Oi,Ot.at=ki,Ot.before=Ie,Ot.bind=ci,Ot.bindAll=Ki,Ot.bindKey=ai,Ot.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return yi(t)?t:[t]},Ot.chain=xe,Ot.chunk=function(t,n,r){if(n=(r?te(t,n,r):n===T)?1:Xu(Xe(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Ku(r/n));r>e;)o[u++]=Tn(t,e,e+=n);return o},Ot.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++n<r;){ nr(t,jn(In(t,mu,ri),n)))}),pf=cr(function(t,n){return null==t?{}:nr(t,l(On(n,1),Ae))}),_f=te(wu),vf=te(mu),gf=$r(function(t,n,r){return n=n.toLowerCase(),t+(r?ku(n):n)}),df=$r(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),yf=$r(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),bf=Dr("toLowerCase"),xf=$r(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),jf=$r(function(t,n,r){return t+(r?" ":"")+mf(n)}),wf=$r(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),mf=Dr("toUpperCase"),Af=cr(function(t,n){
var o=t[n];o&&(u[e++]=o)}return u},Ot.concat=function(){for(var t=arguments.length,n=Array(t?t-1:0),r=arguments[0],e=t;e--;)n[e-1]=arguments[e];return t?s(yi(r)?lr(r):[r],sn(n,1)):[]},Ot.cond=function(t){var n=t?t.length:0,e=Fr();return t=n?l(t,function(t){if("function"!=typeof t[1])throw new Au("Expected a function");return[e(t[0]),t[1]]}):[],Me(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e)}})},Ot.conforms=function(t){return en(rn(t,true))},Ot.constant=hu,Ot.countBy=ti, try{return r(t,P,n)}catch(t){return eu(t)?t:new $u(t)}}),Of=cr(function(t,n){return u(On(n,1),function(n){n=Ae(n),t[n]=Mi(t[n],t)}),t}),kf=Pr(),Ef=Pr(true),Sf=cr(function(t,n){return function(r){return zn(r,t,n)}}),Rf=cr(function(t,n){return function(r){return zn(t,r,n)}}),If=Kr(l),Wf=Kr(i),Bf=Kr(_),Mf=Yr(),Cf=Yr(true),Lf=Vr(function(t,n){return t+n},0),zf=Xr("ceil"),Uf=Vr(function(t,n){return t/n},1),Df=Xr("floor"),$f=Vr(function(t,n){return t*n},1),Ff=Xr("round"),Tf=Vr(function(t,n){return t-n},0);return Rt.after=function(t,n){
Ot.create=function(t,n){var r=un(t);return n?Xt(r,n):r},Ot.curry=Re,Ot.curryRight=We,Ot.debounce=Be,Ot.defaults=Ei,Ot.defaultsDeep=Si,Ot.defer=li,Ot.delay=si,Ot.difference=zo,Ot.differenceBy=Uo,Ot.differenceWith=$o,Ot.drop=le,Ot.dropRight=se,Ot.dropRightWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),true,true):[]},Ot.dropWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),true):[]},Ot.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&te(t,n,r)&&(r=0,e=u),u=t.length, if(typeof n!="function")throw new Nu("Expected a function");return t=vu(t),function(){if(1>--t)return n.apply(this,arguments)}},Rt.ary=Ve,Rt.assign=Xi,Rt.assignIn=tf,Rt.assignInWith=nf,Rt.assignWith=rf,Rt.at=ef,Rt.before=Ke,Rt.bind=Mi,Rt.bindAll=Of,Rt.bindKey=Ci,Rt.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Pi(t)?t:[t]},Rt.chain=De,Rt.chunk=function(t,n,r){if(n=(r?de(t,n,r):n===P)?1:xo(vu(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Uu(so(r/n));e<r;)o[u++]=lr(t,e,e+=n);
r=Xe(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Xe(e),0>e&&(e+=u),e=r>e?0:tu(e);e>r;)t[r++]=n;return t},Ot.filter=function(t,n){return(yi(t)?f:ln)(t,Fr(n,3))},Ot.flatMap=function(t,n){return sn(Oe(t,n),1)},Ot.flatMapDeep=function(t,n){return sn(Oe(t,n),q)},Ot.flatMapDepth=function(t,n,r){return r=r===T?1:Xe(r),sn(Oe(t,n),r)},Ot.flatten=function(t){return t&&t.length?sn(t,1):[]},Ot.flattenDeep=function(t){return t&&t.length?sn(t,q):[]},Ot.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Xe(n),sn(t,n)):[]; return o},Rt.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},Rt.concat=function(){for(var t=arguments.length,n=Uu(t?t-1:0),r=arguments[0],e=t;e--;)n[e-1]=arguments[e];return t?s(Pi(r)?Ir(r):[r],On(n,1)):[]},Rt.cond=function(t){var n=t?t.length:0,e=ie();return t=n?l(t,function(t){if("function"!=typeof t[1])throw new Nu("Expected a function");return[e(t[0]),t[1]]}):[],cr(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e);
},Ot.flip=function(t){return Cr(t,512)},Ot.flow=Gi,Ot.flowRight=Ji,Ot.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},Ot.functions=function(t){return null==t?[]:_n(t,iu(t))},Ot.functionsIn=function(t){return null==t?[]:_n(t,fu(t))},Ot.groupBy=ei,Ot.initial=function(t){return se(t,1)},Ot.intersection=Do,Ot.intersectionBy=Fo,Ot.intersectionWith=No,Ot.invert=Ii,Ot.invertBy=Ri,Ot.invokeMap=ui,Ot.iteratee=_u,Ot.keyBy=oi,Ot.keys=iu,Ot.keysIn=fu,Ot.map=Oe, }})},Rt.conforms=function(t){return dn(gn(t,true))},Rt.constant=Ru,Rt.countBy=Oi,Rt.create=function(t,n){var r=bn(t);return n?pn(r,n):r},Rt.curry=Ge,Rt.curryRight=Je,Rt.debounce=Ye,Rt.defaults=uf,Rt.defaultsDeep=of,Rt.defer=Li,Rt.delay=zi,Rt.difference=fi,Rt.differenceBy=ci,Rt.differenceWith=ai,Rt.drop=Se,Rt.dropRight=Re,Rt.dropRightWhile=function(t,n){return t&&t.length?yr(t,ie(n,3),true,true):[]},Rt.dropWhile=function(t,n){return t&&t.length?yr(t,ie(n,3),true):[]},Rt.fill=function(t,n,r,e){var u=t?t.length:0;
Ot.mapKeys=function(t,n){var r={};return n=Fr(n,3),hn(t,function(t,e,u){r[n(t,e,u)]=t}),r},Ot.mapValues=function(t,n){var r={};return n=Fr(n,3),hn(t,function(t,e,u){r[e]=n(t,e,u)}),r},Ot.matches=function(t){return Rn(rn(t,true))},Ot.matchesProperty=function(t,n){return Wn(t,rn(n,true))},Ot.memoize=Le,Ot.merge=Bi,Ot.mergeWith=Li,Ot.method=Yi,Ot.methodOf=Hi,Ot.mixin=vu,Ot.negate=function(t){if(typeof t!="function")throw new Au("Expected a function");return function(){return!t.apply(this,arguments)}},Ot.nthArg=function(t){ if(!u)return[];for(r&&typeof r!="number"&&de(t,n,r)&&(r=0,e=u),u=t.length,r=vu(r),0>r&&(r=-r>u?0:u+r),e=e===P||e>u?u:vu(e),0>e&&(e+=u),e=r>e?0:gu(e);r<e;)t[r++]=n;return t},Rt.filter=function(t,n){return(Pi(t)?f:An)(t,ie(n,3))},Rt.flatMap=function(t,n){return On(Pe(t,n),1)},Rt.flatMapDeep=function(t,n){return On(Pe(t,n),Z)},Rt.flatMapDepth=function(t,n,r){return r=r===P?1:vu(r),On(Pe(t,n),r)},Rt.flatten=function(t){return t&&t.length?On(t,1):[]},Rt.flattenDeep=function(t){return t&&t.length?On(t,Z):[];
return t=Xe(t),Me(function(n){return Ln(n,t)})},Ot.omit=Mi,Ot.omitBy=function(t,n){return n=Fr(n),zn(t,function(t,r){return!n(t,r)})},Ot.once=function(t){return Ie(2,t)},Ot.orderBy=function(t,n,r,e){return null==t?[]:(yi(n)||(n=null==n?[]:[n]),r=e?T:r,yi(r)||(r=null==r?[]:[r]),Mn(t,n,r))},Ot.over=Qi,Ot.overArgs=hi,Ot.overEvery=Xi,Ot.overSome=tf,Ot.partial=pi,Ot.partialRight=_i,Ot.partition=ii,Ot.pick=Ci,Ot.pickBy=function(t,n){return null==t?{}:zn(t,Fr(n))},Ot.property=du,Ot.propertyOf=function(t){ },Rt.flattenDepth=function(t,n){return t&&t.length?(n=n===P?1:vu(n),On(t,n)):[]},Rt.flip=function(t){return ne(t,512)},Rt.flow=kf,Rt.flowRight=Ef,Rt.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},Rt.functions=function(t){return null==t?[]:Sn(t,wu(t))},Rt.functionsIn=function(t){return null==t?[]:Sn(t,mu(t))},Rt.groupBy=Si,Rt.initial=function(t){return Re(t,1)},Rt.intersection=li,Rt.intersectionBy=si,Rt.intersectionWith=hi,Rt.invert=ff,Rt.invertBy=cf,
return function(n){return null==t?T:vn(t,n)}},Ot.pull=Po,Ot.pullAll=ge,Ot.pullAllBy=function(t,n,r){return t&&t.length&&n&&n.length?Dn(t,n,Fr(r)):t},Ot.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?Dn(t,n,T,r):t},Ot.pullAt=Zo,Ot.range=nf,Ot.rangeRight=rf,Ot.rearg=vi,Ot.reject=function(t,n){var r=yi(t)?f:ln;return n=Fr(n,3),r(t,function(t,r,e){return!n(t,r,e)})},Ot.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=Fr(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i), Rt.invokeMap=Ri,Rt.iteratee=Wu,Rt.keyBy=Ii,Rt.keys=wu,Rt.keysIn=mu,Rt.map=Pe,Rt.mapKeys=function(t,n){var r={};return n=ie(n,3),kn(t,function(t,e,u){r[n(t,e,u)]=t}),r},Rt.mapValues=function(t,n){var r={};return n=ie(n,3),kn(t,function(t,e,u){r[e]=n(t,e,u)}),r},Rt.matches=function(t){return Yn(gn(t,true))},Rt.matchesProperty=function(t,n){return Hn(t,gn(n,true))},Rt.memoize=He,Rt.merge=lf,Rt.mergeWith=sf,Rt.method=Sf,Rt.methodOf=Rf,Rt.mixin=Bu,Rt.negate=Qe,Rt.nthArg=function(t){return t=vu(t),cr(function(n){
u.push(e))}return Fn(t,u),r},Ot.rest=Me,Ot.reverse=de,Ot.sampleSize=ke,Ot.set=function(t,n,r){return null==t?t:Zn(t,n,r)},Ot.setWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null==t?t:Zn(t,n,r,e)},Ot.shuffle=function(t){return ke(t,4294967295)},Ot.slice=function(t,n,r){var e=t?t.length:0;return e?(r&&typeof r!="number"&&te(t,n,r)?(n=0,r=e):(n=null==n?0:Xe(n),r=r===T?e:Xe(r)),Tn(t,n,r)):[]},Ot.sortBy=fi,Ot.sortedUniq=function(t){return t&&t.length?Gn(t):[]},Ot.sortedUniqBy=function(t,n){ return Xn(n,t)})},Rt.omit=hf,Rt.omitBy=function(t,n){return Au(t,Qe(ie(n)))},Rt.once=function(t){return Ke(2,t)},Rt.orderBy=function(t,n,r,e){return null==t?[]:(Pi(n)||(n=null==n?[]:[n]),r=e?P:r,Pi(r)||(r=null==r?[]:[r]),tr(t,n,r))},Rt.over=If,Rt.overArgs=Ui,Rt.overEvery=Wf,Rt.overSome=Bf,Rt.partial=Di,Rt.partialRight=$i,Rt.partition=Wi,Rt.pick=pf,Rt.pickBy=Au,Rt.property=Cu,Rt.propertyOf=function(t){return function(n){return null==t?P:Rn(t,n)}},Rt.pull=pi,Rt.pullAll=Ce,Rt.pullAllBy=function(t,n,r){
return t&&t.length?Gn(t,Fr(n)):[]},Ot.split=function(t,n,r){return r&&typeof r!="number"&&te(t,n,r)&&(n=r=T),r=r===T?4294967295:r>>>0,r?(t=eu(t))&&(typeof n=="string"||null!=n&&!Ke(n))&&(n=Yn(n),""==n&&Wt.test(t))?ur(t.match(It),0,r):oo.call(t,n,r):[]},Ot.spread=function(t,n){if(typeof t!="function")throw new Au("Expected a function");return n=n===T?0:Xu(Xe(n),0),Me(function(e){var u=e[n];return e=ur(e,0,n),u&&s(e,u),r(t,this,e)})},Ot.tail=function(t){return le(t,1)},Ot.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Xe(n), return t&&t.length&&n&&n.length?ur(t,n,ie(r,2)):t},Rt.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?ur(t,n,P,r):t},Rt.pullAt=_i,Rt.range=Mf,Rt.rangeRight=Cf,Rt.rearg=Fi,Rt.reject=function(t,n){return(Pi(t)?f:An)(t,Qe(ie(n,3)))},Rt.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=ie(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i),u.push(e))}return or(t,u),r},Rt.rest=function(t,n){if(typeof t!="function")throw new Nu("Expected a function");return n=n===P?n:vu(n),
Tn(t,0,0>n?0:n)):[]},Ot.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Xe(n),n=e-n,Tn(t,0>n?0:n,e)):[]},Ot.takeRightWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3),false,true):[]},Ot.takeWhile=function(t,n){return t&&t.length?Qn(t,Fr(n,3)):[]},Ot.tap=function(t,n){return n(t),t},Ot.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Au("Expected a function");return Ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Be(t,n,{leading:e,maxWait:n, cr(t,n)},Rt.reverse=Le,Rt.sampleSize=Ze,Rt.set=function(t,n,r){return null==t?t:ar(t,n,r)},Rt.setWith=function(t,n,r,e){return e=typeof e=="function"?e:P,null==t?t:ar(t,n,r,e)},Rt.shuffle=function(t){return Ze(t,4294967295)},Rt.slice=function(t,n,r){var e=t?t.length:0;return e?(r&&typeof r!="number"&&de(t,n,r)?(n=0,r=e):(n=null==n?0:vu(n),r=r===P?e:vu(r)),lr(t,n,r)):[]},Rt.sortBy=Bi,Rt.sortedUniq=function(t){return t&&t.length?_r(t):[]},Rt.sortedUniqBy=function(t,n){return t&&t.length?_r(t,ie(n,2)):[];
trailing:u})},Ot.thru=je,Ot.toArray=He,Ot.toPairs=zi,Ot.toPairsIn=Ui,Ot.toPath=function(t){return yi(t)?l(t,fe):Je(t)?[t]:lr(Co(t))},Ot.toPlainObject=ru,Ot.transform=function(t,n,r){var e=yi(t)||Ye(t);if(n=Fr(n,4),null==r)if(e||Ze(t)){var o=t.constructor;r=e?yi(t)?new o:[]:Fe(o)?un(Ju(Object(t))):{}}else r={};return(e?u:hn)(t,function(t,e,u){return n(r,t,e,u)}),r},Ot.unary=function(t){return Se(t,1)},Ot.union=To,Ot.unionBy=qo,Ot.unionWith=Vo,Ot.uniq=function(t){return t&&t.length?Hn(t):[]},Ot.uniqBy=function(t,n){ },Rt.split=function(t,n,r){return r&&typeof r!="number"&&de(t,n,r)&&(n=r=P),r=r===P?4294967295:r>>>0,r?(t=bu(t))&&(typeof n=="string"||null!=n&&!Gi(n))&&(n=gr(n),""==n&&Ct.test(t))?Ar(t.match(Bt),0,r):ko.call(t,n,r):[]},Rt.spread=function(t,n){if(typeof t!="function")throw new Nu("Expected a function");return n=n===P?0:xo(vu(n),0),cr(function(e){var u=e[n];return e=Ar(e,0,n),u&&s(e,u),r(t,this,e)})},Rt.tail=function(t){return Se(t,1)},Rt.take=function(t,n,r){return t&&t.length?(n=r||n===P?1:vu(n),
return t&&t.length?Hn(t,Fr(n)):[]},Ot.uniqWith=function(t,n){return t&&t.length?Hn(t,T,n):[]},Ot.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ne(e,r)?[e]:er(e);r=ie(r,e),e=fe(ve(e)),r=!(null!=r&&yn(r,e))||delete r[e]}return r},Ot.unzip=ye,Ot.unzipWith=be,Ot.update=function(t,n,r){return null==t?t:Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),void 0)},Ot.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Zn(t,n,(typeof r=="function"?r:pu)(vn(t,n)),e)),t},Ot.values=cu, lr(t,0,0>n?0:n)):[]},Rt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===P?1:vu(n),n=e-n,lr(t,0>n?0:n,e)):[]},Rt.takeRightWhile=function(t,n){return t&&t.length?yr(t,ie(n,3),false,true):[]},Rt.takeWhile=function(t,n){return t&&t.length?yr(t,ie(n,3)):[]},Rt.tap=function(t,n){return n(t),t},Rt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Nu("Expected a function");return fu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Ye(t,n,{leading:e,maxWait:n,
Ot.valuesIn=function(t){return null==t?[]:k(t,fu(t))},Ot.without=Ko,Ot.words=su,Ot.wrap=function(t,n){return n=null==n?pu:n,pi(n,t)},Ot.xor=Go,Ot.xorBy=Jo,Ot.xorWith=Yo,Ot.zip=Ho,Ot.zipObject=function(t,n){return nr(t||[],n||[],Yt)},Ot.zipObjectDeep=function(t,n){return nr(t||[],n||[],Zn)},Ot.zipWith=Qo,Ot.entries=zi,Ot.entriesIn=Ui,Ot.extend=mi,Ot.extendWith=Ai,vu(Ot,Ot),Ot.add=ef,Ot.attempt=Vi,Ot.camelCase=$i,Ot.capitalize=au,Ot.ceil=uf,Ot.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=nu(r), trailing:u})},Rt.thru=$e,Rt.toArray=pu,Rt.toPairs=_f,Rt.toPairsIn=vf,Rt.toPath=function(t){return Pi(t)?l(t,Ae):hu(t)?[t]:Ir(ii(t))},Rt.toPlainObject=yu,Rt.transform=function(t,n,r){var e=Pi(t)||Yi(t);if(n=ie(n,4),null==r)if(e||fu(t)){var o=t.constructor;r=e?Pi(t)?new o:[]:uu(o)?bn(ti(t)):{}}else r={};return(e?u:kn)(t,function(t,e,u){return n(r,t,e,u)}),r},Rt.unary=function(t){return Ve(t,1)},Rt.union=vi,Rt.unionBy=gi,Rt.unionWith=di,Rt.uniq=function(t){return t&&t.length?dr(t):[]},Rt.uniqBy=function(t,n){
r=r===r?r:0),n!==T&&(n=nu(n),n=n===n?n:0),nn(nu(t),n,r)},Ot.clone=function(t){return rn(t,false,true)},Ot.cloneDeep=function(t){return rn(t,true,true)},Ot.cloneDeepWith=function(t,n){return rn(t,true,true,n)},Ot.cloneWith=function(t,n){return rn(t,false,true,n)},Ot.deburr=lu,Ot.divide=of,Ot.endsWith=function(t,n,r){t=eu(t),n=Yn(n);var e=t.length;return r=r===T?e:nn(Xe(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},Ot.eq=Ce,Ot.escape=function(t){return(t=eu(t))&&X.test(t)?t.replace(H,B):t},Ot.escapeRegExp=function(t){ return t&&t.length?dr(t,ie(n,2)):[]},Rt.uniqWith=function(t,n){return t&&t.length?dr(t,P,n):[]},Rt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ye(e,r)?[e]:mr(e);r=me(r,e),e=Ae(Me(e)),r=!(null!=r&&Bn(r,e))||delete r[e]}return r},Rt.unzip=ze,Rt.unzipWith=Ue,Rt.update=function(t,n,r){return null==t?t:ar(t,n,(typeof r=="function"?r:Iu)(Rn(t,n)),void 0)},Rt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:P,null!=t&&(t=ar(t,n,(typeof r=="function"?r:Iu)(Rn(t,n)),e)),t},Rt.values=Ou,
return(t=eu(t))&&ft.test(t)?t.replace(it,"\\$&"):t},Ot.every=function(t,n,r){var e=yi(t)?i:cn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.find=ni,Ot.findIndex=he,Ot.findKey=function(t,n){return v(t,Fr(n,3),hn)},Ot.findLast=ri,Ot.findLastIndex=pe,Ot.findLastKey=function(t,n){return v(t,Fr(n,3),pn)},Ot.floor=ff,Ot.forEach=me,Ot.forEachRight=Ae,Ot.forIn=function(t,n){return null==t?t:ko(t,Fr(n,3),fu)},Ot.forInRight=function(t,n){return null==t?t:Eo(t,Fr(n,3),fu)},Ot.forOwn=function(t,n){return t&&hn(t,Fr(n,3)); Rt.valuesIn=function(t){return null==t?[]:R(t,mu(t))},Rt.without=yi,Rt.words=Su,Rt.wrap=function(t,n){return n=null==n?Iu:n,Di(n,t)},Rt.xor=bi,Rt.xorBy=xi,Rt.xorWith=ji,Rt.zip=wi,Rt.zipObject=function(t,n){return jr(t||[],n||[],ln)},Rt.zipObjectDeep=function(t,n){return jr(t||[],n||[],ar)},Rt.zipWith=mi,Rt.entries=_f,Rt.entriesIn=vf,Rt.extend=tf,Rt.extendWith=nf,Bu(Rt,Rt),Rt.add=Lf,Rt.attempt=Af,Rt.camelCase=gf,Rt.capitalize=ku,Rt.ceil=zf,Rt.clamp=function(t,n,r){return r===P&&(r=n,n=P),r!==P&&(r=du(r),
},Ot.forOwnRight=function(t,n){return t&&pn(t,Fr(n,3))},Ot.get=uu,Ot.gt=gi,Ot.gte=di,Ot.has=function(t,n){return null!=t&&Vr(t,n,yn)},Ot.hasIn=ou,Ot.head=_e,Ot.identity=pu,Ot.includes=function(t,n,r,e){return t=Ue(t)?t:cu(t),r=r&&!e?Xe(r):0,e=t.length,0>r&&(r=Xu(e+r,0)),Ge(t)?e>=r&&-1<t.indexOf(n,r):!!e&&-1<d(t,n,r)},Ot.indexOf=function(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:Xe(r),0>r&&(r=Xu(e+r,0)),d(t,n,r)):-1},Ot.inRange=function(t,n,r){return n=nu(n)||0,r===T?(r=n,n=0):r=nu(r)||0,t=nu(t), r=r===r?r:0),n!==P&&(n=du(n),n=n===n?n:0),vn(du(t),n,r)},Rt.clone=function(t){return gn(t,false,true)},Rt.cloneDeep=function(t){return gn(t,true,true)},Rt.cloneDeepWith=function(t,n){return gn(t,true,true,n)},Rt.cloneWith=function(t,n){return gn(t,false,true,n)},Rt.conformsTo=function(t,n){return null==n||yn(t,n,wu(n))},Rt.deburr=Eu,Rt.defaultTo=function(t,n){return null==t||t!==t?n:t},Rt.divide=Uf,Rt.endsWith=function(t,n,r){t=bu(t),n=gr(n);var e=t.length,e=r=r===P?e:vn(vu(r),0,e);return r-=n.length,0<=r&&t.slice(r,e)==n;
t>=to(n,r)&&t<Xu(n,r)},Ot.invoke=Wi,Ot.isArguments=ze,Ot.isArray=yi,Ot.isArrayBuffer=function(t){return Te(t)&&"[object ArrayBuffer]"==Mu.call(t)},Ot.isArrayLike=Ue,Ot.isArrayLikeObject=$e,Ot.isBoolean=function(t){return true===t||false===t||Te(t)&&"[object Boolean]"==Mu.call(t)},Ot.isBuffer=bi,Ot.isDate=function(t){return Te(t)&&"[object Date]"==Mu.call(t)},Ot.isElement=function(t){return!!t&&1===t.nodeType&&Te(t)&&!Ve(t)},Ot.isEmpty=function(t){if(Ue(t)&&(yi(t)||Ge(t)||Fe(t.splice)||ze(t)||bi(t)))return!t.length; },Rt.eq=Xe,Rt.escape=function(t){return(t=bu(t))&&X.test(t)?t.replace(H,en):t},Rt.escapeRegExp=function(t){return(t=bu(t))&&ft.test(t)?t.replace(it,"\\$&"):t},Rt.every=function(t,n,r){var e=Pi(t)?i:wn;return r&&de(t,n,r)&&(n=P),e(t,ie(n,3))},Rt.find=ki,Rt.findIndex=Ie,Rt.findKey=function(t,n){return v(t,ie(n,3),kn)},Rt.findLast=Ei,Rt.findLastIndex=We,Rt.findLastKey=function(t,n){return v(t,ie(n,3),En)},Rt.floor=Df,Rt.forEach=Te,Rt.forEachRight=Ne,Rt.forIn=function(t,n){return null==t?t:Ko(t,ie(n,3),mu);
if(Te(t)){var n=qr(t);if("[object Map]"==n||"[object Set]"==n)return!t.size}for(var r in t)if(Wu.call(t,r))return false;return!(po&&iu(t).length)},Ot.isEqual=function(t,n){return mn(t,n)},Ot.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:T)?r(t,n):T;return e===T?mn(t,n,r):!!e},Ot.isError=De,Ot.isFinite=function(t){return typeof t=="number"&&Yu(t)},Ot.isFunction=Fe,Ot.isInteger=Ne,Ot.isLength=Pe,Ot.isMap=function(t){return Te(t)&&"[object Map]"==qr(t)},Ot.isMatch=function(t,n){return t===n||An(t,n,Pr(n)); },Rt.forInRight=function(t,n){return null==t?t:Go(t,ie(n,3),mu)},Rt.forOwn=function(t,n){return t&&kn(t,ie(n,3))},Rt.forOwnRight=function(t,n){return t&&En(t,ie(n,3))},Rt.get=xu,Rt.gt=Ti,Rt.gte=Ni,Rt.has=function(t,n){return null!=t&&le(t,n,Bn)},Rt.hasIn=ju,Rt.head=Be,Rt.identity=Iu,Rt.includes=function(t,n,r,e){return t=nu(t)?t:Ou(t),r=r&&!e?vu(r):0,e=t.length,0>r&&(r=xo(e+r,0)),su(t)?r<=e&&-1<t.indexOf(n,r):!!e&&-1<d(t,n,r)},Rt.indexOf=function(t,n,r){var e=t?t.length:0;return e?(r=null==r?0:vu(r),
},Ot.isMatchWith=function(t,n,r){return r=typeof r=="function"?r:T,An(t,n,Pr(n),r)},Ot.isNaN=function(t){return qe(t)&&t!=+t},Ot.isNative=function(t){if(Lo(t))throw new ju("This method is not supported with `core-js`. Try https://github.com/es-shims.");return On(t)},Ot.isNil=function(t){return null==t},Ot.isNull=function(t){return null===t},Ot.isNumber=qe,Ot.isObject=Ze,Ot.isObjectLike=Te,Ot.isPlainObject=Ve,Ot.isRegExp=Ke,Ot.isSafeInteger=function(t){return Ne(t)&&t>=-9007199254740991&&9007199254740991>=t; 0>r&&(r=xo(e+r,0)),d(t,n,r)):-1},Rt.inRange=function(t,n,r){return n=du(n)||0,r===P?(r=n,n=0):r=du(r)||0,t=du(t),t>=jo(n,r)&&t<xo(n,r)},Rt.invoke=af,Rt.isArguments=tu,Rt.isArray=Pi,Rt.isArrayBuffer=Zi,Rt.isArrayLike=nu,Rt.isArrayLikeObject=ru,Rt.isBoolean=function(t){return true===t||false===t||cu(t)&&"[object Boolean]"==Qu.call(t)},Rt.isBuffer=qi,Rt.isDate=Vi,Rt.isElement=function(t){return!!t&&1===t.nodeType&&cu(t)&&!lu(t)},Rt.isEmpty=function(t){if(nu(t)&&(Pi(t)||su(t)||uu(t.splice)||tu(t)||qi(t)))return!t.length;
},Ot.isSet=function(t){return Te(t)&&"[object Set]"==qr(t)},Ot.isString=Ge,Ot.isSymbol=Je,Ot.isTypedArray=Ye,Ot.isUndefined=function(t){return t===T},Ot.isWeakMap=function(t){return Te(t)&&"[object WeakMap]"==qr(t)},Ot.isWeakSet=function(t){return Te(t)&&"[object WeakSet]"==Mu.call(t)},Ot.join=function(t,n){return t?Hu.call(t,n):""},Ot.kebabCase=Di,Ot.last=ve,Ot.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==T&&(u=Xe(r),u=(0>u?Xu(e+u,0):to(u,e-1))+1),n!==n)return M(t,u-1,true); if(cu(t)){var n=Et(t);if("[object Map]"==n||"[object Set]"==n)return!t.size}for(var r in t)if(Ju.call(t,r))return false;return!(Lo&&wu(t).length)},Rt.isEqual=function(t,n){return $n(t,n)},Rt.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:P)?r(t,n):P;return e===P?$n(t,n,r):!!e},Rt.isError=eu,Rt.isFinite=function(t){return typeof t=="number"&&go(t)},Rt.isFunction=uu,Rt.isInteger=ou,Rt.isLength=iu,Rt.isMap=Ki,Rt.isMatch=function(t,n){return t===n||Tn(t,n,ce(n))},Rt.isMatchWith=function(t,n,r){
for(;u--;)if(t[u]===n)return u;return-1},Ot.lowerCase=Fi,Ot.lowerFirst=Ni,Ot.lt=xi,Ot.lte=ji,Ot.max=function(t){return t&&t.length?an(t,pu,dn):T},Ot.maxBy=function(t,n){return t&&t.length?an(t,Fr(n),dn):T},Ot.mean=function(t){return b(t,pu)},Ot.meanBy=function(t,n){return b(t,Fr(n))},Ot.min=function(t){return t&&t.length?an(t,pu,Sn):T},Ot.minBy=function(t,n){return t&&t.length?an(t,Fr(n),Sn):T},Ot.stubArray=yu,Ot.stubFalse=bu,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){ return r=typeof r=="function"?r:P,Tn(t,n,ce(n),r)},Rt.isNaN=function(t){return au(t)&&t!=+t},Rt.isNative=function(t){if(ei(t))throw new $u("This method is not supported with core-js. Try https://github.com/es-shims.");return Nn(t)},Rt.isNil=function(t){return null==t},Rt.isNull=function(t){return null===t},Rt.isNumber=au,Rt.isObject=fu,Rt.isObjectLike=cu,Rt.isPlainObject=lu,Rt.isRegExp=Gi,Rt.isSafeInteger=function(t){return ou(t)&&-9007199254740991<=t&&9007199254740991>=t},Rt.isSet=Ji,Rt.isString=su,
return true},Ot.multiply=cf,Ot.nth=function(t,n){return t&&t.length?Ln(t,Xe(n)):T},Ot.noConflict=function(){return Kt._===this&&(Kt._=Cu),this},Ot.noop=gu,Ot.now=Ee,Ot.pad=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return!n||e>=n?t:(n=(n-e)/2,Sr(Gu(n),r)+t+Sr(Ku(n),r))},Ot.padEnd=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?t+Sr(n-e,r):t},Ot.padStart=function(t,n,r){t=eu(t);var e=(n=Xe(n))?N(t):0;return n&&n>e?Sr(n-e,r)+t:t},Ot.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n), Rt.isSymbol=hu,Rt.isTypedArray=Yi,Rt.isUndefined=function(t){return t===P},Rt.isWeakMap=function(t){return cu(t)&&"[object WeakMap]"==Et(t)},Rt.isWeakSet=function(t){return cu(t)&&"[object WeakSet]"==Qu.call(t)},Rt.join=function(t,n){return t?yo.call(t,n):""},Rt.kebabCase=df,Rt.last=Me,Rt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==P&&(u=vu(r),u=(0>u?xo(e+u,0):jo(u,e-1))+1),n!==n)return g(t,b,u-1,true);for(;u--;)if(t[u]===n)return u;return-1},Rt.lowerCase=yf,Rt.lowerFirst=bf,
t=eu(t).replace(ct,""),no(t,n||(vt.test(t)?16:10))},Ot.random=function(t,n,r){if(r&&typeof r!="boolean"&&te(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=nu(t)||0,n===T?(n=t,t=0):n=nu(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=ro(),to(t+r*(n-t+Ft("1e-"+((r+"").length-1))),n)):Nn(t,n)},Ot.reduce=function(t,n,r){var e=yi(t)?h:x,u=3>arguments.length;return e(t,Fr(n,4),r,u,Ao)},Ot.reduceRight=function(t,n,r){var e=yi(t)?p:x,u=3>arguments.length; Rt.lt=Hi,Rt.lte=Qi,Rt.max=function(t){return t&&t.length?mn(t,Iu,Wn):P},Rt.maxBy=function(t,n){return t&&t.length?mn(t,ie(n,2),Wn):P},Rt.mean=function(t){return x(t,Iu)},Rt.meanBy=function(t,n){return x(t,ie(n,2))},Rt.min=function(t){return t&&t.length?mn(t,Iu,Gn):P},Rt.minBy=function(t,n){return t&&t.length?mn(t,ie(n,2),Gn):P},Rt.stubArray=Lu,Rt.stubFalse=zu,Rt.stubObject=function(){return{}},Rt.stubString=function(){return""},Rt.stubTrue=function(){return true},Rt.multiply=$f,Rt.nth=function(t,n){
return e(t,Fr(n,4),r,u,Oo)},Ot.repeat=function(t,n,r){return n=(r?te(t,n,r):n===T)?1:Xe(n),Pn(eu(t),n)},Ot.replace=function(){var t=arguments,n=eu(t[0]);return 3>t.length?n:eo.call(n,t[1],t[2])},Ot.result=function(t,n,r){n=ne(n,t)?[n]:er(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e<u;){var o=null==t?T:t[fe(n[e])];o===T&&(e=u,o=r),t=Fe(o)?o.call(t):o}return t},Ot.round=af,Ot.runInContext=Z,Ot.sample=function(t){t=Ue(t)?t:cu(t);var n=t.length;return n>0?t[Nn(0,n-1)]:T},Ot.size=function(t){if(null==t)return 0; return t&&t.length?Xn(t,vu(n)):P},Rt.noConflict=function(){return qt._===this&&(qt._=Xu),this},Rt.noop=Mu,Rt.now=qe,Rt.pad=function(t,n,r){t=bu(t);var e=(n=vu(n))?T(t):0;return!n||e>=n?t:(n=(n-e)/2,Gr(ho(n),r)+t+Gr(so(n),r))},Rt.padEnd=function(t,n,r){t=bu(t);var e=(n=vu(n))?T(t):0;return n&&e<n?t+Gr(n-e,r):t},Rt.padStart=function(t,n,r){t=bu(t);var e=(n=vu(n))?T(t):0;return n&&e<n?Gr(n-e,r)+t:t},Rt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=bu(t).replace(ct,""),wo(t,n||(yt.test(t)?16:10));
if(Ue(t)){var n=t.length;return n&&Ge(t)?N(t):n}return Te(t)&&(n=qr(t),"[object Map]"==n||"[object Set]"==n)?t.size:iu(t).length},Ot.snakeCase=Pi,Ot.some=function(t,n,r){var e=yi(t)?_:qn;return r&&te(t,n,r)&&(n=T),e(t,Fr(n,3))},Ot.sortedIndex=function(t,n){return Vn(t,n)},Ot.sortedIndexBy=function(t,n,r){return Kn(t,n,Fr(r))},Ot.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Vn(t,n);if(r>e&&Ce(t[e],n))return e}return-1},Ot.sortedLastIndex=function(t,n){return Vn(t,n,true)},Ot.sortedLastIndexBy=function(t,n,r){ },Rt.random=function(t,n,r){if(r&&typeof r!="boolean"&&de(t,n,r)&&(n=r=P),r===P&&(typeof n=="boolean"?(r=n,n=P):typeof t=="boolean"&&(r=t,t=P)),t===P&&n===P?(t=0,n=1):(t=du(t)||0,n===P?(n=t,t=0):n=du(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=mo(),jo(t+r*(n-t+Tt("1e-"+((r+"").length-1))),n)):ir(t,n)},Rt.reduce=function(t,n,r){var e=Pi(t)?h:m,u=3>arguments.length;return e(t,ie(n,4),r,u,qo)},Rt.reduceRight=function(t,n,r){var e=Pi(t)?p:m,u=3>arguments.length;return e(t,ie(n,4),r,u,Vo)},Rt.repeat=function(t,n,r){
return Kn(t,n,Fr(r),true)},Ot.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Vn(t,n,true)-1;if(Ce(t[r],n))return r}return-1},Ot.startCase=Zi,Ot.startsWith=function(t,n,r){return t=eu(t),r=nn(Xe(r),0,t.length),t.lastIndexOf(Yn(n),r)==r},Ot.subtract=lf,Ot.sum=function(t){return t&&t.length?w(t,pu):0},Ot.sumBy=function(t,n){return t&&t.length?w(t,Fr(n)):0},Ot.template=function(t,n,r){var e=Ot.templateSettings;r&&te(t,n,r)&&(n=T),t=eu(t),n=Ai({},n,e,Vt),r=Ai({},n.imports,e.imports,Vt);var u,o,i=iu(r),f=k(r,i),c=0; return n=(r?de(t,n,r):n===P)?1:vu(n),fr(bu(t),n)},Rt.replace=function(){var t=arguments,n=bu(t[0]);return 3>t.length?n:Ao.call(n,t[1],t[2])},Rt.result=function(t,n,r){n=ye(n,t)?[n]:mr(n);var e=-1,u=n.length;for(u||(t=P,u=1);++e<u;){var o=null==t?P:t[Ae(n[e])];o===P&&(e=u,o=r),t=uu(o)?o.call(t):o}return t},Rt.round=Ff,Rt.runInContext=N,Rt.sample=function(t){t=nu(t)?t:Ou(t);var n=t.length;return 0<n?t[ir(0,n-1)]:P},Rt.size=function(t){if(null==t)return 0;if(nu(t)){var n=t.length;return n&&su(t)?T(t):n;
r=n.interpolate||wt;var a="__p+='";r=mu((n.escape||wt).source+"|"+r.source+"|"+(r===rt?pt:wt).source+"|"+(n.evaluate||wt).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(mt,L),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(K,""):a).replace(G,"$1").replace(J,"$1;"), }return cu(t)&&(n=Et(t),"[object Map]"==n||"[object Set]"==n)?t.size:wu(t).length},Rt.snakeCase=xf,Rt.some=function(t,n,r){var e=Pi(t)?_:sr;return r&&de(t,n,r)&&(n=P),e(t,ie(n,3))},Rt.sortedIndex=function(t,n){return hr(t,n)},Rt.sortedIndexBy=function(t,n,r){return pr(t,n,ie(r,2))},Rt.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=hr(t,n);if(e<r&&Xe(t[e],n))return e}return-1},Rt.sortedLastIndex=function(t,n){return hr(t,n,true)},Rt.sortedLastIndexBy=function(t,n,r){return pr(t,n,ie(r,2),true);
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=Vi(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,De(n))throw n;return n},Ot.times=function(t,n){if(t=Xe(t),1>t||t>9007199254740991)return[];var r=4294967295,e=to(t,4294967295);for(n=Fr(n),t-=4294967295,e=m(e,n);++r<t;)n(r);return e},Ot.toFinite=Qe,Ot.toInteger=Xe,Ot.toLength=tu,Ot.toLower=function(t){ },Rt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=hr(t,n,true)-1;if(Xe(t[r],n))return r}return-1},Rt.startCase=jf,Rt.startsWith=function(t,n,r){return t=bu(t),r=vn(vu(r),0,t.length),n=gr(n),t.slice(r,r+n.length)==n},Rt.subtract=Tf,Rt.sum=function(t){return t&&t.length?O(t,Iu):0},Rt.sumBy=function(t,n){return t&&t.length?O(t,ie(n,2)):0},Rt.template=function(t,n,r){var e=Rt.templateSettings;r&&de(t,n,r)&&(n=P),t=bu(t),n=nf({},n,e,cn),r=nf({},n.imports,e.imports,cn);var u,o,i=wu(r),f=R(r,i),c=0;
return eu(t).toLowerCase()},Ot.toNumber=nu,Ot.toSafeInteger=function(t){return nn(Xe(t),-9007199254740991,9007199254740991)},Ot.toString=eu,Ot.toUpper=function(t){return eu(t).toUpperCase()},Ot.trim=function(t,n,r){return(t=eu(t))&&(r||n===T)?t.replace(ct,""):t&&(n=Yn(n))?(t=t.match(It),n=n.match(It),ur(t,S(t,n),I(t,n)+1).join("")):t},Ot.trimEnd=function(t,n,r){return(t=eu(t))&&(r||n===T)?t.replace(lt,""):t&&(n=Yn(n))?(t=t.match(It),n=I(t,n.match(It))+1,ur(t,0,n).join("")):t},Ot.trimStart=function(t,n,r){ r=n.interpolate||Ot;var a="__p+='";r=Tu((n.escape||Ot).source+"|"+r.source+"|"+(r===rt?gt:Ot).source+"|"+(n.evaluate||Ot).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(kt,M),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(K,""):a).replace(G,"$1").replace(J,"$1;"),
return(t=eu(t))&&(r||n===T)?t.replace(at,""):t&&(n=Yn(n))?(t=t.match(It),n=S(t,n.match(It)),ur(t,n).join("")):t},Ot.truncate=function(t,n){var r=30,e="...";if(Ze(n))var u="separator"in n?n.separator:u,r="length"in n?Xe(n.length):r,e="omission"in n?Yn(n.omission):e;t=eu(t);var o=t.length;if(Wt.test(t))var i=t.match(It),o=i.length;if(r>=o)return t;if(o=r-N(e),1>o)return e;if(r=i?ur(i,0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Ke(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=mu(u.source,eu(_t.exec(u))+"g")), 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=Af(function(){return Function(i,l+"return "+a).apply(P,f)}),n.source=a,eu(n))throw n;return n},Rt.times=function(t,n){if(t=vu(t),1>t||9007199254740991<t)return[];var r=4294967295,e=jo(t,4294967295);for(n=ie(n),t-=4294967295,e=k(e,n);++r<t;)n(r);return e},Rt.toFinite=_u,Rt.toInteger=vu,Rt.toLength=gu,Rt.toLower=function(t){
u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===T?o:c)}}else t.indexOf(Yn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},Ot.unescape=function(t){return(t=eu(t))&&Q.test(t)?t.replace(Y,P):t},Ot.uniqueId=function(t){var n=++Bu;return eu(t)+n},Ot.upperCase=Ti,Ot.upperFirst=qi,Ot.each=me,Ot.eachRight=Ae,Ot.first=_e,vu(Ot,function(){var t={};return hn(Ot,function(n,r){Wu.call(Ot.prototype,r)||(t[r]=n)}),t}(),{chain:false}),Ot.VERSION="4.13.1",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){ return bu(t).toLowerCase()},Rt.toNumber=du,Rt.toSafeInteger=function(t){return vn(vu(t),-9007199254740991,9007199254740991)},Rt.toString=bu,Rt.toUpper=function(t){return bu(t).toUpperCase()},Rt.trim=function(t,n,r){return(t=bu(t))&&(r||n===P)?t.replace(ct,""):t&&(n=gr(n))?(t=t.match(Bt),r=n.match(Bt),n=W(t,r),r=B(t,r)+1,Ar(t,n,r).join("")):t},Rt.trimEnd=function(t,n,r){return(t=bu(t))&&(r||n===P)?t.replace(lt,""):t&&(n=gr(n))?(t=t.match(Bt),n=B(t,n.match(Bt))+1,Ar(t,0,n).join("")):t},Rt.trimStart=function(t,n,r){
Ot[t].placeholder=Ot}),u(["drop","take"],function(t,n){Ut.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Ut(this);r=r===T?1:Xu(Xe(r),0);var u=this.clone();return e?u.__takeCount__=to(r,u.__takeCount__):u.__views__.push({size:to(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Ut.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;Ut.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({ return(t=bu(t))&&(r||n===P)?t.replace(at,""):t&&(n=gr(n))?(t=t.match(Bt),n=W(t,n.match(Bt)),Ar(t,n).join("")):t},Rt.truncate=function(t,n){var r=30,e="...";if(fu(n))var u="separator"in n?n.separator:u,r="length"in n?vu(n.length):r,e="omission"in n?gr(n.omission):e;t=bu(t);var o=t.length;if(Ct.test(t))var i=t.match(Bt),o=i.length;if(r>=o)return t;if(o=r-T(e),1>o)return e;if(r=i?Ar(i,0,o).join(""):t.slice(0,o),u===P)return r+e;if(i&&(o+=r.length-o),Gi(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=Tu(u.source,bu(dt.exec(u))+"g")),
iteratee:Fr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Ut.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");Ut.prototype[t]=function(){return this.__filtered__?new Ut(this):this[r](1)}}),Ut.prototype.compact=function(){return this.filter(pu)},Ut.prototype.find=function(t){return this.filter(t).head()},Ut.prototype.findLast=function(t){return this.reverse().find(t); u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===P?o:c)}}else t.indexOf(gr(u),o)!=o&&(u=r.lastIndexOf(u),-1<u&&(r=r.slice(0,u)));return r+e},Rt.unescape=function(t){return(t=bu(t))&&Q.test(t)?t.replace(Y,un):t},Rt.uniqueId=function(t){var n=++Yu;return bu(t)+n},Rt.upperCase=wf,Rt.upperFirst=mf,Rt.each=Te,Rt.eachRight=Ne,Rt.first=Be,Bu(Rt,function(){var t={};return kn(Rt,function(n,r){Ju.call(Rt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),Rt.VERSION="4.14.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){
},Ut.prototype.invokeMap=Me(function(t,n){return typeof t=="function"?new Ut(this):this.map(function(r){return wn(r,t,n)})}),Ut.prototype.reject=function(t){return t=Fr(t,3),this.filter(function(n){return!t(n)})},Ut.prototype.slice=function(t,n){t=Xe(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Ut(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==T&&(n=Xe(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Ut.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ut.prototype.toArray=function(){ Rt[t].placeholder=Rt}),u(["drop","take"],function(t,n){Pt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Pt(this);r=r===P?1:xo(vu(r),0);var u=this.clone();return e?u.__takeCount__=jo(r,u.__takeCount__):u.__views__.push({size:jo(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Pt.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;Pt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({
return this.take(4294967295)},hn(Ut.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Ot[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(Ot.prototype[n]=function(){function n(t){return t=u.apply(Ot,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Ut,a=f[0],l=c||yi(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new Ut(this), iteratee:ie(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Pt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");Pt.prototype[t]=function(){return this.__filtered__?new Pt(this):this[r](1)}}),Pt.prototype.compact=function(){return this.filter(Iu)},Pt.prototype.find=function(t){return this.filter(t).head()},Pt.prototype.findLast=function(t){return this.reverse().find(t);
i=t.apply(i,f),i.__actions__.push({func:je,args:[n],thisArg:T}),new zt(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=Ou[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Ot.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(yi(u)?u:[],t)}return this[r](function(r){return n.apply(yi(r)?r:[],t)})}}),hn(Ut.prototype,function(t,n){ },Pt.prototype.invokeMap=cr(function(t,n){return typeof t=="function"?new Pt(this):this.map(function(r){return zn(r,t,n)})}),Pt.prototype.reject=function(t){return this.filter(Qe(ie(t)))},Pt.prototype.slice=function(t,n){t=vu(t);var r=this;return r.__filtered__&&(0<t||0>n)?new Pt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==P&&(n=vu(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Pt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pt.prototype.toArray=function(){return this.take(4294967295);
var r=Ot[n];if(r){var e=r.name+"";(_o[e]||(_o[e]=[])).push({name:n,func:r})}}),_o[Ar(T,2).name]=[{name:"wrapper",func:T}],Ut.prototype.clone=function(){var t=new Ut(this.__wrapped__);return t.__actions__=lr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=lr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=lr(this.__views__),t},Ut.prototype.reverse=function(){if(this.__filtered__){var t=new Ut(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(), },kn(Pt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Rt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(Rt.prototype[n]=function(){function n(t){return t=u.apply(Rt,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Pt,a=f[0],l=c||Pi(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new Pt(this),i=t.apply(i,f),i.__actions__.push({
t.__dir__*=-1;return t},Ut.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=yi(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=to(t,f+s);break;case"takeRight":f=Xu(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=to(t,this.__takeCount__),!e||200>o||o==t&&a==t)return Xn(n,this.__actions__);e=[]; func:$e,args:[n],thisArg:P}),new Ft(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=Pu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Rt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(Pi(u)?u:[],t)}return this[r](function(r){return n.apply(Pi(r)?r:[],t)})}}),kn(Pt.prototype,function(t,n){var r=Rt[n];if(r){var e=r.name+"";
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},Ot.prototype.at=Xo,Ot.prototype.chain=function(){return xe(this)},Ot.prototype.commit=function(){return new zt(this.value(),this.__chain__)},Ot.prototype.next=function(){this.__values__===T&&(this.__values__=He(this.value()));var t=this.__index__>=this.__values__.length,n=t?T:this.__values__[this.__index__++];return{done:t,value:n}},Ot.prototype.plant=function(t){ (zo[e]||(zo[e]=[])).push({name:n,func:r})}}),zo[Zr(P,2).name]=[{name:"wrapper",func:P}],Pt.prototype.clone=function(){var t=new Pt(this.__wrapped__);return t.__actions__=Ir(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ir(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ir(this.__views__),t},Pt.prototype.reverse=function(){if(this.__filtered__){var t=new Pt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t;
for(var n,r=this;r instanceof kt;){var e=ae(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Ot.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Ut?(this.__actions__.length&&(t=new Ut(this)),t=t.reverse(),t.__actions__.push({func:je,args:[de],thisArg:T}),new zt(t,this.__chain__)):this.thru(de)},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return Xn(this.__wrapped__,this.__actions__)},Zu&&(Ot.prototype[Zu]=we), },Pt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=Pi(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=jo(t,f+s);break;case"takeRight":f=xo(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=jo(t,this.__takeCount__),!e||200>o||o==t&&a==t)return br(n,this.__actions__);e=[];t:for(;t--&&c<a;){
Ot}var T,q=1/0,V=NaN,K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/[a-zA-Z0-9]+/g,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,wt=/($^)/,mt=/['\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("['\u2019]","g"),St=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),It=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kt+At,"g"),Rt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\u2000-\\u206f \\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])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\u2000-\\u206f \\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\\u2000-\\u206f \\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])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",Ot].join("|"),"g"),Wt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt="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 _ isFinite parseInt setTimeout".split(" "),Mt={}; 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},Rt.prototype.at=Ai,Rt.prototype.chain=function(){return De(this)},Rt.prototype.commit=function(){return new Ft(this.value(),this.__chain__)},Rt.prototype.next=function(){this.__values__===P&&(this.__values__=pu(this.value()));var t=this.__index__>=this.__values__.length,n=t?P:this.__values__[this.__index__++];return{done:t,value:n}},Rt.prototype.plant=function(t){
Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=true,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=false; for(var n,r=this;r instanceof $t;){var e=Ee(r);e.__index__=0,e.__values__=P,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Rt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Pt?(this.__actions__.length&&(t=new Pt(this)),t=t.reverse(),t.__actions__.push({func:$e,args:[Le],thisArg:P}),new Ft(t,this.__chain__)):this.thru(Le)},Rt.prototype.toJSON=Rt.prototype.valueOf=Rt.prototype.value=function(){return br(this.__wrapped__,this.__actions__)},Rt.prototype.first=Rt.prototype.head,
var Ct={};Ct["[object Arguments]"]=Ct["[object Array]"]=Ct["[object ArrayBuffer]"]=Ct["[object DataView]"]=Ct["[object Boolean]"]=Ct["[object Date]"]=Ct["[object Float32Array]"]=Ct["[object Float64Array]"]=Ct["[object Int8Array]"]=Ct["[object Int16Array]"]=Ct["[object Int32Array]"]=Ct["[object Map]"]=Ct["[object Number]"]=Ct["[object Object]"]=Ct["[object RegExp]"]=Ct["[object Set]"]=Ct["[object String]"]=Ct["[object Symbol]"]=Ct["[object Uint8Array]"]=Ct["[object Uint8ClampedArray]"]=Ct["[object Uint16Array]"]=Ct["[object Uint32Array]"]=true, io&&(Rt.prototype[io]=Fe),Rt}var P,Z=1/0,q=NaN,V=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ht=/\{\n\/\* \[wrapped with (.+)\] \*/,pt=/,? & /,_t=/[a-zA-Z0-9]+/g,vt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,yt=/^0x/i,bt=/^[-+]0x[0-9a-f]+$/i,xt=/^0b[01]+$/i,jt=/^\[object .+?Constructor\]$/,wt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,At=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ot=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,Et="[\\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])?)*",St="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+Et,Rt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",It=RegExp("['\u2019]","g"),Wt=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),Bt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+Rt+Et,"g"),Mt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\u2000-\\u206f \\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])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\u2000-\\u206f \\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\\u2000-\\u206f \\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])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",St].join("|"),"g"),Ct=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zt="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(" "),Ut={};
Ct["[object Error]"]=Ct["[object Function]"]=Ct["[object WeakMap]"]=false;var zt={"\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", Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=true,Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object Boolean]"]=Ut["[object DataView]"]=Ut["[object Date]"]=Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object WeakMap]"]=false;
"\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"},Ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},$t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Dt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ft=parseFloat,Nt=parseInt,Pt=typeof exports=="object"&&exports,Zt=Pt&&typeof module=="object"&&module,Tt=Zt&&Zt.exports===Pt,qt=R(typeof self=="object"&&self),Vt=R(typeof this=="object"&&this),Kt=R(typeof global=="object"&&global)||qt||Vt||Function("return this")(),Gt=Z(); var Dt={};Dt["[object Arguments]"]=Dt["[object Array]"]=Dt["[object ArrayBuffer]"]=Dt["[object DataView]"]=Dt["[object Boolean]"]=Dt["[object Date]"]=Dt["[object Float32Array]"]=Dt["[object Float64Array]"]=Dt["[object Int8Array]"]=Dt["[object Int16Array]"]=Dt["[object Int32Array]"]=Dt["[object Map]"]=Dt["[object Number]"]=Dt["[object Object]"]=Dt["[object RegExp]"]=Dt["[object Set]"]=Dt["[object String]"]=Dt["[object Symbol]"]=Dt["[object Uint8Array]"]=Dt["[object Uint8ClampedArray]"]=Dt["[object Uint16Array]"]=Dt["[object Uint32Array]"]=true,
(qt||{})._=Gt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Gt}):Zt?((Zt.exports=Gt)._=Gt,Pt._=Gt):Kt._=Gt}).call(this); Dt["[object Error]"]=Dt["[object Function]"]=Dt["[object WeakMap]"]=false;var $t,Ft={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tt=parseFloat,Nt=parseInt,Pt=typeof global=="object"&&global&&global.Object===Object&&global,Zt=typeof self=="object"&&self&&self.Object===Object&&self,qt=Pt||Zt||Function("return this")(),Vt=Pt&&typeof exports=="object"&&exports,Kt=Vt&&typeof module=="object"&&module,Gt=Kt&&Kt.exports===Vt,Jt=Gt&&Pt.h;t:{try{$t=Jt&&Jt.f("util");break t}catch(t){}
$t=void 0}var Yt=$t&&$t.isArrayBuffer,Ht=$t&&$t.isDate,Qt=$t&&$t.isMap,Xt=$t&&$t.isRegExp,tn=$t&&$t.isSet,nn=$t&&$t.isTypedArray,rn=w({"\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"}),en=w({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"}),un=w({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"}),on=N();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(qt._=on,
define(function(){return on})):Kt?((Kt.exports=on)._=on,Vt._=on):qt._=on}).call(this);

107
dist/mapping.fp.js vendored
View File

@@ -63,11 +63,20 @@ return /******/ (function(modules) { // webpackBootstrap
'entries': 'toPairs', 'entries': 'toPairs',
'entriesIn': 'toPairsIn', 'entriesIn': 'toPairsIn',
'extend': 'assignIn', 'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith', 'extendWith': 'assignInWith',
'first': 'head', 'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases. // Ramda aliases.
'__': 'placeholder', '__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every', 'all': 'every',
'allPass': 'overEvery', 'allPass': 'overEvery',
'always': 'constant', 'always': 'constant',
@@ -81,8 +90,11 @@ return /******/ (function(modules) { // webpackBootstrap
'contains': 'includes', 'contains': 'includes',
'dissoc': 'unset', 'dissoc': 'unset',
'dissocPath': 'unset', 'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual', 'equals': 'isEqual',
'identical': 'eq', 'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial', 'init': 'initial',
'invertObj': 'invert', 'invertObj': 'invert',
'juxt': 'over', 'juxt': 'over',
@@ -99,36 +111,44 @@ return /******/ (function(modules) { // webpackBootstrap
'propEq': 'matchesProperty', 'propEq': 'matchesProperty',
'propOr': 'getOr', 'propOr': 'getOr',
'props': 'at', 'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest', 'unapply': 'rest',
'unnest': 'flatten', 'unnest': 'flatten',
'useWith': 'overArgs', 'useWith': 'overArgs',
'whereEq': 'filter', 'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject' 'zipObj': 'zipObject'
}; };
/** Used to map ary to method names. */ /** Used to map ary to method names. */
exports.aryMethod = { exports.aryMethod = {
'1': [ '1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest',
'uniqueId', 'words' 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd',
'trimStart', 'uniqueId', 'words', 'zipAll'
], ],
'2': [ '2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
@@ -207,7 +227,9 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to rearg configs. */ /** Used to map method names to rearg configs. */
exports.methodRearg = { exports.methodRearg = {
'assignInAllWith': [1, 2, 0],
'assignInWith': [1, 2, 0], 'assignInWith': [1, 2, 0],
'assignAllWith': [1, 2, 0],
'assignWith': [1, 2, 0], 'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0], 'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0], 'differenceWith': [1, 2, 0],
@@ -216,6 +238,7 @@ return /******/ (function(modules) { // webpackBootstrap
'intersectionWith': [1, 2, 0], 'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0], 'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0], 'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 2, 0],
'mergeWith': [1, 2, 0], 'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0], 'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0], 'padCharsEnd': [2, 1, 0],
@@ -235,11 +258,20 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to spread configs. */ /** Used to map method names to spread configs. */
exports.methodSpread = { exports.methodSpread = {
'invokeArgs': 2, 'assignAll': { 'start': 0 },
'invokeArgsMap': 2, 'assignAllWith': { 'afterRearg': true, 'start': 1 },
'partial': 1, 'assignInAll': { 'start': 0 },
'partialRight': 1, 'assignInAllWith': { 'afterRearg': true, 'start': 1 },
'without': 1 'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'afterRearg': true, 'start': 1 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
}; };
/** Used to identify methods which mutate arrays or objects. */ /** Used to identify methods which mutate arrays or objects. */
@@ -256,13 +288,21 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
'object': { 'object': {
'assign': true, 'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true, 'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true, 'assignInWith': true,
'assignWith': true, 'assignWith': true,
'defaults': true, 'defaults': true,
'defaultsAll': true,
'defaultsDeep': true, 'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true, 'merge': true,
'mergeWith': true 'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
}, },
'set': { 'set': {
'set': true, 'set': true,
@@ -302,8 +342,14 @@ return /******/ (function(modules) { // webpackBootstrap
/** Used to map method names to other names. */ /** Used to map method names to other names. */
exports.remap = { exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry', 'curryN': 'curry',
'curryRightN': 'curryRight', 'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find', 'findFrom': 'find',
'findIndexFrom': 'findIndex', 'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast', 'findLastFrom': 'findLast',
@@ -314,14 +360,18 @@ return /******/ (function(modules) { // webpackBootstrap
'invokeArgs': 'invoke', 'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap', 'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf', 'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad', 'padChars': 'pad',
'padCharsEnd': 'padEnd', 'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart', 'padCharsStart': 'padStart',
'propertyOf': 'get',
'restFrom': 'rest', 'restFrom': 'rest',
'spreadFrom': 'spread', 'spreadFrom': 'spread',
'trimChars': 'trim', 'trimChars': 'trim',
'trimCharsEnd': 'trimEnd', 'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart' 'trimCharsStart': 'trimStart',
'zipAll': 'zip'
}; };
/** Used to track methods that skip fixing their arity. */ /** Used to track methods that skip fixing their arity. */
@@ -331,6 +381,7 @@ return /******/ (function(modules) { // webpackBootstrap
'flowRight': true, 'flowRight': true,
'iteratee': true, 'iteratee': true,
'mixin': true, 'mixin': true,
'rearg': true,
'runInContext': true 'runInContext': true
}; };
@@ -356,12 +407,14 @@ return /******/ (function(modules) { // webpackBootstrap
'overArgs': true, 'overArgs': true,
'partial': true, 'partial': true,
'partialRight': true, 'partialRight': true,
'propertyOf': true,
'random': true, 'random': true,
'range': true, 'range': true,
'rangeRight': true, 'rangeRight': true,
'subtract': true, 'subtract': true,
'zip': true, 'zip': true,
'zipObject': true 'zipObject': true,
'zipObjectDeep': true
}; };

File diff suppressed because it is too large Load Diff

View File

@@ -71,11 +71,11 @@ function createCloner(func) {
* @param {Function} cloner The function to clone arguments. * @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function. * @returns {Function} Returns the new immutable function.
*/ */
function immutWrap(func, cloner) { function wrapImmutable(func, cloner) {
return function() { return function() {
var length = arguments.length; var length = arguments.length;
if (!length) { if (!length) {
return result; return;
} }
var args = Array(length); var args = Array(length);
while (length--) { while (length--) {
@@ -209,6 +209,12 @@ function baseConvert(util, name, func, options) {
return func; return func;
}; };
}, },
'rearg': function(rearg) {
return function(func, indexes) {
var n = indexes ? indexes.length : 0;
return curry(rearg(func, indexes), n);
};
},
'runInContext': function(runInContext) { 'runInContext': function(runInContext) {
return function(context) { return function(context) {
return baseConvert(util, runInContext(context), options); return baseConvert(util, runInContext(context), options);
@@ -218,6 +224,77 @@ function baseConvert(util, name, func, options) {
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* Casts `func` to a function with an arity capped iteratee if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @returns {Function} Returns the cast function.
*/
function castCap(name, func) {
if (config.cap) {
var indexes = mapping.iterateeRearg[name];
if (indexes) {
return iterateeRearg(func, indexes);
}
var n = !isLib && mapping.iterateeAry[name];
if (n) {
return iterateeAry(func, n);
}
}
return func;
}
/**
* Casts `func` to a curried function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castCurry(name, func, n) {
return (forceCurry || (config.curry && n > 1))
? curry(func, n)
: func;
}
/**
* Casts `func` to a fixed arity function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity cap.
* @returns {Function} Returns the cast function.
*/
function castFixed(name, func, n) {
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
var data = mapping.methodSpread[name],
start = data && data.start;
return start === undefined ? ary(func, n) : spread(func, start);
}
return func;
}
/**
* Casts `func` to an rearged function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castRearg(name, func, n) {
return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
: func;
}
/** /**
* Creates a clone of `object` by `path`. * Creates a clone of `object` by `path`.
* *
@@ -310,12 +387,11 @@ function baseConvert(util, name, func, options) {
} }
/** /**
* Creates a function that invokes `func` with its first argument passed * Creates a function that invokes `func` with its first argument transformed.
* thru `transform`.
* *
* @private * @private
* @param {Function} func The function to wrap. * @param {Function} func The function to wrap.
* @param {...Function} transform The functions to transform the first argument. * @param {Function} transform The argument transform.
* @returns {Function} Returns the new function. * @returns {Function} Returns the new function.
*/ */
function overArg(func, transform) { function overArg(func, transform) {
@@ -355,42 +431,27 @@ function baseConvert(util, name, func, options) {
} }
else if (config.immutable) { else if (config.immutable) {
if (mutateMap.array[name]) { if (mutateMap.array[name]) {
wrapped = immutWrap(func, cloneArray); wrapped = wrapImmutable(func, cloneArray);
} }
else if (mutateMap.object[name]) { else if (mutateMap.object[name]) {
wrapped = immutWrap(func, createCloner(func)); wrapped = wrapImmutable(func, createCloner(func));
} }
else if (mutateMap.set[name]) { else if (mutateMap.set[name]) {
wrapped = immutWrap(func, cloneByPath); wrapped = wrapImmutable(func, cloneByPath);
} }
} }
each(aryMethodKeys, function(aryKey) { each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) { each(mapping.aryMethod[aryKey], function(otherName) {
if (name == otherName) { if (name == otherName) {
var aryN = !isLib && mapping.iterateeAry[name], var spreadData = mapping.methodSpread[name],
reargIndexes = mapping.iterateeRearg[name], afterRearg = spreadData && spreadData.afterRearg;
spreadStart = mapping.methodSpread[name];
result = wrapped; result = afterRearg
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { ? castFixed(name, castRearg(name, wrapped, aryKey), aryKey)
result = spreadStart === undefined : castRearg(name, castFixed(name, wrapped, aryKey), aryKey);
? ary(result, aryKey)
: spread(result, spreadStart); result = castCap(name, result);
} result = castCurry(name, result, aryKey);
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 false;
} }
}); });

View File

@@ -7,11 +7,20 @@ exports.aliasToReal = {
'entries': 'toPairs', 'entries': 'toPairs',
'entriesIn': 'toPairsIn', 'entriesIn': 'toPairsIn',
'extend': 'assignIn', 'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith', 'extendWith': 'assignInWith',
'first': 'head', 'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases. // Ramda aliases.
'__': 'placeholder', '__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every', 'all': 'every',
'allPass': 'overEvery', 'allPass': 'overEvery',
'always': 'constant', 'always': 'constant',
@@ -25,8 +34,11 @@ exports.aliasToReal = {
'contains': 'includes', 'contains': 'includes',
'dissoc': 'unset', 'dissoc': 'unset',
'dissocPath': 'unset', 'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual', 'equals': 'isEqual',
'identical': 'eq', 'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial', 'init': 'initial',
'invertObj': 'invert', 'invertObj': 'invert',
'juxt': 'over', 'juxt': 'over',
@@ -43,36 +55,44 @@ exports.aliasToReal = {
'propEq': 'matchesProperty', 'propEq': 'matchesProperty',
'propOr': 'getOr', 'propOr': 'getOr',
'props': 'at', 'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest', 'unapply': 'rest',
'unnest': 'flatten', 'unnest': 'flatten',
'useWith': 'overArgs', 'useWith': 'overArgs',
'whereEq': 'filter', 'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject' 'zipObj': 'zipObject'
}; };
/** Used to map ary to method names. */ /** Used to map ary to method names. */
exports.aryMethod = { exports.aryMethod = {
'1': [ '1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest',
'uniqueId', 'words' 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd',
'trimStart', 'uniqueId', 'words', 'zipAll'
], ],
'2': [ '2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
@@ -151,7 +171,9 @@ exports.iterateeRearg = {
/** Used to map method names to rearg configs. */ /** Used to map method names to rearg configs. */
exports.methodRearg = { exports.methodRearg = {
'assignInAllWith': [1, 2, 0],
'assignInWith': [1, 2, 0], 'assignInWith': [1, 2, 0],
'assignAllWith': [1, 2, 0],
'assignWith': [1, 2, 0], 'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0], 'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0], 'differenceWith': [1, 2, 0],
@@ -160,6 +182,7 @@ exports.methodRearg = {
'intersectionWith': [1, 2, 0], 'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0], 'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0], 'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 2, 0],
'mergeWith': [1, 2, 0], 'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0], 'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0], 'padCharsEnd': [2, 1, 0],
@@ -179,11 +202,20 @@ exports.methodRearg = {
/** Used to map method names to spread configs. */ /** Used to map method names to spread configs. */
exports.methodSpread = { exports.methodSpread = {
'invokeArgs': 2, 'assignAll': { 'start': 0 },
'invokeArgsMap': 2, 'assignAllWith': { 'afterRearg': true, 'start': 1 },
'partial': 1, 'assignInAll': { 'start': 0 },
'partialRight': 1, 'assignInAllWith': { 'afterRearg': true, 'start': 1 },
'without': 1 'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'afterRearg': true, 'start': 1 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
}; };
/** Used to identify methods which mutate arrays or objects. */ /** Used to identify methods which mutate arrays or objects. */
@@ -200,13 +232,21 @@ exports.mutate = {
}, },
'object': { 'object': {
'assign': true, 'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true, 'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true, 'assignInWith': true,
'assignWith': true, 'assignWith': true,
'defaults': true, 'defaults': true,
'defaultsAll': true,
'defaultsDeep': true, 'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true, 'merge': true,
'mergeWith': true 'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
}, },
'set': { 'set': {
'set': true, 'set': true,
@@ -246,8 +286,14 @@ exports.realToAlias = (function() {
/** Used to map method names to other names. */ /** Used to map method names to other names. */
exports.remap = { exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry', 'curryN': 'curry',
'curryRightN': 'curryRight', 'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find', 'findFrom': 'find',
'findIndexFrom': 'findIndex', 'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast', 'findLastFrom': 'findLast',
@@ -258,14 +304,18 @@ exports.remap = {
'invokeArgs': 'invoke', 'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap', 'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf', 'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad', 'padChars': 'pad',
'padCharsEnd': 'padEnd', 'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart', 'padCharsStart': 'padStart',
'propertyOf': 'get',
'restFrom': 'rest', 'restFrom': 'rest',
'spreadFrom': 'spread', 'spreadFrom': 'spread',
'trimChars': 'trim', 'trimChars': 'trim',
'trimCharsEnd': 'trimEnd', 'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart' 'trimCharsStart': 'trimStart',
'zipAll': 'zip'
}; };
/** Used to track methods that skip fixing their arity. */ /** Used to track methods that skip fixing their arity. */
@@ -275,6 +325,7 @@ exports.skipFixed = {
'flowRight': true, 'flowRight': true,
'iteratee': true, 'iteratee': true,
'mixin': true, 'mixin': true,
'rearg': true,
'runInContext': true 'runInContext': true
}; };
@@ -300,10 +351,12 @@ exports.skipRearg = {
'overArgs': true, 'overArgs': true,
'partial': true, 'partial': true,
'partialRight': true, 'partialRight': true,
'propertyOf': true,
'random': true, 'random': true,
'range': true, 'range': true,
'rangeRight': true, 'rangeRight': true,
'subtract': true, 'subtract': true,
'zip': true, 'zip': true,
'zipObject': true 'zipObject': true,
'zipObjectDeep': true
}; };

View File

@@ -23,7 +23,7 @@ function copy(srcPath, destPath) {
} }
/** /**
* Creates an object of compiled template and base name pairs that match `pattern`. * Creates an object of base name and compiled template pairs that match `pattern`.
* *
* @memberOf file * @memberOf file
* @param {string} pattern The glob pattern to be match. * @param {string} pattern The glob pattern to be match.

View File

@@ -13,8 +13,8 @@ var uglifyOptions = require('./uglify.options');
* invokes `callback` upon completion. The callback is invoked with one argument: * invokes `callback` upon completion. The callback is invoked with one argument:
* (error). * (error).
* *
* If unspecified, `destPath` is `srcPath` with an extension of `.min.js`. For * If unspecified, `destPath` is `srcPath` with an extension of `.min.js`.
* example, a `srcPath` of `path/to/foo.js` would have a `destPath` of `path/to/foo.min.js`. * (e.g. the `destPath` of `path/to/foo.js` would be `path/to/foo.min.js`)
* *
* @param {string} srcPath The path of the file to minify. * @param {string} srcPath The path of the file to minify.
* @param {string} [destPath] The path to write the file to. * @param {string} [destPath] The path to write the file to.

View File

@@ -8,16 +8,14 @@
*/ */
module.exports = { module.exports = {
'compress': { 'compress': {
'negate_iife': false,
'pure_getters': true, 'pure_getters': true,
'unsafe': true, 'unsafe': true,
'warnings': false 'warnings': false
}, },
'mangle': {
'except': ['define']
},
'output': { 'output': {
'ascii_only': true, 'ascii_only': true,
'comments': /^!|@cc_on|@license|@preserve/i, 'comments': /@license/,
'max_line_len': 500 'max_line_len': 500
} }
}; };

View File

@@ -6,10 +6,10 @@ var _ = require('lodash');
/** /**
* Creates a hash object. If a `properties` object is provided, its own * Creates a hash object. If a `properties` object is provided, its own
* enumerable properties are assigned to the created object. * enumerable properties are assigned to the created hash.
* *
* @memberOf util * @memberOf util
* @param {Object} [properties] The properties to assign to the object. * @param {Object} [properties] The properties to assign to the hash.
* @returns {Object} Returns the new hash object. * @returns {Object} Returns the new hash object.
*/ */
function Hash(properties) { function Hash(properties) {
@@ -22,6 +22,19 @@ function Hash(properties) {
Hash.prototype = Object.create(null); Hash.prototype = Object.create(null);
/**
* This method throws any error it receives.
*
* @memberOf util
* @param {Object} [error] The error object.
*/
function pitch(error) {
if (error != null) {
throw error;
}
}
module.exports = { module.exports = {
'Hash': Hash 'Hash': Hash,
'pitch': pitch
}; };

View File

@@ -5,7 +5,8 @@ var _ = require('lodash'),
path = require('path'), path = require('path'),
webpack = require('webpack'); webpack = require('webpack');
var file = require('../common/file'); var file = require('../common/file'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'), var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'), distPath = path.join(basePath, 'dist'),
@@ -38,18 +39,17 @@ var mappingConfig = {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates browser builds of the FP converter and mappings at the `target` path.
throw error; *
} * @param {string} target The output directory path.
} */
function build() { function build() {
async.series([ async.series([
_.partial(webpack, mappingConfig), _.partial(webpack, mappingConfig),
_.partial(webpack, fpConfig), _.partial(webpack, fpConfig),
file.min(path.join(distPath, filename)) file.min(path.join(distPath, filename))
], onComplete); ], util.pitch);
} }
build(); build();

View File

@@ -5,7 +5,8 @@ var _ = require('lodash'),
path = require('path'); path = require('path');
var file = require('../common/file'), var file = require('../common/file'),
mapping = require('../common/mapping'); mapping = require('../common/mapping'),
util = require('../common/util');
var templatePath = path.join(__dirname, 'template/doc'), var templatePath = path.join(__dirname, 'template/doc'),
template = file.globTemplate(path.join(templatePath, '*.jst')); template = file.globTemplate(path.join(templatePath, '*.jst'));
@@ -18,16 +19,29 @@ var templateData = {
'toFuncList': toFuncList 'toFuncList': toFuncList
}; };
function toArgOrder(array) { /**
* Converts arranged argument `indexes` into a named argument string
* representation of their order.
*
* @param {number[]} indexes The arranged argument indexes.
* @returns {string} Returns the named argument string.
*/
function toArgOrder(indexes) {
var reordered = []; var reordered = [];
_.each(array, function(newIndex, index) { _.each(indexes, function(newIndex, index) {
reordered[newIndex] = argNames[index]; reordered[newIndex] = argNames[index];
}); });
return '`(' + reordered.join(', ') + ')`'; return '`(' + reordered.join(', ') + ')`';
} }
function toFuncList(array) { /**
var chunks = _.chunk(array.slice().sort(), 5), * Converts `funcNames` into a chunked list string representation.
*
* @param {string[]} funcNames The function names.
* @returns {string} Returns the function list string.
*/
function toFuncList(funcNames) {
var chunks = _.chunk(funcNames.slice().sort(), 5),
lastChunk = _.last(chunks), lastChunk = _.last(chunks),
last = lastChunk ? lastChunk.pop() : undefined; last = lastChunk ? lastChunk.pop() : undefined;
@@ -51,15 +65,14 @@ function toFuncList(array) {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates the FP-Guide wiki at the `target` path.
throw error; *
} * @param {string} target The output file path.
} */
function build(target) { function build(target) {
target = path.resolve(target); target = path.resolve(target);
fs.writeFile(target, template.wiki(templateData), onComplete); fs.writeFile(target, template.wiki(templateData), util.pitch);
} }
build(_.last(process.argv)); build(_.last(process.argv));

View File

@@ -6,7 +6,8 @@ var _ = require('lodash'),
path = require('path'); path = require('path');
var file = require('../common/file'), var file = require('../common/file'),
mapping = require('../common/mapping'); mapping = require('../common/mapping'),
util = require('../common/util');
var templatePath = path.join(__dirname, 'template/modules'), var templatePath = path.join(__dirname, 'template/modules'),
template = file.globTemplate(path.join(templatePath, '*.jst')); template = file.globTemplate(path.join(templatePath, '*.jst'));
@@ -42,21 +43,47 @@ var ignored = [
'lodash.min.js' 'lodash.min.js'
]; ];
function isAlias(funcName) { /**
return _.has(mapping.aliasToReal, funcName); * Checks if `name` is a method alias.
*
* @param {string} name The name to check.
* @returns {boolean} Returns `true` if `name` is a method alias, else `false`.
*/
function isAlias(name) {
return _.has(mapping.aliasToReal, name);
} }
function isCategory(funcName) { /**
return _.includes(categories, funcName); * Checks if `name` is a category name.
*
* @param {string} name The name to check.
* @returns {boolean} Returns `true` if `name` is a category name, else `false`.
*/
function isCategory(name) {
return _.includes(categories, name);
} }
function isThru(funcName) { /**
return !_.includes(aryMethods, funcName); * Checks if `name` belongs to a method that's passed thru and not wrapped.
*
* @param {string} name The name to check.
* @returns {boolean} Returns `true` if `name` is of a pass thru method,
* else `false`.
*/
function isThru(name) {
return !_.includes(aryMethods, name);
} }
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
function getTemplate(moduleName) { function getTemplate(moduleName) {
var data = { var data = {
'name': _.result(mapping.aliasToReal, moduleName, moduleName), 'name': _.get(mapping.aliasToReal, moduleName, moduleName),
'mapping': mapping 'mapping': mapping
}; };
@@ -74,12 +101,11 @@ function getTemplate(moduleName) {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates FP modules at the `target` path.
throw error; *
} * @param {string} target The output directory path.
} */
function build(target) { function build(target) {
target = path.resolve(target); target = path.resolve(target);
@@ -114,7 +140,7 @@ function build(target) {
actions.push(file.write(path.join(target, 'fp.js'), template.fp())); actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert())); actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
async.series(actions, onComplete); async.series(actions, util.pitch);
} }
build(_.last(process.argv)); build(_.last(process.argv));

View File

@@ -14,15 +14,15 @@ In a browser:
<script> <script>
// Loading `lodash.fp.js` converts `_` to its fp variant. // Loading `lodash.fp.js` converts `_` to its fp variant.
_.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 }); _.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
// { 'a: 1, 'b': 2 } // { 'a: 1, 'b': 2 }
// Use `noConflict` to restore the pre-fp variant. // Use `noConflict` to restore the pre-fp variant.
var fp = _.noConflict(); var fp = _.noConflict();
_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 }); _.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 });
// { 'a: 1, 'b': 2 } // { 'a: 1, 'b': 2 }
fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 }); fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
// { 'a: 1, 'b': 2 } // { 'a: 1, 'b': 2 }
</script> </script>
``` ```
@@ -51,12 +51,12 @@ Iteratee arguments are capped to avoid gotchas with variadic iteratees.
// The `lodash/map` iteratee receives three arguments: // The `lodash/map` iteratee receives three arguments:
// (value, index|key, collection) // (value, index|key, collection)
_.map(['6', '8', '10'], parseInt); _.map(['6', '8', '10'], parseInt);
// [6, NaN, 2] // [6, NaN, 2]
// The `lodash/fp/map` iteratee is capped at one argument: // The `lodash/fp/map` iteratee is capped at one argument:
// (value) // (value)
fp.map(parseInt)(['6', '8', '10']); fp.map(parseInt)(['6', '8', '10']);
// [6, 8, 10] // [6, 8, 10]
``` ```
Methods that cap iteratees to one argument:<br> Methods that cap iteratees to one argument:<br>
@@ -73,13 +73,13 @@ Methods have fixed arities to support auto-currying.
```js ```js
// `lodash/padStart` accepts an optional `chars` param. // `lodash/padStart` accepts an optional `chars` param.
_.padStart('a', 3, '-') _.padStart('a', 3, '-')
// '--a' // '--a'
// `lodash/fp/padStart` does not. // `lodash/fp/padStart` does not.
fp.padStart(3)('a'); fp.padStart(3)('a');
// ' a' // ' a'
fp.padCharsStart('-')(3)('a'); fp.padCharsStart('-')(3)('a');
// '--a' // '--a'
``` ```
Methods with a fixed arity of one:<br> Methods with a fixed arity of one:<br>
@@ -102,13 +102,13 @@ Method arguments are rearranged to make composition easier.
// (collection, iteratee) // (collection, iteratee)
var compact = _.partial(_.filter, _, Boolean); var compact = _.partial(_.filter, _, Boolean);
compact(['a', null, 'c']); compact(['a', null, 'c']);
// ['a', 'c'] // ['a', 'c']
// `lodash/fp/filter` is iteratee-first data-last: // `lodash/fp/filter` is iteratee-first data-last:
// (iteratee, collection) // (iteratee, collection)
var compact = fp.filter(Boolean); var compact = fp.filter(Boolean);
compact(['a', null, 'c']); compact(['a', null, 'c']);
// ['a', 'c'] // ['a', 'c']
``` ```
##### Most methods follow these rules ##### Most methods follow these rules
@@ -124,7 +124,7 @@ A fixed arity of four has an argument order of:<br>
##### Exceptions to the rules ##### Exceptions to the rules
Methods that accept an array of arguments as their second parameter:<br> Methods that accept an array of arguments:<br>
<%= toFuncList(_.keys(mapping.methodSpread)) %> <%= toFuncList(_.keys(mapping.methodSpread)) %>
Methods with unchanged argument orders:<br> Methods with unchanged argument orders:<br>
@@ -161,11 +161,11 @@ arguments of the curried returned function.
```js ```js
// The equivalent of `2 > 5`. // The equivalent of `2 > 5`.
_.gt(2)(5); _.gt(2)(5);
// false // false
// The equivalent of `_.gt(5, 2)` or `5 > 2`. // The equivalent of `_.gt(5, 2)` or `5 > 2`.
_.gt(_, 2)(5); _.gt(_, 2)(5);
// true // true
``` ```
## Chaining ## Chaining

View File

@@ -1,5 +1,5 @@
var convert = require('./convert'), var convert = require('./convert'),
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>')); func = convert('<%= name %>', require('../<%= _.get(mapping.remap, name, name) %>'));
func.placeholder = require('./placeholder'); func.placeholder = require('./placeholder');
module.exports = func; module.exports = func;

View File

@@ -1,5 +1,5 @@
var convert = require('./convert'), var convert = require('./convert'),
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'), require('./_falseOptions')); func = convert('<%= name %>', require('../<%= _.get(mapping.remap, name, name) %>'), require('./_falseOptions'));
func.placeholder = require('./placeholder'); func.placeholder = require('./placeholder');
module.exports = func; module.exports = func;

View File

@@ -3,7 +3,8 @@
var async = require('async'), var async = require('async'),
path = require('path'); path = require('path');
var file = require('../common/file'); var file = require('../common/file'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'), var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'), distPath = path.join(basePath, 'dist'),
@@ -14,17 +15,16 @@ var baseLodash = path.join(basePath, filename),
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates browser builds of Lodash at the `target` path.
throw error; *
} * @param {string} target The output directory path.
} */
function build() { function build() {
async.series([ async.series([
file.copy(baseLodash, distLodash), file.copy(baseLodash, distLodash),
file.min(distLodash) file.min(distLodash)
], onComplete); ], util.pitch);
} }
build(); build();

View File

@@ -5,6 +5,8 @@ var _ = require('lodash'),
fs = require('fs-extra'), fs = require('fs-extra'),
path = require('path'); path = require('path');
var util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'), var basePath = path.join(__dirname, '..', '..'),
docPath = path.join(basePath, 'doc'), docPath = path.join(basePath, 'doc'),
readmePath = path.join(docPath, 'README.md'); readmePath = path.join(docPath, 'README.md');
@@ -16,10 +18,11 @@ var config = {
'base': { 'base': {
'entryLinks': [ 'entryLinks': [
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' + '<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
'print("[&#x24C3;](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' + 'print("[npm package](https://www.npmjs.com/package/lodash." + name.toLowerCase() + ")")' +
'} %>' '} %>'
], ],
'path': path.join(basePath, 'lodash.js'), 'path': path.join(basePath, 'lodash.js'),
'sourceLink': '[source](${sourceHref})',
'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>', 'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
'toc': 'categories', 'toc': 'categories',
'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js' 'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
@@ -28,28 +31,33 @@ var config = {
'hash': 'github' 'hash': 'github'
}, },
'site': { 'site': {
'tocLink': '#docs' 'tocHref': '#docs'
} }
}; };
function postprocess(string) { /**
* Post-process `markdown` to make adjustments.
*
* @param {string} markdown The markdown to process.
* @returns {string} Returns the processed markdown.
*/
function postprocess(markdown) {
// Wrap symbol property identifiers in brackets. // Wrap symbol property identifiers in brackets.
return string.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]'); return markdown.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates the documentation markdown formatted for 'github' or 'site'.
throw error; *
} * @param {string} type The format type.
} */
function build(type) { function build(type) {
var options = _.defaults({}, config.base, config[type]), var options = _.defaults({}, config.base, config[type]),
markdown = docdown(options); markdown = docdown(options);
fs.writeFile(readmePath, postprocess(markdown), onComplete); fs.writeFile(readmePath, postprocess(markdown), util.pitch);
} }
build(_.last(process.argv)); build(_.last(process.argv));

View File

@@ -4,7 +4,8 @@ var _ = require('lodash'),
async = require('async'), async = require('async'),
path = require('path'); path = require('path');
var file = require('../common/file'); var file = require('../common/file'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'), var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'); distPath = path.join(basePath, 'dist');
@@ -17,18 +18,17 @@ var filePairs = [
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
function onComplete(error) { /**
if (error) { * Creates supplementary Lodash modules at the `target` path.
throw error; *
} * @param {string} target The output directory path.
} */
function build(target) { function build(target) {
var actions = _.map(filePairs, function(pair) { var actions = _.map(filePairs, function(pair) {
return file.copy(pair[0], path.join(target, pair[1])); return file.copy(pair[0], path.join(target, pair[1]));
}); });
async.series(actions, onComplete); async.series(actions, util.pitch);
} }
build(_.last(process.argv)); build(_.last(process.argv));

54
lib/main/build-site.js Normal file
View File

@@ -0,0 +1,54 @@
'use strict';
var _ = require('lodash'),
fs = require('fs'),
marky = require('marky-markdown'),
path = require('path'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'),
docPath = path.join(basePath, 'doc'),
readmePath = path.join(docPath, 'README.md');
function build(type) {
// Load markdown and uncomment docdown HTML hints.
var markdown = fs
.readFileSync(readmePath, 'utf8')
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
var $ = marky(markdown, { 'sanitize': false }),
$header = $('h1').first().remove(),
version = _.trim($header.find('span').first().text()).slice(1);
// Remove docdown horizontal rules.
$('hr').remove();
// Remove table of contents (toc) links.
$('a[href="#docs"]').remove();
// Remove marky-markdown additions.
$('[id^="user-content-"]')
.attr('class', null)
.attr('id', null);
$(':header > a[href]').each(function() {
var $a = $(this);
$a.replaceWith($a.html());
});
// Append YAML front matter.
var html = [
'---',
'id: docs',
'layout: docs',
'title: Lodash Documentation',
'version: ' + (version || null),
'---',
'',
_.trim($.html()),
].join('\n');
fs.writeFile(path.join(docPath, version + '.html'), html, util.pitch);
}
build();

1353
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash", "name": "lodash",
"version": "4.13.1", "version": "4.14.0",
"license": "MIT", "license": "MIT",
"private": true, "private": true,
"main": "lodash.js", "main": "lodash.js",
@@ -13,6 +13,7 @@
"doc": "node lib/main/build-doc github && npm run test:doc", "doc": "node lib/main/build-doc github && npm run test:doc",
"doc:fp": "node lib/fp/build-doc", "doc:fp": "node lib/fp/build-doc",
"doc:site": "node lib/main/build-doc site", "doc:site": "node lib/main/build-doc site",
"doc:sitehtml": "optional-dev-dependency marky-markdown@^7.0.2 && npm run doc:site && node lib/main/build-site",
"prepublish": "npm run build", "prepublish": "npm run build",
"pretest": "npm run build", "pretest": "npm run build",
"style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test", "style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test",
@@ -27,29 +28,30 @@
"validate": "npm run style && npm run test" "validate": "npm run style && npm run test"
}, },
"devDependencies": { "devDependencies": {
"async": "^1.5.2", "async": "^2.0.1",
"benchmark": "^2.1.0", "benchmark": "^2.1.1",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"codecov.io": "~0.1.6", "codecov.io": "~0.1.6",
"coveralls": "^2.11.9", "coveralls": "^2.11.11",
"curl-amd": "~0.8.12", "curl-amd": "~0.8.12",
"docdown": "~0.5.1", "docdown": "~0.6.1",
"dojo": "^1.11.1", "dojo": "^1.11.2",
"ecstatic": "^1.4.1", "ecstatic": "^1.4.1",
"fs-extra": "~0.30.0", "fs-extra": "~0.30.0",
"glob": "^7.0.3", "glob": "^7.0.5",
"istanbul": "0.4.3", "istanbul": "0.4.4",
"jquery": "^2.2.4", "jquery": "^3.1.0",
"jscs": "^3.0.1", "jscs": "^3.0.7",
"lodash": "4.11.2", "lodash": "4.13.1",
"markdown-doctest": "^0.6.0", "markdown-doctest": "^0.8.1",
"optional-dev-dependency": "^1.3.0",
"platform": "^1.3.1", "platform": "^1.3.1",
"qunit-extras": "^2.0.0", "qunit-extras": "^2.1.0",
"qunitjs": "~1.23.1", "qunitjs": "^2.0.0",
"request": "^2.69.0", "request": "^2.74.0",
"requirejs": "^2.2.0", "requirejs": "^2.2.0",
"sauce-tunnel": "^2.4.0", "sauce-tunnel": "^2.5.0",
"uglify-js": "2.6.2", "uglify-js": "2.7.0",
"webpack": "^1.13.1" "webpack": "^1.13.1"
} }
} }

View File

@@ -15,27 +15,8 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* 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. // Initialize controls.
addListener(window, 'load', function() { addEventListener('load', function() {
function eventHandler(event) { function eventHandler(event) {
var buildIndex = buildList.selectedIndex, var buildIndex = buildList.selectedIndex,
otherIndex = otherList.selectedIndex, otherIndex = otherList.selectedIndex,
@@ -96,8 +77,8 @@
return -1; return -1;
}()); }());
addListener(buildList, 'change', eventHandler); buildList.addEventListener('change', eventHandler);
addListener(otherList, 'change', eventHandler); otherList.addEventListener('change', eventHandler);
}); });
// The lodash build file path. // The lodash build file path.

View File

@@ -10,16 +10,27 @@
height: 100%; height: 100%;
} }
#FirebugUI { #FirebugUI {
top: 2em; top: 2.5em;
} }
#perf-toolbar { #perf-toolbar {
background-color: #EEE; background-color: #EEE;
color: #5E740B; color: #5E740B;
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
font-size: small; font-size: small;
padding: 0.5em 0 0.5em 2em; padding: 0.5em 1em 0.5em 1em;
overflow: hidden; overflow: hidden;
} }
#perf-toolbar label {
display: inline-block;
margin-right: 0.5em;
}
#perf-toolbar span {
display: inline-block;
float: right;
line-height: 2.1em;
margin-left: 1em;
margin-top: 0;
}
</style> </style>
</head> </head>
<body> <body>

View File

@@ -1,4 +1,5 @@
;(function() { ;(function() {
'use strict';
/** Used to access the Firebug Lite panel (set by `run`). */ /** Used to access the Firebug Lite panel (set by `run`). */
var fbPanel; var fbPanel;

View File

@@ -15,27 +15,8 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* 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. // Initialize controls.
addListener(window, 'load', function() { addEventListener('load', function() {
function eventHandler(event) { function eventHandler(event) {
var buildIndex = buildList.selectedIndex, var buildIndex = buildList.selectedIndex,
loaderIndex = loaderList.selectedIndex, loaderIndex = loaderList.selectedIndex,
@@ -59,8 +40,8 @@
setTimeout(init, 15); setTimeout(init, 15);
return; return;
} }
toolbar.appendChild(span1); toolbar.insertBefore(span2, toolbar.lastChild);
toolbar.appendChild(span2); toolbar.insertBefore(span1, span2);
buildList.selectedIndex = (function() { buildList.selectedIndex = (function() {
switch (build) { switch (build) {
@@ -84,12 +65,11 @@
return -1; return -1;
}()); }());
addListener(buildList, 'change', eventHandler); buildList.addEventListener('change', eventHandler);
addListener(loaderList, 'change', eventHandler); loaderList.addEventListener('change', eventHandler);
} }
var span1 = document.createElement('span'); var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML = span1.innerHTML =
'<label for="qunit-build">Build: </label>' + '<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' + '<select id="qunit-build">' +
@@ -100,7 +80,6 @@
'</select>'; '</select>';
var span2 = document.createElement('span'); var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML = span2.innerHTML =
'<label for="qunit-loader">Loader: </label>' + '<label for="qunit-loader">Loader: </label>' +
'<select id="qunit-loader">' + '<select id="qunit-loader">' +
@@ -110,6 +89,12 @@
'<option value="requirejs">RequireJS</option>' + '<option value="requirejs">RequireJS</option>' +
'</select>'; '</select>';
span1.style.cssText =
span2.style.cssText = 'display:inline-block;float:right;line-height:2.1em;margin-left:1em;margin-top:0;';
span1.firstChild.style.cssText =
span2.firstChild.style.cssText = 'display:inline-block;margin-right:.5em;';
var buildList = span1.lastChild, var buildList = span1.lastChild,
loaderList = span2.lastChild; loaderList = span2.lastChild;

View File

@@ -1,3 +1,5 @@
'use strict';
self.console || (self.console = { 'log': function() {} }); self.console || (self.console = { 'log': function() {} });
addEventListener('message', function(e) { addEventListener('message', function(e) {

View File

@@ -104,10 +104,10 @@ var browserNameMap = {
/** List of platforms to load the runner on. */ /** List of platforms to load the runner on. */
var platforms = [ var platforms = [
['Linux', 'android', '5.1'], ['Linux', 'android', '5.1'],
['Windows 10', 'chrome', '51'],
['Windows 10', 'chrome', '50'], ['Windows 10', 'chrome', '50'],
['Windows 10', 'chrome', '49'], ['Windows 10', 'firefox', '47'],
['Windows 10', 'firefox', '46'], ['Windows 10', 'firefox', '46'],
['Windows 10', 'firefox', '45'],
['Windows 10', 'microsoftedge', '13'], ['Windows 10', 'microsoftedge', '13'],
['Windows 10', 'internet explorer', '11'], ['Windows 10', 'internet explorer', '11'],
['Windows 8', 'internet explorer', '10'], ['Windows 8', 'internet explorer', '10'],
@@ -294,7 +294,7 @@ function optionToArray(name, string) {
function optionToValue(name, string) { function optionToValue(name, string) {
var result = string.match(RegExp('^' + name + '(?:=([\\s\\S]+))?$')); var result = string.match(RegExp('^' + name + '(?:=([\\s\\S]+))?$'));
if (result) { if (result) {
result = _.result(result, 1); result = _.get(result, 1);
result = result ? _.trim(result) : true; result = result ? _.trim(result) : true;
} }
if (result === 'false') { if (result === 'false') {
@@ -366,8 +366,8 @@ function onJobStart(error, res, body) {
if (this.stopping) { if (this.stopping) {
return; return;
} }
var statusCode = _.result(res, 'statusCode'), var statusCode = _.get(res, 'statusCode'),
taskId = _.first(_.result(body, 'js tests')); taskId = _.first(_.get(body, 'js tests'));
if (error || !taskId || statusCode != 200) { if (error || !taskId || statusCode != 200) {
if (this.attempts < this.retries) { if (this.attempts < this.retries) {
@@ -408,19 +408,19 @@ function onJobStatus(error, res, body) {
if (!this.running || this.stopping) { if (!this.running || this.stopping) {
return; return;
} }
var completed = _.result(body, 'completed', false), var completed = _.get(body, 'completed', false),
data = _.first(_.result(body, 'js tests')), data = _.first(_.get(body, 'js tests')),
elapsed = (_.now() - this.timestamp) / 1000, elapsed = (_.now() - this.timestamp) / 1000,
jobId = _.result(data, 'job_id', null), jobId = _.get(data, 'job_id', null),
jobResult = _.result(data, 'result', null), jobResult = _.get(data, 'result', null),
jobStatus = _.result(data, 'status', ''), jobStatus = _.get(data, 'status', ''),
jobUrl = _.result(data, 'url', null), jobUrl = _.get(data, 'url', null),
expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')), expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')),
options = this.options, options = this.options,
platform = options.platforms[0]; platform = options.platforms[0];
if (_.isObject(jobResult)) { if (_.isObject(jobResult)) {
var message = _.result(jobResult, 'message'); var message = _.get(jobResult, 'message');
} else { } else {
if (typeof jobResult == 'string') { if (typeof jobResult == 'string') {
message = jobResult; message = jobResult;
@@ -442,7 +442,7 @@ function onJobStatus(error, res, body) {
} }
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]), var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus), errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
failures = _.result(jobResult, 'failed'), failures = _.get(jobResult, 'failed'),
label = options.name + ':', label = options.name + ':',
tunnel = this.tunnel; tunnel = this.tunnel;
@@ -463,7 +463,7 @@ function onJobStatus(error, res, body) {
return; return;
} }
else { else {
if (typeof message == 'undefined') { if (message === undefined) {
message = 'Results are unavailable. ' + details; message = 'Results are unavailable. ' + details;
} }
console.error(label, description, chalk.red('failed') + ';', message); console.error(label, description, chalk.red('failed') + ';', message);

View File

@@ -1,4 +1,5 @@
;(function() { ;(function() {
'use strict';
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -22,6 +23,7 @@
/** Math helpers. */ /** Math helpers. */
var add = function(x, y) { return x + y; }, var add = function(x, y) { return x + y; },
isEven = function(n) { return n % 2 == 0; }, isEven = function(n) { return n % 2 == 0; },
isEvenIndex = function(n, index) { return isEven(index); },
square = function(n) { return n * n; }; square = function(n) { return n * n; };
// Leak to avoid sporadic `noglobals` fails on Edge in Sauce Labs. // Leak to avoid sporadic `noglobals` fails on Edge in Sauce Labs.
@@ -140,11 +142,8 @@
if (!document) { if (!document) {
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
lodash = convert({ 'remove': _.remove }, allFalseOptions); lodash = convert({ 'remove': _.remove }, allFalseOptions),
actual = lodash.remove(array, isEvenIndex);
var actual = lodash.remove(array, function(n, index) {
return isEven(index);
});
assert.deepEqual(array, [2, 4]); assert.deepEqual(array, [2, 4]);
assert.deepEqual(actual, [1, 3]); assert.deepEqual(actual, [1, 3]);
@@ -159,11 +158,8 @@
assert.expect(3); assert.expect(3);
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
lodash = convert(_.runInContext(), allFalseOptions); lodash = convert(_.runInContext(), allFalseOptions),
actual = lodash.remove(array, isEvenIndex);
var actual = lodash.remove(array, function(n, index) {
return isEven(index);
});
assert.deepEqual(array, [2, 4]); assert.deepEqual(array, [2, 4]);
assert.deepEqual(actual, [1, 3]); assert.deepEqual(actual, [1, 3]);
@@ -175,11 +171,8 @@
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
runInContext = convert('runInContext', _.runInContext, allFalseOptions), runInContext = convert('runInContext', _.runInContext, allFalseOptions),
lodash = runInContext(); lodash = runInContext(),
actual = lodash.remove(array, isEvenIndex);
var actual = lodash.remove(array, function(n, index) {
return isEven(index);
});
assert.deepEqual(array, [2, 4]); assert.deepEqual(array, [2, 4]);
assert.deepEqual(actual, [1, 3]); assert.deepEqual(actual, [1, 3]);
@@ -192,7 +185,7 @@
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
value = _.clone(array), value = _.clone(array),
remove = convert('remove', _.remove, { 'cap': false }), remove = convert('remove', _.remove, { 'cap': false }),
actual = remove(function(n, index) { return isEven(index); })(value); actual = remove(isEvenIndex)(value);
assert.deepEqual(value, [1, 2, 3, 4]); assert.deepEqual(value, [1, 2, 3, 4]);
assert.deepEqual(actual, [2, 4]); assert.deepEqual(actual, [2, 4]);
@@ -295,11 +288,8 @@
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
lodash = func(allFalseOptions), lodash = func(allFalseOptions),
remove = isFp ? lodash.remove : lodash; remove = isFp ? lodash.remove : lodash,
actual = remove(array, isEvenIndex);
var actual = remove(array, function(n, index) {
return isEven(index);
});
assert.deepEqual(array, [2, 4]); assert.deepEqual(array, [2, 4]);
assert.deepEqual(actual, [1, 3]); assert.deepEqual(actual, [1, 3]);
@@ -311,11 +301,8 @@
var array = [1, 2, 3, 4], var array = [1, 2, 3, 4],
lodash = func({ 'cap': false }), lodash = func({ 'cap': false }),
remove = (isFp ? lodash.remove : lodash).convert({ 'rearg': false }); remove = (isFp ? lodash.remove : lodash).convert({ 'rearg': false }),
actual = remove(array)(isEvenIndex);
var actual = remove(array)(function(n, index) {
return isEven(index);
});
assert.deepEqual(array, [1, 2, 3, 4]); assert.deepEqual(array, [1, 2, 3, 4]);
assert.deepEqual(actual, [2, 4]); assert.deepEqual(actual, [2, 4]);
@@ -344,7 +331,7 @@
var aryCap = index + 1; var aryCap = index + 1;
var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) { var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
var key = _.result(mapping.remap, methodName, methodName), var key = _.get(mapping.remap, methodName, methodName),
arity = _[key].length; arity = _[key].length;
return arity != 0 && arity < aryCap; return arity != 0 && arity < aryCap;
@@ -413,7 +400,7 @@
'wrap' 'wrap'
]; ];
var exceptions = _.difference(funcMethods.concat('matchesProperty'), ['cloneDeepWith', 'cloneWith', 'delay']), var exceptions = _.without(funcMethods.concat('matchesProperty'), 'delay'),
expected = _.map(mapping.aryMethod[2], _.constant(true)); expected = _.map(mapping.aryMethod[2], _.constant(true));
var actual = _.map(mapping.aryMethod[2], function(methodName) { var actual = _.map(mapping.aryMethod[2], function(methodName) {
@@ -727,6 +714,20 @@
}); });
}); });
_.each(['assignAll', 'assignInAll', 'defaultsAll', 'defaultsDeepAll', 'mergeAll'], function(methodName) {
var func = fp[methodName];
QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
assert.expect(2);
var objects = [{ 'a': 1 }, { 'b': 2 }],
actual = func(objects);
assert.deepEqual(objects[0], { 'a': 1 });
assert.deepEqual(actual, { 'a': 1, 'b': 2 });
});
});
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('assignWith methods'); QUnit.module('assignWith methods');
@@ -749,13 +750,36 @@
QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) { QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
assert.expect(2); assert.expect(2);
var object = { 'a': 1 }; var objects = [{ 'a': 1 }, { 'b': 2 }],
actual = func(_.nthArg(1))(objects[0])(objects[1]);
var actual = func(function(objValue, srcValue) { assert.deepEqual(objects[0], { 'a': 1 });
return srcValue; assert.deepEqual(actual, { 'a': 1, 'b': 2 });
})(object)({ 'b': 2 }); });
});
assert.deepEqual(object, { 'a': 1 }); _.each(['assignAllWith', 'assignInAllWith', 'extendAllWith'], function(methodName) {
var func = fp[methodName];
QUnit.test('`fp.' + methodName + '` should provide the correct `customizer` arguments', function(assert) {
assert.expect(1);
var args;
func(function() {
args || (args = _.map(arguments, _.cloneDeep));
})([{ 'a': 1 }, { 'b': 2 }]);
assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }]);
});
QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
assert.expect(2);
var objects = [{ 'a': 1 }, { 'b': 2 }],
actual = func(_.nthArg(1))(objects);
assert.deepEqual(objects[0], { 'a': 1 });
assert.deepEqual(actual, { 'a': 1, 'b': 2 }); assert.deepEqual(actual, { 'a': 1, 'b': 2 });
}); });
}); });
@@ -833,6 +857,19 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('fp.defaultTo');
(function() {
QUnit.test('should have an argument order of `defaultValue` then `value`', function(assert) {
assert.expect(2);
assert.strictEqual(fp.defaultTo(1)(0), 0);
assert.strictEqual(fp.defaultTo(1)(undefined), 1);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.difference'); QUnit.module('fp.difference');
(function() { (function() {
@@ -910,10 +947,9 @@
var object = { 'a': 1 }, var object = { 'a': 1 },
extend = convert('extend', _.extend), extend = convert('extend', _.extend),
value = _.clone(object), actual = extend(object)(new Foo);
actual = extend(value)(new Foo);
assert.deepEqual(value, object); assert.deepEqual(object, { 'a': 1 });
assert.deepEqual(actual, { 'a': 1, 'b': 2 }); assert.deepEqual(actual, { 'a': 1, 'b': 2 });
}); });
}()); }());
@@ -1012,8 +1048,8 @@
var array = [1, 2, 3, 1, 2, 3]; var array = [1, 2, 3, 1, 2, 3];
assert.deepEqual(func(resolve(1))(2)(array), 3); assert.strictEqual(func(resolve(1))(2)(array), 3);
assert.deepEqual(func(resolve(2))(-3)(array), 4); assert.strictEqual(func(resolve(2))(-3)(array), 4);
}); });
}); });
@@ -1030,8 +1066,8 @@
var array = [1, 2, 3, 1, 2, 3]; var array = [1, 2, 3, 1, 2, 3];
assert.deepEqual(func(resolve(2))(3)(array), 1); assert.strictEqual(func(resolve(2))(3)(array), 1);
assert.deepEqual(func(resolve(3))(-3)(array), 2); assert.strictEqual(func(resolve(3))(-3)(array), 2);
}); });
}); });
@@ -1273,7 +1309,7 @@
var args, var args,
iteration = 0, iteration = 0,
objects = [{ 'a': 1 }, { 'a': 2 }], objects = [{ 'a': 1 }, { 'a': 2 }],
stack = { '__data__': { '__data__': [objects] } }, stack = { '__data__': { '__data__': [objects, objects.slice().reverse()] } },
expected = [1, 2, 'a', objects[0], objects[1], stack]; expected = [1, 2, 'a', objects[0], objects[1], stack];
fp.isEqualWith(function() { fp.isEqualWith(function() {
@@ -1409,11 +1445,11 @@
var args, var args,
stack = { '__data__': { '__data__': [] } }, stack = { '__data__': { '__data__': [] } },
expected = [[1], [2, 3], 'a', { 'a': [1] }, { 'a': [2, 3] }, stack]; expected = [[1, 2], [3], 'a', { 'a': [1, 2] }, { 'a': [3] }, stack];
fp.mergeWith(function() { fp.mergeWith(function() {
args || (args = _.map(arguments, _.cloneDeep)); args || (args = _.map(arguments, _.cloneDeep));
})({ 'a': [1] })({ 'a': [2, 3] }); })({ 'a': [1, 2] })({ 'a': [3] });
args[5] = _.omitBy(args[5], _.isFunction); args[5] = _.omitBy(args[5], _.isFunction);
args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction); args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);
@@ -1424,17 +1460,44 @@
QUnit.test('should not mutate values', function(assert) { QUnit.test('should not mutate values', function(assert) {
assert.expect(2); assert.expect(2);
var object = { 'a': { 'b': 2, 'c': 3 } }; var objects = [{ 'a': [1, 2] }, { 'a': [3] }],
object.a.b = [1]; actual = fp.mergeWith(_.noop, objects[0], objects[1]);
var actual = fp.mergeWith(function(objValue, srcValue) { assert.deepEqual(objects[0], { 'a': [1, 2] });
if (_.isArray(objValue)) { assert.deepEqual(actual, { 'a': [3, 2] });
return objValue.concat(srcValue); });
} }());
}, object, { 'a': { 'b': [2, 3] } });
assert.deepEqual(object, { 'a': { 'b': [1], 'c': 3 } }); /*--------------------------------------------------------------------------*/
assert.deepEqual(actual, { 'a': { 'b': [1, 2, 3], 'c': 3 } });
QUnit.module('fp.mergeAllWith');
(function() {
QUnit.test('should provide the correct `customizer` arguments', function(assert) {
assert.expect(1);
var args,
stack = { '__data__': { '__data__': [] } },
expected = [[1, 2], [3], 'a', { 'a': [1, 2] }, { 'a': [3] }, stack];
fp.mergeAllWith(function() {
args || (args = _.map(arguments, _.cloneDeep));
})([{ 'a': [1, 2] }, { 'a': [3] }]);
args[5] = _.omitBy(args[5], _.isFunction);
args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);
assert.deepEqual(args, expected);
});
QUnit.test('should not mutate values', function(assert) {
assert.expect(2);
var objects = [{ 'a': [1, 2] }, { 'a': [3] }],
actual = fp.mergeAllWith(_.noop, objects);
assert.deepEqual(objects[0], { 'a': [1, 2] });
assert.deepEqual(actual, { 'a': [3, 2] });
}); });
}()); }());
@@ -1515,11 +1578,11 @@
Foo.mixin = object.mixin; Foo.mixin = object.mixin;
Foo.mixin(source); Foo.mixin(source);
assert.strictEqual(typeof Foo.a, 'function'); assert.ok('a' in Foo);
assert.notOk('a' in Foo.prototype); assert.notOk('a' in Foo.prototype);
object.mixin(source); object.mixin(source);
assert.strictEqual(typeof object.a, 'function'); assert.ok('a' in object);
}); });
}()); }());
@@ -1621,6 +1684,21 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('fp.propertyOf');
(function() {
QUnit.test('should be curried', function(assert) {
assert.expect(2);
var object = { 'a': 1 };
assert.strictEqual(fp.propertyOf(object, 'a'), 1);
assert.strictEqual(fp.propertyOf(object)('a'), 1);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.pull'); QUnit.module('fp.pull');
(function() { (function() {
@@ -1701,6 +1779,30 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('fp.rearg');
(function() {
function fn(a, b, c) {
return [a, b, c];
}
QUnit.test('should be curried', function(assert) {
assert.expect(1);
var rearged = fp.rearg([1, 2, 0])(fn);
assert.deepEqual(rearged('c', 'a', 'b'), ['a', 'b', 'c']);
});
QUnit.test('should curry the rearged function', function(assert) {
assert.expect(1);
var rearged = fp.rearg([1, 2, 0], fn);
assert.deepEqual(rearged('c')('a')('b'), ['a', 'b', 'c']);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('reduce methods'); QUnit.module('reduce methods');
_.each(['reduce', 'reduceRight'], function(methodName) { _.each(['reduce', 'reduceRight'], function(methodName) {
@@ -1951,11 +2053,8 @@
QUnit.test('should work with an `iteratee` argument', function(assert) { QUnit.test('should work with an `iteratee` argument', function(assert) {
assert.expect(1); assert.expect(1);
var expected = objects.slice(0, 3); var expected = objects.slice(0, 3),
actual = fp.uniqBy(_.property('a'))(objects);
var actual = fp.uniqBy(function(object) {
return object.a;
})(objects);
assert.deepEqual(actual, expected); assert.deepEqual(actual, expected);
}); });
@@ -2135,6 +2234,18 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('fp.zipAll');
(function() {
QUnit.test('should zip together an array of arrays', function(assert) {
assert.expect(1);
assert.deepEqual(fp.zipAll([[1, 2], [3, 4], [5, 6]]), [[1, 3, 5], [2, 4, 6]]);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.zipObject'); QUnit.module('fp.zipObject');
(function() { (function() {
@@ -2169,5 +2280,6 @@
if (!document) { if (!document) {
QUnit.config.noglobals = true; QUnit.config.noglobals = true;
QUnit.load(); QUnit.load();
QUnit.start();
} }
}.call(this)); }.call(this));

File diff suppressed because it is too large Load Diff

View File

@@ -56,9 +56,6 @@
'works on an arguments object', 'works on an arguments object',
'can handle very deep arrays' 'can handle very deep arrays'
], ],
'head': [
'is an alias for first'
],
'indexOf': [ 'indexOf': [
"sorted indexOf doesn't uses binary search", "sorted indexOf doesn't uses binary search",
'0' '0'
@@ -86,9 +83,6 @@
'an array of pairs zipped together into an object', 'an array of pairs zipped together into an object',
'an object converted to pairs and back to an object' 'an object converted to pairs and back to an object'
], ],
'range': [
'range with two arguments a &amp; b, b&lt;a generates an empty array'
],
'rest': [ 'rest': [
'returns the whole array when index is 0', 'returns the whole array when index is 0',
'returns elements starting at the given index', 'returns elements starting at the given index',
@@ -129,7 +123,8 @@
'Iterating objects with sketchy length properties': true, 'Iterating objects with sketchy length properties': true,
'Resistant to collection length and properties changing while iterating': true, 'Resistant to collection length and properties changing while iterating': true,
'countBy': [ 'countBy': [
'true' '{}',
'[{}]'
], ],
'each': [ 'each': [
'context object property accessed' 'context object property accessed'
@@ -141,24 +136,17 @@
], ],
'filter': [ 'filter': [
'given context', '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' 'OO-filter'
], ],
'find': [ 'find': [
'{"a":1,"b":4}',
'undefined when not found',
'undefined when searching empty list',
'works on objects',
'undefined',
'called with context' 'called with context'
], ],
'findWhere': [ 'findWhere': [
'checks properties given function' 'checks properties given function'
], ],
'groupBy': [ 'groupBy': [
'true' '{}',
'[{}]'
], ],
'includes': [ 'includes': [
"doesn't delegate to binary search" "doesn't delegate to binary search"
@@ -198,8 +186,7 @@
'partition': [ 'partition': [
'can reference the array index', 'can reference the array index',
'Died on test #8', 'Died on test #8',
'partition takes a context argument', 'partition takes a context argument'
'function(a){[code]}'
], ],
'pluck': [ 'pluck': [
'[1]' '[1]'
@@ -223,15 +210,15 @@
'checks properties given function' 'checks properties given function'
], ],
'Can use various collection methods on NodeLists': [ 'Can use various collection methods on NodeLists': [
'<span id="id2"></span>', '<span id="id2"></span>'
'<span id="id1"></span>'
] ]
}, },
'Functions': { 'Functions': {
'debounce asap': true, 'debounce asap': true,
'debounce asap cancel': true, 'debounce asap cancel': true,
'debounce after system time is set backwards': true,
'debounce asap recursively': true, 'debounce asap recursively': true,
'debounce after system time is set backwards': true,
'debounce re-entrant': true,
'throttle repeatedly with results': true, 'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': 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, 'throttle does not trigger trailing call when trailing is set to false': true,
@@ -245,17 +232,17 @@
'bindAll': [ 'bindAll': [
'throws an error for bindAll with no functions named' 'throws an error for bindAll with no functions named'
], ],
'debounce': [
'incr was debounced'
],
'iteratee': [
'"bbiz"',
'"foo"',
'1'
],
'memoize': [ 'memoize': [
'{"bar":"BAR","foo":"FOO"}', '{"bar":"BAR","foo":"FOO"}',
'Died on test #8' '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': { 'Objects': {
@@ -265,10 +252,6 @@
'is not fooled by sparse arrays with additional properties', 'is not fooled by sparse arrays with additional properties',
'[]' '[]'
], ],
'defaults': [
'defaults skips nulls',
'defaults skips undefined'
],
'extend': [ 'extend': [
'extending null results in null', 'extending null results in null',
'extending undefined results in undefined' 'extending undefined results in undefined'
@@ -285,15 +268,13 @@
'Commutative equality is implemented for `0` and `-0`', 'Commutative equality is implemented for `0` and `-0`',
'`new Number(0)` and `-0` are not equal', '`new Number(0)` and `-0` are not equal',
'Commutative equality is implemented for `new Number(0)` and `-0`', 'Commutative equality is implemented for `new Number(0)` and `-0`',
'Invalid dates are not equal',
'false' 'false'
], ],
'isFinite': [ 'isFinite': [
'Numeric strings are numbers', 'Numeric strings are numbers',
'Number instances can be finite' 'Number instances can be finite'
], ],
'isMatch': [
'doesnt falsey match constructor on undefined/null'
],
'isSet': [ 'isSet': [
'Died on test #9' 'Died on test #9'
], ],
@@ -309,10 +290,6 @@
'called with context', 'called with context',
'mapValue identity' 'mapValue identity'
], ],
'matcher': [
'null matches null',
'treats primitives as empty'
],
'omit': [ 'omit': [
'can accept a predicate', 'can accept a predicate',
'function is given context' 'function is given context'
@@ -323,7 +300,6 @@
] ]
}, },
'Utility': { 'Utility': {
'noConflict (node vm)': true,
'now': [ 'now': [
'Produces the correct time in milliseconds' 'Produces the correct time in milliseconds'
], ],

View File

@@ -394,6 +394,7 @@
var Model = Backbone.Model = function(attributes, options) { var Model = Backbone.Model = function(attributes, options) {
var attrs = attributes || {}; var attrs = attributes || {};
options || (options = {}); options || (options = {});
this.preinitialize.apply(this, arguments);
this.cid = _.uniqueId(this.cidPrefix); this.cid = _.uniqueId(this.cidPrefix);
this.attributes = {}; this.attributes = {};
if (options.collection) this.collection = options.collection; if (options.collection) this.collection = options.collection;
@@ -422,6 +423,10 @@
// You may want to override this if you're experiencing name clashes with model ids. // You may want to override this if you're experiencing name clashes with model ids.
cidPrefix: 'c', cidPrefix: 'c',
// preinitialize is an empty function by default. You can override it with a function
// or object. preinitialize will run before any instantiation logic is run in the Model.
preinitialize: function(){},
// Initialize is an empty function by default. Override it with your own // Initialize is an empty function by default. Override it with your own
// initialization logic. // initialization logic.
initialize: function(){}, initialize: function(){},
@@ -562,12 +567,14 @@
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
var old = this._changing ? this._previousAttributes : this.attributes; var old = this._changing ? this._previousAttributes : this.attributes;
var changed = {}; var changed = {};
var hasChanged;
for (var attr in diff) { for (var attr in diff) {
var val = diff[attr]; var val = diff[attr];
if (_.isEqual(old[attr], val)) continue; if (_.isEqual(old[attr], val)) continue;
changed[attr] = val; changed[attr] = val;
hasChanged = true;
} }
return _.size(changed) ? changed : false; return hasChanged ? changed : false;
}, },
// Get the previous value of an attribute, recorded at the time the last // Get the previous value of an attribute, recorded at the time the last
@@ -754,6 +761,7 @@
// its models in sort order, as they're added and removed. // its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) { var Collection = Backbone.Collection = function(models, options) {
options || (options = {}); options || (options = {});
this.preinitialize.apply(this, arguments);
if (options.model) this.model = options.model; if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator; if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset(); this._reset();
@@ -783,6 +791,11 @@
// This should be overridden in most cases. // This should be overridden in most cases.
model: Model, model: Model,
// preinitialize is an empty function by default. You can override it with a function
// or object. preinitialize will run before any instantiation logic is run in the Collection.
preinitialize: function(){},
// Initialize is an empty function by default. Override it with your own // Initialize is an empty function by default. Override it with your own
// initialization logic. // initialization logic.
initialize: function(){}, initialize: function(){},
@@ -1219,6 +1232,7 @@
// if an existing element is not provided... // if an existing element is not provided...
var View = Backbone.View = function(options) { var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view'); this.cid = _.uniqueId('view');
this.preinitialize.apply(this, arguments);
_.extend(this, _.pick(options, viewOptions)); _.extend(this, _.pick(options, viewOptions));
this._ensureElement(); this._ensureElement();
this.initialize.apply(this, arguments); this.initialize.apply(this, arguments);
@@ -1242,6 +1256,10 @@
return this.$el.find(selector); return this.$el.find(selector);
}, },
// preinitialize is an empty function by default. You can override it with a function
// or object. preinitialize will run before any instantiation logic is run in the View
preinitialize: function(){},
// Initialize is an empty function by default. Override it with your own // Initialize is an empty function by default. Override it with your own
// initialization logic. // initialization logic.
initialize: function(){}, initialize: function(){},
@@ -1467,6 +1485,7 @@
// matched. Creating a new one sets its `routes` hash, if not set statically. // matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = Backbone.Router = function(options) { var Router = Backbone.Router = function(options) {
options || (options = {}); options || (options = {});
this.preinitialize.apply(this, arguments);
if (options.routes) this.routes = options.routes; if (options.routes) this.routes = options.routes;
this._bindRoutes(); this._bindRoutes();
this.initialize.apply(this, arguments); this.initialize.apply(this, arguments);
@@ -1482,6 +1501,10 @@
// Set up all inheritable **Backbone.Router** properties and methods. // Set up all inheritable **Backbone.Router** properties and methods.
_.extend(Router.prototype, Events, { _.extend(Router.prototype, Events, {
// preinitialize is an empty function by default. You can override it with a function
// or object. preinitialize will run before any instantiation logic is run in the Router.
preinitialize: function(){},
// Initialize is an empty function by default. Override it with your own // Initialize is an empty function by default. Override it with your own
// initialization logic. // initialization logic.
initialize: function(){}, initialize: function(){},
@@ -1812,11 +1835,14 @@
} }
var url = rootPath + fragment; var url = rootPath + fragment;
// Strip the hash and decode for matching. // Strip the fragment of the query and hash for matching.
fragment = this.decodeFragment(fragment.replace(pathStripper, '')); fragment = fragment.replace(pathStripper, '');
if (this.fragment === fragment) return; // Decode for matching.
this.fragment = fragment; var decodedFragment = this.decodeFragment(fragment);
if (this.fragment === decodedFragment) return;
this.fragment = decodedFragment;
// If pushState is available, we use it to set the fragment as a real URL. // If pushState is available, we use it to set the fragment as a real URL.
if (this._usePushState) { if (this._usePushState) {

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
var a, b, c, d, e, col, otherCol; var a, b, c, d, e, col, otherCol;
@@ -593,7 +593,7 @@
assert.equal(error, 'fail'); assert.equal(error, 'fail');
assert.equal(options.validationError, 'fail'); assert.equal(options.validationError, 'fail');
}); });
assert.equal(collection.create({'foo': 'bar'}, {validate: true}), false); assert.equal(collection.create({foo: 'bar'}, {validate: true}), false);
}); });
QUnit.test('create will pass extra options to success callback', function(assert) { QUnit.test('create will pass extra options to success callback', function(assert) {
@@ -661,6 +661,31 @@
assert.equal(coll.one, 1); assert.equal(coll.one, 1);
}); });
QUnit.test('preinitialize', function(assert) {
assert.expect(1);
var Collection = Backbone.Collection.extend({
preinitialize: function() {
this.one = 1;
}
});
var coll = new Collection;
assert.equal(coll.one, 1);
});
QUnit.test('preinitialize occurs before the collection is set up', function(assert) {
assert.expect(2);
var Collection = Backbone.Collection.extend({
preinitialize: function() {
assert.notEqual(this.model, FooModel);
}
});
var FooModel = Backbone.Model.extend({id: 'foo'});
var coll = new Collection({}, {
model: FooModel
});
assert.equal(coll.model, FooModel);
});
QUnit.test('toJSON', function(assert) { QUnit.test('toJSON', function(assert) {
assert.expect(1); assert.expect(1);
assert.equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]'); assert.equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
@@ -1724,10 +1749,10 @@
return new M(attrs); return new M(attrs);
} }
}); });
var c2 = new C2({'_id': 1}); var c2 = new C2({_id: 1});
assert.equal(c2.get(1), void 0); assert.equal(c2.get(1), void 0);
assert.equal(c2.modelId(c2.at(0).attributes), void 0); assert.equal(c2.modelId(c2.at(0).attributes), void 0);
var m = new M({'_id': 2}); var m = new M({_id: 2});
c2.add(m); c2.add(m);
assert.equal(c2.get(2), void 0); assert.equal(c2.get(2), void 0);
assert.equal(c2.modelId(m.attributes), void 0); assert.equal(c2.modelId(m.attributes), void 0);
@@ -1995,4 +2020,4 @@
assert.equal(fired, false); assert.equal(fired, false);
}); });
})(); })(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
QUnit.module('Backbone.Events'); QUnit.module('Backbone.Events');
@@ -703,4 +703,4 @@
two.trigger('y', 2); two.trigger('y', 2);
}); });
})(); })(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
var ProxyModel = Backbone.Model.extend(); var ProxyModel = Backbone.Model.extend();
var Klass = Backbone.Collection.extend({ var Klass = Backbone.Collection.extend({
@@ -63,6 +63,36 @@
assert.equal(model.get('value'), 2); assert.equal(model.get('value'), 2);
}); });
QUnit.test('preinitialize', function(assert) {
assert.expect(2);
var Model = Backbone.Model.extend({
preinitialize: function() {
this.one = 1;
}
});
var model = new Model({}, {collection: collection});
assert.equal(model.one, 1);
assert.equal(model.collection, collection);
});
QUnit.test('preinitialize occurs before the model is set up', function(assert) {
assert.expect(6);
var Model = Backbone.Model.extend({
preinitialize: function() {
assert.equal(this.collection, undefined);
assert.equal(this.cid, undefined);
assert.equal(this.id, undefined);
}
});
var model = new Model({id: 'foo'}, {collection: collection});
assert.equal(model.collection, collection);
assert.equal(model.id, 'foo');
assert.notEqual(model.cid, undefined);
});
QUnit.test('parse can return null', function(assert) { QUnit.test('parse can return null', function(assert) {
assert.expect(1); assert.expect(1);
var Model = Backbone.Model.extend({ var Model = Backbone.Model.extend({
@@ -1415,4 +1445,4 @@
assert.equal(model.id, 3); assert.equal(model.id, 3);
}); });
})(); })(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
QUnit.module('Backbone.noConflict'); QUnit.module('Backbone.noConflict');
@@ -10,4 +10,4 @@
assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone'); assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
}); });
})(); })(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
var router = null; var router = null;
var location = null; var location = null;
@@ -28,7 +28,8 @@
'fragment', 'fragment',
'pathname', 'pathname',
'protocol' 'protocol'
)); ));
// In IE, anchor.pathname does not contain a leading slash though // In IE, anchor.pathname does not contain a leading slash though
// window.location.pathname does. // window.location.pathname does.
if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname; if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname;
@@ -42,7 +43,7 @@
QUnit.module('Backbone.Router', { QUnit.module('Backbone.Router', {
setup: function() { beforeEach: function() {
location = new Location('http://example.com'); location = new Location('http://example.com');
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
router = new Router({testing: 101}); router = new Router({testing: 101});
@@ -53,7 +54,7 @@
Backbone.history.on('route', onRoute); Backbone.history.on('route', onRoute);
}, },
teardown: function() { afterEach: function() {
Backbone.history.stop(); Backbone.history.stop();
Backbone.history.off('route', onRoute); Backbone.history.off('route', onRoute);
} }
@@ -95,6 +96,10 @@
'*anything': 'anything' '*anything': 'anything'
}, },
preinitialize: function(options) {
this.testpreinit = 'foo';
},
initialize: function(options) { initialize: function(options) {
this.testing = options.testing; this.testing = options.testing;
this.route('implicit', 'implicit'); this.route('implicit', 'implicit');
@@ -121,19 +126,19 @@
this.charType = 'escaped'; this.charType = 'escaped';
}, },
contacts: function(){ contacts: function() {
this.contact = 'index'; this.contact = 'index';
}, },
newContact: function(){ newContact: function() {
this.contact = 'new'; this.contact = 'new';
}, },
loadContact: function(){ loadContact: function() {
this.contact = 'load'; this.contact = 'load';
}, },
optionalItem: function(arg){ optionalItem: function(arg) {
this.arg = arg !== void 0 ? arg : null; this.arg = arg !== void 0 ? arg : null;
}, },
@@ -181,6 +186,11 @@
assert.equal(router.testing, 101); assert.equal(router.testing, 101);
}); });
QUnit.test('preinitialize', function(assert) {
assert.expect(1);
assert.equal(router.testpreinit, 'foo');
});
QUnit.test('routes (simple)', function(assert) { QUnit.test('routes (simple)', function(assert) {
assert.expect(4); assert.expect(4);
location.replace('http://example.com#search/news'); location.replace('http://example.com#search/news');
@@ -234,10 +244,11 @@
assert.ok(Backbone.history.navigate('search/manhattan/p20', true)); assert.ok(Backbone.history.navigate('search/manhattan/p20', true));
}); });
QUnit.test('route precedence via navigate', function(assert){ QUnit.test('route precedence via navigate', function(assert) {
assert.expect(6); assert.expect(6);
// check both 0.9.x and backwards-compatibility options
_.each([{trigger: true}, true], function( options ){ // Check both 0.9.x and backwards-compatibility options
_.each([{trigger: true}, true], function(options) {
Backbone.history.navigate('contacts', options); Backbone.history.navigate('contacts', options);
assert.equal(router.contact, 'index'); assert.equal(router.contact, 'index');
Backbone.history.navigate('contacts/new', options); Backbone.history.navigate('contacts/new', options);
@@ -249,7 +260,7 @@
QUnit.test('loadUrl is not called for identical routes.', function(assert) { QUnit.test('loadUrl is not called for identical routes.', function(assert) {
assert.expect(0); assert.expect(0);
Backbone.history.loadUrl = function(){ assert.ok(false); }; Backbone.history.loadUrl = function() { assert.ok(false); };
location.replace('http://example.com#route'); location.replace('http://example.com#route');
Backbone.history.navigate('route'); Backbone.history.navigate('route');
Backbone.history.navigate('/route'); Backbone.history.navigate('/route');
@@ -345,9 +356,9 @@
assert.strictEqual(router.path, 'c/d/e'); assert.strictEqual(router.path, 'c/d/e');
}); });
QUnit.test("fires event when router doesn't have callback on it", function(assert) { QUnit.test('fires event when router doesn\'t have callback on it', function(assert) {
assert.expect(1); assert.expect(1);
router.on('route:noCallback', function(){ assert.ok(true); }); router.on('route:noCallback', function() { assert.ok(true); });
location.replace('http://example.com#noCallback'); location.replace('http://example.com#noCallback');
Backbone.history.checkUrl(); Backbone.history.checkUrl();
}); });
@@ -536,8 +547,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(){} replaceState: function() {}
} }
}); });
Backbone.history.start({root: 'root'}); Backbone.history.start({root: 'root'});
@@ -551,8 +562,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(state, title, url){ replaceState: function(state, title, url) {
assert.strictEqual(url, '/root/x/y'); assert.strictEqual(url, '/root/x/y');
} }
} }
@@ -570,8 +581,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(){} replaceState: function() {}
} }
}); });
Backbone.history.start({root: ''}); Backbone.history.start({root: ''});
@@ -625,8 +636,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(state, title, url){ replaceState: function(state, title, url) {
assert.strictEqual(url, '/root/x/y?a=b'); assert.strictEqual(url, '/root/x/y?a=b');
} }
} }
@@ -641,8 +652,8 @@
assert.expect(1); assert.expect(1);
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: {'': 'empty'}, routes: {'': 'empty'},
empty: function(){}, empty: function() {},
route: function(route){ route: function(route) {
assert.strictEqual(route, ''); assert.strictEqual(route, '');
} }
}); });
@@ -655,7 +666,8 @@
assert.strictEqual(history.getFragment('fragment '), 'fragment'); assert.strictEqual(history.getFragment('fragment '), 'fragment');
}); });
QUnit.test('#1820 - Leading slash and trailing space.', 1, function(assert) { QUnit.test('#1820 - Leading slash and trailing space.', function(assert) {
assert.expect(1);
var history = new Backbone.History; var history = new Backbone.History;
assert.strictEqual(history.getFragment('/fragment '), 'fragment'); assert.strictEqual(history.getFragment('/fragment '), 'fragment');
}); });
@@ -670,7 +682,7 @@
assert.strictEqual(router.z, '123'); assert.strictEqual(router.z, '123');
}); });
QUnit.test("#2062 - Trigger 'route' event on router instance.", function(assert) { QUnit.test('#2062 - Trigger "route" event on router instance.', function(assert) {
assert.expect(2); assert.expect(2);
router.on('route', function(name, args) { router.on('route', function(name, args) {
assert.strictEqual(name, 'routeEvent'); assert.strictEqual(name, 'routeEvent');
@@ -709,8 +721,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(){ assert.ok(false); } replaceState: function() { assert.ok(false); }
} }
}); });
Backbone.history.start({ Backbone.history.start({
@@ -726,8 +738,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){}, pushState: function() {},
replaceState: function(){} replaceState: function() {}
} }
}); });
@@ -753,7 +765,7 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(state, title, url){ pushState: function(state, title, url) {
assert.strictEqual(url, '/root'); assert.strictEqual(url, '/root');
} }
} }
@@ -785,7 +797,7 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(state, title, url){ pushState: function(state, title, url) {
assert.strictEqual(url, '/root?x=1'); assert.strictEqual(url, '/root?x=1');
} }
} }
@@ -823,7 +835,7 @@
assert.expect(1); assert.expect(1);
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: { routes: {
path: function(params){ path: function(params) {
assert.strictEqual(params, 'x=y%3Fz'); assert.strictEqual(params, 'x=y%3Fz');
} }
} }
@@ -921,7 +933,7 @@
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: {'foo/:id/bar': 'foo'}, routes: {'foo/:id/bar': 'foo'},
foo: function(){}, foo: function() {},
execute: function(callback, args, name) { execute: function(callback, args, name) {
assert.strictEqual(callback, this.foo); assert.strictEqual(callback, this.foo);
assert.deepEqual(args, ['123', 'x=y']); assert.deepEqual(args, ['123', 'x=y']);
@@ -953,8 +965,8 @@
Backbone.history = _.extend(new Backbone.History, { Backbone.history = _.extend(new Backbone.History, {
location: location, location: location,
history: { history: {
pushState: function(){ assert.ok(false); }, pushState: function() { assert.ok(false); },
replaceState: function(){ assert.ok(false); } replaceState: function() { assert.ok(false); }
} }
}); });
Backbone.history.start({pushState: true}); Backbone.history.start({pushState: true});
@@ -991,14 +1003,14 @@
Backbone.history.start({root: '/root', pushState: true}); Backbone.history.start({root: '/root', pushState: true});
}); });
QUnit.test("Paths that don't match the root should not match no root", function(assert) { QUnit.test('Paths that don\'t match the root should not match no root', function(assert) {
assert.expect(0); assert.expect(0);
location.replace('http://example.com/foo'); location.replace('http://example.com/foo');
Backbone.history.stop(); Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: { routes: {
foo: function(){ foo: function() {
assert.ok(false, 'should not match unless root matches'); assert.ok(false, 'should not match unless root matches');
} }
} }
@@ -1007,14 +1019,14 @@
Backbone.history.start({root: 'root', pushState: true}); Backbone.history.start({root: 'root', pushState: true});
}); });
QUnit.test("Paths that don't match the root should not match roots of the same length", function(assert) { QUnit.test('Paths that don\'t match the root should not match roots of the same length', function(assert) {
assert.expect(0); assert.expect(0);
location.replace('http://example.com/xxxx/foo'); location.replace('http://example.com/xxxx/foo');
Backbone.history.stop(); Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: { routes: {
foo: function(){ foo: function() {
assert.ok(false, 'should not match unless root matches'); assert.ok(false, 'should not match unless root matches');
} }
} }
@@ -1029,7 +1041,7 @@
Backbone.history.stop(); Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: {foo: function(){ assert.ok(true); }} routes: {foo: function() { assert.ok(true); }}
}); });
var myRouter = new MyRouter; var myRouter = new MyRouter;
Backbone.history.start({root: 'x+y.z', pushState: true}); Backbone.history.start({root: 'x+y.z', pushState: true});
@@ -1041,7 +1053,7 @@
Backbone.history.stop(); Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: {foo: function(){ assert.ok(true); }} routes: {foo: function() { assert.ok(true); }}
}); });
var myRouter = new MyRouter; var myRouter = new MyRouter;
Backbone.history.start({root: '®ooτ', pushState: true}); Backbone.history.start({root: '®ooτ', pushState: true});
@@ -1053,10 +1065,17 @@
Backbone.history.stop(); Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location}); Backbone.history = _.extend(new Backbone.History, {location: location});
var MyRouter = Backbone.Router.extend({ var MyRouter = Backbone.Router.extend({
routes: {'': function(){ assert.ok(true); }} routes: {'': function() { assert.ok(true); }}
}); });
var myRouter = new MyRouter; var myRouter = new MyRouter;
Backbone.history.start({root: '®ooτ', pushState: true}); Backbone.history.start({root: '®ooτ', pushState: true});
}); });
})(); QUnit.test('#4025 - navigate updates URL hash as is', function(assert) {
assert.expect(1);
var route = 'search/has%20space';
Backbone.history.navigate(route);
assert.strictEqual(location.hash, '#' + route);
});
})(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
var sync = Backbone.sync; var sync = Backbone.sync;
var ajax = Backbone.ajax; var ajax = Backbone.ajax;
@@ -14,7 +14,7 @@
var env = QUnit.config.current.testEnvironment; var env = QUnit.config.current.testEnvironment;
// We never want to actually call these during tests. // We never want to actually call these during tests.
history.pushState = history.replaceState = function(){}; history.pushState = history.replaceState = function() {};
// Capture ajax settings for comparison. // Capture ajax settings for comparison.
Backbone.ajax = function(settings) { Backbone.ajax = function(settings) {
@@ -42,4 +42,4 @@
history.replaceState = replaceState; history.replaceState = replaceState;
}); });
})(); })(QUnit);

View File

@@ -1,4 +1,4 @@
(function() { (function(QUnit) {
var Library = Backbone.Collection.extend({ var Library = Backbone.Collection.extend({
url: function() { return '/library'; } url: function() { return '/library'; }
@@ -158,7 +158,7 @@
QUnit.test('Backbone.ajax', function(assert) { QUnit.test('Backbone.ajax', function(assert) {
assert.expect(1); assert.expect(1);
Backbone.ajax = function(settings){ Backbone.ajax = function(settings) {
assert.strictEqual(settings.url, '/test'); assert.strictEqual(settings.url, '/test');
}; };
var model = new Backbone.Model(); var model = new Backbone.Model();
@@ -236,4 +236,4 @@
this.ajaxSettings.error({}, 'textStatus', 'errorThrown'); this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
}); });
})(); })(QUnit);

View File

@@ -1,13 +1,13 @@
(function() { (function(QUnit) {
var view; var view;
QUnit.module('Backbone.View', { QUnit.module('Backbone.View', {
beforeEach: function(assert) { beforeEach: function() {
$('#qunit-fixture').append( $('#qunit-fixture').append(
'<div id="testElement"><h1>Test</h1></div>' '<div id="testElement"><h1>Test</h1></div>'
); );
view = new Backbone.View({ view = new Backbone.View({
id: 'test-view', id: 'test-view',
@@ -61,6 +61,28 @@
assert.strictEqual(new View().one, 1); assert.strictEqual(new View().one, 1);
}); });
QUnit.test('preinitialize', function(assert) {
assert.expect(1);
var View = Backbone.View.extend({
preinitialize: function() {
this.one = 1;
}
});
assert.strictEqual(new View().one, 1);
});
QUnit.test('preinitialize occurs before the view is set up', function(assert) {
assert.expect(2);
var View = Backbone.View.extend({
preinitialize: function() {
assert.equal(this.el, undefined);
}
});
var _view = new View({});
assert.notEqual(_view.el, undefined);
});
QUnit.test('render', function(assert) { QUnit.test('render', function(assert) {
assert.expect(1); assert.expect(1);
var myView = new Backbone.View; var myView = new Backbone.View;
@@ -72,8 +94,8 @@
var counter1 = 0, counter2 = 0; var counter1 = 0, counter2 = 0;
var myView = new Backbone.View({el: '#testElement'}); var myView = new Backbone.View({el: '#testElement'});
myView.increment = function(){ counter1++; }; myView.increment = function() { counter1++; };
myView.$el.on('click', function(){ counter2++; }); myView.$el.on('click', function() { counter2++; });
var events = {'click h1': 'increment'}; var events = {'click h1': 'increment'};
@@ -129,11 +151,10 @@
assert.equal(myView.counter, 3); assert.equal(myView.counter, 3);
}); });
QUnit.test('delegateEvents ignore undefined methods', function(assert) { QUnit.test('delegateEvents ignore undefined methods', function(assert) {
assert.expect(0); assert.expect(0);
var myView = new Backbone.View({el: '<p></p>'}); var myView = new Backbone.View({el: '<p></p>'});
myView.delegateEvents({'click': 'undefinedMethod'}); myView.delegateEvents({click: 'undefinedMethod'});
myView.$el.trigger('click'); myView.$el.trigger('click');
}); });
@@ -142,8 +163,8 @@
var counter1 = 0, counter2 = 0; var counter1 = 0, counter2 = 0;
var myView = new Backbone.View({el: '#testElement'}); var myView = new Backbone.View({el: '#testElement'});
myView.increment = function(){ counter1++; }; myView.increment = function() { counter1++; };
myView.$el.on('click', function(){ counter2++; }); myView.$el.on('click', function() { counter2++; });
var events = {'click h1': 'increment'}; var events = {'click h1': 'increment'};
@@ -203,7 +224,7 @@
assert.expect(2); assert.expect(2);
var myView = new Backbone.View({el: '#testElement'}); var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(true); }); myView.delegate('click', function() { assert.ok(true); });
var handler = function(){ assert.ok(false); }; var handler = function() { assert.ok(false); };
myView.delegate('click', 'h1', handler); myView.delegate('click', 'h1', handler);
myView.undelegate('click', 'h1', handler); myView.undelegate('click', 'h1', handler);
myView.$('h1').trigger('click'); myView.$('h1').trigger('click');
@@ -405,8 +426,8 @@
assert.expect(0); assert.expect(0);
var View = Backbone.View.extend({ var View = Backbone.View.extend({
initialize: function() { initialize: function() {
this.listenTo(this.model, 'all x', function(){ assert.ok(false); }); this.listenTo(this.model, 'all x', function() { assert.ok(false); });
this.listenTo(this.collection, 'all x', function(){ assert.ok(false); }); this.listenTo(this.collection, 'all x', function() { assert.ok(false); });
} }
}); });
@@ -492,4 +513,4 @@
assert.notEqual($oldEl, myView.$el); assert.notEqual($oldEl, myView.$el);
}); });
})(); })(QUnit);

View File

@@ -15,6 +15,10 @@
result = _.map([[1, 2, 3], [1, 2, 3]], _.first); result = _.map([[1, 2, 3], [1, 2, 3]], _.first);
assert.deepEqual(result, [1, 1], 'works well with _.map'); assert.deepEqual(result, [1, 1], 'works well with _.map');
assert.equal(_.first(null), void 0, 'returns undefined when called on null'); assert.equal(_.first(null), void 0, 'returns undefined when called on null');
Array.prototype[0] = 'boo';
assert.equal(_.first([]), void 0, 'return undefined when called on a empty array');
delete Array.prototype[0];
}); });
QUnit.test('head', function(assert) { QUnit.test('head', function(assert) {
@@ -66,6 +70,10 @@
result = _.map([[1, 2, 3], [1, 2, 3]], _.last); result = _.map([[1, 2, 3], [1, 2, 3]], _.last);
assert.deepEqual(result, [3, 3], 'works well with _.map'); assert.deepEqual(result, [3, 3], 'works well with _.map');
assert.equal(_.last(null), void 0, 'returns undefined when called on null'); assert.equal(_.last(null), void 0, 'returns undefined when called on null');
var arr = [];
arr[-1] = 'boo';
assert.equal(_.last(arr), void 0, 'return undefined when called on a empty array');
}); });
QUnit.test('compact', function(assert) { QUnit.test('compact', function(assert) {

View File

@@ -188,7 +188,7 @@
var prod = _.reduce([1, 2, 3, 4], function(memo, num){ return memo * num; }); var prod = _.reduce([1, 2, 3, 4], function(memo, num){ return memo * num; });
assert.equal(prod, 24, 'can reduce via multiplication'); assert.equal(prod, 24, 'can reduce via multiplication');
assert.ok(_.reduce(null, _.noop, 138) === 138, 'handles a null (with initial value) properly'); assert.strictEqual(_.reduce(null, _.noop, 138), 138, 'handles a null (with initial value) properly');
assert.equal(_.reduce([], _.noop, void 0), void 0, 'undefined can be passed as a special case'); assert.equal(_.reduce([], _.noop, void 0), void 0, 'undefined can be passed as a special case');
assert.equal(_.reduce([_], _.noop), _, 'collection of length one with no initial value returns the first item'); assert.equal(_.reduce([_], _.noop), _, 'collection of length one with no initial value returns the first item');
assert.equal(_.reduce([], _.noop), void 0, 'returns undefined when collection is empty and no initial value'); assert.equal(_.reduce([], _.noop), void 0, 'returns undefined when collection is empty and no initial value');
@@ -212,7 +212,7 @@
var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(memo, num){ return memo + num; }); var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(memo, num){ return memo + num; });
assert.equal(sum, 6, 'default initial value on object'); assert.equal(sum, 6, 'default initial value on object');
assert.ok(_.reduceRight(null, _.noop, 138) === 138, 'handles a null (with initial value) properly'); assert.strictEqual(_.reduceRight(null, _.noop, 138), 138, 'handles a null (with initial value) properly');
assert.equal(_.reduceRight([_], _.noop), _, 'collection of length one with no initial value returns the first item'); assert.equal(_.reduceRight([_], _.noop), _, 'collection of length one with no initial value returns the first item');
assert.equal(_.reduceRight([], _.noop, void 0), void 0, 'undefined can be passed as a special case'); assert.equal(_.reduceRight([], _.noop, void 0), void 0, 'undefined can be passed as a special case');
@@ -268,8 +268,8 @@
var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}, {a: 2, b: 4}]; var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}, {a: 2, b: 4}];
assert.deepEqual(_.find(list, {a: 1}), {a: 1, b: 2}, 'can be used as findWhere'); assert.deepEqual(_.find(list, {a: 1}), {a: 1, b: 2}, 'can be used as findWhere');
assert.deepEqual(_.find(list, {b: 4}), {a: 1, b: 4}); assert.deepEqual(_.find(list, {b: 4}), {a: 1, b: 4});
assert.ok(!_.find(list, {c: 1}), 'undefined when not found'); assert.notOk(_.find(list, {c: 1}), 'undefined when not found');
assert.ok(!_.find([], {c: 1}), 'undefined when searching empty list'); assert.notOk(_.find([], {c: 1}), 'undefined when searching empty list');
var result = _.find([1, 2, 3], function(num){ return num * 2 === 4; }); var result = _.find([1, 2, 3], function(num){ return num * 2 === 4; });
assert.equal(result, 2, 'found the first "2" and broke the loop'); assert.equal(result, 2, 'found the first "2" and broke the loop');
@@ -348,25 +348,25 @@
QUnit.test('every', function(assert) { QUnit.test('every', function(assert) {
assert.ok(_.every([], _.identity), 'the empty set'); assert.ok(_.every([], _.identity), 'the empty set');
assert.ok(_.every([true, true, true], _.identity), 'every true values'); assert.ok(_.every([true, true, true], _.identity), 'every true values');
assert.ok(!_.every([true, false, true], _.identity), 'one false value'); assert.notOk(_.every([true, false, true], _.identity), 'one false value');
assert.ok(_.every([0, 10, 28], function(num){ return num % 2 === 0; }), 'even numbers'); assert.ok(_.every([0, 10, 28], function(num){ return num % 2 === 0; }), 'even numbers');
assert.ok(!_.every([0, 11, 28], function(num){ return num % 2 === 0; }), 'an odd number'); assert.notOk(_.every([0, 11, 28], function(num){ return num % 2 === 0; }), 'an odd number');
assert.ok(_.every([1], _.identity) === true, 'cast to boolean - true'); assert.strictEqual(_.every([1], _.identity), true, 'cast to boolean - true');
assert.ok(_.every([0], _.identity) === false, 'cast to boolean - false'); assert.strictEqual(_.every([0], _.identity), false, 'cast to boolean - false');
assert.ok(!_.every([void 0, void 0, void 0], _.identity), 'works with arrays of undefined'); assert.notOk(_.every([void 0, void 0, void 0], _.identity), 'works with arrays of undefined');
var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]; var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
assert.ok(!_.every(list, {a: 1, b: 2}), 'Can be called with object'); assert.notOk(_.every(list, {a: 1, b: 2}), 'Can be called with object');
assert.ok(_.every(list, 'a'), 'String mapped to object property'); assert.ok(_.every(list, 'a'), 'String mapped to object property');
list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}]; list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}];
assert.ok(_.every(list, {b: 2}), 'Can be called with object'); assert.ok(_.every(list, {b: 2}), 'Can be called with object');
assert.ok(!_.every(list, 'c'), 'String mapped to object property'); assert.notOk(_.every(list, 'c'), 'String mapped to object property');
assert.ok(_.every({a: 1, b: 2, c: 3, d: 4}, _.isNumber), 'takes objects'); assert.ok(_.every({a: 1, b: 2, c: 3, d: 4}, _.isNumber), 'takes objects');
assert.ok(!_.every({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects'); assert.notOk(_.every({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects');
assert.ok(_.every(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works'); assert.ok(_.every(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
assert.ok(!_.every(['a', 'b', 'c', 'd', 'f'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works'); assert.notOk(_.every(['a', 'b', 'c', 'd', 'f'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
}); });
QUnit.test('all', function(assert) { QUnit.test('all', function(assert) {
@@ -374,29 +374,29 @@
}); });
QUnit.test('some', function(assert) { QUnit.test('some', function(assert) {
assert.ok(!_.some([]), 'the empty set'); assert.notOk(_.some([]), 'the empty set');
assert.ok(!_.some([false, false, false]), 'all false values'); assert.notOk(_.some([false, false, false]), 'all false values');
assert.ok(_.some([false, false, true]), 'one true value'); assert.ok(_.some([false, false, true]), 'one true value');
assert.ok(_.some([null, 0, 'yes', false]), 'a string'); assert.ok(_.some([null, 0, 'yes', false]), 'a string');
assert.ok(!_.some([null, 0, '', false]), 'falsy values'); assert.notOk(_.some([null, 0, '', false]), 'falsy values');
assert.ok(!_.some([1, 11, 29], function(num){ return num % 2 === 0; }), 'all odd numbers'); assert.notOk(_.some([1, 11, 29], function(num){ return num % 2 === 0; }), 'all odd numbers');
assert.ok(_.some([1, 10, 29], function(num){ return num % 2 === 0; }), 'an even number'); assert.ok(_.some([1, 10, 29], function(num){ return num % 2 === 0; }), 'an even number');
assert.ok(_.some([1], _.identity) === true, 'cast to boolean - true'); assert.strictEqual(_.some([1], _.identity), true, 'cast to boolean - true');
assert.ok(_.some([0], _.identity) === false, 'cast to boolean - false'); assert.strictEqual(_.some([0], _.identity), false, 'cast to boolean - false');
assert.ok(_.some([false, false, true])); assert.ok(_.some([false, false, true]));
var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]; var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
assert.ok(!_.some(list, {a: 5, b: 2}), 'Can be called with object'); assert.notOk(_.some(list, {a: 5, b: 2}), 'Can be called with object');
assert.ok(_.some(list, 'a'), 'String mapped to object property'); assert.ok(_.some(list, 'a'), 'String mapped to object property');
list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}]; list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}];
assert.ok(_.some(list, {b: 2}), 'Can be called with object'); assert.ok(_.some(list, {b: 2}), 'Can be called with object');
assert.ok(!_.some(list, 'd'), 'String mapped to object property'); assert.notOk(_.some(list, 'd'), 'String mapped to object property');
assert.ok(_.some({a: '1', b: '2', c: '3', d: '4', e: 6}, _.isNumber), 'takes objects'); assert.ok(_.some({a: '1', b: '2', c: '3', d: '4', e: 6}, _.isNumber), 'takes objects');
assert.ok(!_.some({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects'); assert.notOk(_.some({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects');
assert.ok(_.some(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works'); assert.ok(_.some(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
assert.ok(!_.some(['x', 'y', 'z'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works'); assert.notOk(_.some(['x', 'y', 'z'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
}); });
QUnit.test('any', function(assert) { QUnit.test('any', function(assert) {
@@ -408,11 +408,11 @@
assert.strictEqual(_.includes(val, 'hasOwnProperty'), false); assert.strictEqual(_.includes(val, 'hasOwnProperty'), false);
}); });
assert.strictEqual(_.includes([1, 2, 3], 2), true, 'two is in the array'); assert.strictEqual(_.includes([1, 2, 3], 2), true, 'two is in the array');
assert.ok(!_.includes([1, 3, 9], 2), 'two is not in the array'); assert.notOk(_.includes([1, 3, 9], 2), 'two is not in the array');
assert.strictEqual(_.includes([5, 4, 3, 2, 1], 5, true), true, 'doesn\'t delegate to binary search'); assert.strictEqual(_.includes([5, 4, 3, 2, 1], 5, true), true, 'doesn\'t delegate to binary search');
assert.ok(_.includes({moe: 1, larry: 3, curly: 9}, 3) === true, '_.includes on objects checks their values'); assert.strictEqual(_.includes({moe: 1, larry: 3, curly: 9}, 3), true, '_.includes on objects checks their values');
assert.ok(_([1, 2, 3]).includes(2), 'OO-style includes'); assert.ok(_([1, 2, 3]).includes(2), 'OO-style includes');
var numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; var numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3];
@@ -549,7 +549,7 @@
assert.equal(-Infinity, _.max(void 0), 'can handle null/undefined'); assert.equal(-Infinity, _.max(void 0), 'can handle null/undefined');
assert.equal(-Infinity, _.max(null, _.identity), 'can handle null/undefined'); assert.equal(-Infinity, _.max(null, _.identity), 'can handle null/undefined');
assert.equal(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); assert.equal(_.max([1, 2, 3]), 3, 'can perform a regular Math.max');
var neg = _.max([1, 2, 3], function(num){ return -num; }); var neg = _.max([1, 2, 3], function(num){ return -num; });
assert.equal(neg, 1, 'can perform a computation-based max'); assert.equal(neg, 1, 'can perform a computation-based max');
@@ -558,24 +558,24 @@
assert.equal(-Infinity, _.max([]), 'Maximum value of an empty array'); assert.equal(-Infinity, _.max([]), 'Maximum value of an empty array');
assert.equal(_.max({a: 'a'}), -Infinity, 'Maximum value of a non-numeric collection'); assert.equal(_.max({a: 'a'}), -Infinity, 'Maximum value of a non-numeric collection');
assert.equal(299999, _.max(_.range(1, 300000)), 'Maximum value of a too-big array'); assert.equal(_.max(_.range(1, 300000)), 299999, 'Maximum value of a too-big array');
assert.equal(3, _.max([1, 2, 3, 'test']), 'Finds correct max in array starting with num and containing a NaN'); assert.equal(_.max([1, 2, 3, 'test']), 3, 'Finds correct max in array starting with num and containing a NaN');
assert.equal(3, _.max(['test', 1, 2, 3]), 'Finds correct max in array starting with NaN'); assert.equal(_.max(['test', 1, 2, 3]), 3, 'Finds correct max in array starting with NaN');
assert.equal(3, _.max([1, 2, 3, null]), 'Finds correct max in array starting with num and containing a `null`'); assert.equal(_.max([1, 2, 3, null]), 3, 'Finds correct max in array starting with num and containing a `null`');
assert.equal(3, _.max([null, 1, 2, 3]), 'Finds correct max in array starting with a `null`'); assert.equal(_.max([null, 1, 2, 3]), 3, 'Finds correct max in array starting with a `null`');
assert.equal(3, _.max([1, 2, 3, '']), 'Finds correct max in array starting with num and containing an empty string'); assert.equal(_.max([1, 2, 3, '']), 3, 'Finds correct max in array starting with num and containing an empty string');
assert.equal(3, _.max(['', 1, 2, 3]), 'Finds correct max in array starting with an empty string'); assert.equal(_.max(['', 1, 2, 3]), 3, 'Finds correct max in array starting with an empty string');
assert.equal(3, _.max([1, 2, 3, false]), 'Finds correct max in array starting with num and containing a false'); assert.equal(_.max([1, 2, 3, false]), 3, 'Finds correct max in array starting with num and containing a false');
assert.equal(3, _.max([false, 1, 2, 3]), 'Finds correct max in array starting with a false'); assert.equal(_.max([false, 1, 2, 3]), 3, 'Finds correct max in array starting with a false');
assert.equal(4, _.max([0, 1, 2, 3, 4]), 'Finds correct max in array containing a zero'); assert.equal(_.max([0, 1, 2, 3, 4]), 4, 'Finds correct max in array containing a zero');
assert.equal(0, _.max([-3, -2, -1, 0]), 'Finds correct max in array containing negative numbers'); assert.equal(_.max([-3, -2, -1, 0]), 0, 'Finds correct max in array containing negative numbers');
assert.deepEqual([3, 6], _.map([[1, 2, 3], [4, 5, 6]], _.max), 'Finds correct max in array when mapping through multiple arrays'); assert.deepEqual(_.map([[1, 2, 3], [4, 5, 6]], _.max), [3, 6], 'Finds correct max in array when mapping through multiple arrays');
var a = {x: -Infinity}; var a = {x: -Infinity};
var b = {x: -Infinity}; var b = {x: -Infinity};
@@ -590,35 +590,35 @@
}); });
QUnit.test('min', function(assert) { QUnit.test('min', function(assert) {
assert.equal(Infinity, _.min(null), 'can handle null/undefined'); assert.equal(_.min(null), Infinity, 'can handle null/undefined');
assert.equal(Infinity, _.min(void 0), 'can handle null/undefined'); assert.equal(_.min(void 0), Infinity, 'can handle null/undefined');
assert.equal(Infinity, _.min(null, _.identity), 'can handle null/undefined'); assert.equal(_.min(null, _.identity), Infinity, 'can handle null/undefined');
assert.equal(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); assert.equal(_.min([1, 2, 3]), 1, 'can perform a regular Math.min');
var neg = _.min([1, 2, 3], function(num){ return -num; }); var neg = _.min([1, 2, 3], function(num){ return -num; });
assert.equal(neg, 3, 'can perform a computation-based min'); assert.equal(neg, 3, 'can perform a computation-based min');
assert.equal(Infinity, _.min({}), 'Minimum value of an empty object'); assert.equal(_.min({}), Infinity, 'Minimum value of an empty object');
assert.equal(Infinity, _.min([]), 'Minimum value of an empty array'); assert.equal(_.min([]), Infinity, 'Minimum value of an empty array');
assert.equal(_.min({a: 'a'}), Infinity, 'Minimum value of a non-numeric collection'); assert.equal(_.min({a: 'a'}), Infinity, 'Minimum value of a non-numeric collection');
assert.deepEqual([1, 4], _.map([[1, 2, 3], [4, 5, 6]], _.min), 'Finds correct min in array when mapping through multiple arrays'); assert.deepEqual(_.map([[1, 2, 3], [4, 5, 6]], _.min), [1, 4], 'Finds correct min in array when mapping through multiple arrays');
var now = new Date(9999999999); var now = new Date(9999999999);
var then = new Date(0); var then = new Date(0);
assert.equal(_.min([now, then]), then); assert.equal(_.min([now, then]), then);
assert.equal(1, _.min(_.range(1, 300000)), 'Minimum value of a too-big array'); assert.equal(_.min(_.range(1, 300000)), 1, 'Minimum value of a too-big array');
assert.equal(1, _.min([1, 2, 3, 'test']), 'Finds correct min in array starting with num and containing a NaN'); assert.equal(_.min([1, 2, 3, 'test']), 1, 'Finds correct min in array starting with num and containing a NaN');
assert.equal(1, _.min(['test', 1, 2, 3]), 'Finds correct min in array starting with NaN'); assert.equal(_.min(['test', 1, 2, 3]), 1, 'Finds correct min in array starting with NaN');
assert.equal(1, _.min([1, 2, 3, null]), 'Finds correct min in array starting with num and containing a `null`'); assert.equal(_.min([1, 2, 3, null]), 1, 'Finds correct min in array starting with num and containing a `null`');
assert.equal(1, _.min([null, 1, 2, 3]), 'Finds correct min in array starting with a `null`'); assert.equal(_.min([null, 1, 2, 3]), 1, 'Finds correct min in array starting with a `null`');
assert.equal(0, _.min([0, 1, 2, 3, 4]), 'Finds correct min in array containing a zero'); assert.equal(_.min([0, 1, 2, 3, 4]), 0, 'Finds correct min in array containing a zero');
assert.equal(-3, _.min([-3, -2, -1, 0]), 'Finds correct min in array containing negative numbers'); assert.equal(_.min([-3, -2, -1, 0]), -3, 'Finds correct min in array containing negative numbers');
var a = {x: Infinity}; var a = {x: Infinity};
var b = {x: Infinity}; var b = {x: Infinity};
@@ -692,7 +692,7 @@
assert.deepEqual(grouped['5'], ['three', 'seven', 'eight']); assert.deepEqual(grouped['5'], ['three', 'seven', 'eight']);
var context = {}; var context = {};
_.groupBy([{}], function(){ assert.ok(this === context); }, context); _.groupBy([{}], function(){ assert.strictEqual(this, context); }, context);
grouped = _.groupBy([4.2, 6.1, 6.4], function(num) { grouped = _.groupBy([4.2, 6.1, 6.4], function(num) {
return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
@@ -701,7 +701,7 @@
assert.equal(grouped.hasOwnProperty.length, 2); assert.equal(grouped.hasOwnProperty.length, 2);
var array = [{}]; var array = [{}];
_.groupBy(array, function(value, index, obj){ assert.ok(obj === array); }); _.groupBy(array, function(value, index, obj){ assert.strictEqual(obj, array); });
array = [1, 2, 1, 2, 3]; array = [1, 2, 1, 2, 3];
grouped = _.groupBy(array); grouped = _.groupBy(array);
@@ -747,7 +747,7 @@
assert.equal(grouped['5'], 3); assert.equal(grouped['5'], 3);
var context = {}; var context = {};
_.countBy([{}], function(){ assert.ok(this === context); }, context); _.countBy([{}], function(){ assert.strictEqual(this, context); }, context);
grouped = _.countBy([4.2, 6.1, 6.4], function(num) { grouped = _.countBy([4.2, 6.1, 6.4], function(num) {
return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
@@ -756,7 +756,7 @@
assert.equal(grouped.hasOwnProperty, 2); assert.equal(grouped.hasOwnProperty, 2);
var array = [{}]; var array = [{}];
_.countBy(array, function(value, index, obj){ assert.ok(obj === array); }); _.countBy(array, function(value, index, obj){ assert.strictEqual(obj, array); });
array = [1, 2, 1, 2, 3]; array = [1, 2, 1, 2, 3];
grouped = _.countBy(array); grouped = _.countBy(array);
@@ -797,10 +797,10 @@
}); });
QUnit.test('toArray', function(assert) { QUnit.test('toArray', function(assert) {
assert.ok(!_.isArray(arguments), 'arguments object is not an array'); assert.notOk(_.isArray(arguments), 'arguments object is not an array');
assert.ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); assert.ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array');
var a = [1, 2, 3]; var a = [1, 2, 3];
assert.ok(_.toArray(a) !== a, 'array is cloned'); assert.notStrictEqual(_.toArray(a), a, 'array is cloned');
assert.deepEqual(_.toArray(a), [1, 2, 3], 'cloned array contains same elements'); assert.deepEqual(_.toArray(a), [1, 2, 3], 'cloned array contains same elements');
var numbers = _.toArray({one: 1, two: 2, three: 3}); var numbers = _.toArray({one: 1, two: 2, three: 3});
@@ -882,7 +882,7 @@
assert.deepEqual(_.map(elementChildren, 'id'), ['id1', 'id2']); assert.deepEqual(_.map(elementChildren, 'id'), ['id1', 'id2']);
assert.deepEqual(_.map(parent.childNodes, 'nodeType'), [1, 3, 1]); assert.deepEqual(_.map(parent.childNodes, 'nodeType'), [1, 3, 1]);
assert.ok(!_.every(parent.childNodes, _.isElement)); assert.notOk(_.every(parent.childNodes, _.isElement));
assert.ok(_.some(parent.childNodes, _.isElement)); assert.ok(_.some(parent.childNodes, _.isElement));
function compareNode(node) { function compareNode(node) {

View File

@@ -35,7 +35,7 @@
QUnit.test('isEqual', function(assert) { QUnit.test('isEqual', function(assert) {
assert.ok(!_.isEqual(iNumber, 101)); assert.notOk(_.isEqual(iNumber, 101));
assert.ok(_.isEqual(iNumber, 100)); assert.ok(_.isEqual(iNumber, 100));
// Objects from another frame. // Objects from another frame.
@@ -46,13 +46,13 @@
}); });
QUnit.test('isEmpty', function(assert) { QUnit.test('isEmpty', function(assert) {
assert.ok(!_([iNumber]).isEmpty(), '[1] is not empty'); assert.notOk(_([iNumber]).isEmpty(), '[1] is not empty');
assert.ok(!_.isEmpty(iArray), '[] is empty'); assert.notOk(_.isEmpty(iArray), '[] is empty');
assert.ok(_.isEmpty(iObject), '{} is empty'); assert.ok(_.isEmpty(iObject), '{} is empty');
}); });
QUnit.test('isElement', function(assert) { QUnit.test('isElement', function(assert) {
assert.ok(!_.isElement('div'), 'strings are not dom elements'); assert.notOk(_.isElement('div'), 'strings are not dom elements');
assert.ok(_.isElement(document.body), 'the body tag is a DOM element'); assert.ok(_.isElement(document.body), 'the body tag is a DOM element');
assert.ok(_.isElement(iElement), 'even from another frame'); assert.ok(_.isElement(iElement), 'even from another frame');
}); });
@@ -113,12 +113,12 @@
if (typeof ActiveXObject != 'undefined') { if (typeof ActiveXObject != 'undefined') {
QUnit.test('IE host objects', function(assert) { QUnit.test('IE host objects', function(assert) {
var xml = new ActiveXObject('Msxml2.DOMDocument.3.0'); var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
assert.ok(!_.isNumber(xml)); assert.notOk(_.isNumber(xml));
assert.ok(!_.isBoolean(xml)); assert.notOk(_.isBoolean(xml));
assert.ok(!_.isNaN(xml)); assert.notOk(_.isNaN(xml));
assert.ok(!_.isFunction(xml)); assert.notOk(_.isFunction(xml));
assert.ok(!_.isNull(xml)); assert.notOk(_.isNull(xml));
assert.ok(!_.isUndefined(xml)); assert.notOk(_.isUndefined(xml));
}); });
QUnit.test('#1621 IE 11 compat mode DOM elements are not functions', function(assert) { QUnit.test('#1621 IE 11 compat mode DOM elements are not functions', function(assert) {

View File

@@ -180,7 +180,7 @@
var done = assert.async(); var done = assert.async();
var delayed = false; var delayed = false;
_.delay(function(){ delayed = true; }, 100); _.delay(function(){ delayed = true; }, 100);
setTimeout(function(){ assert.ok(!delayed, "didn't delay the function quite yet"); }, 50); setTimeout(function(){ assert.notOk(delayed, "didn't delay the function quite yet"); }, 50);
setTimeout(function(){ assert.ok(delayed, 'delayed the function'); done(); }, 150); setTimeout(function(){ assert.ok(delayed, 'delayed the function'); done(); }, 150);
}); });
@@ -694,6 +694,43 @@
assert.deepEqual(_.toArray(cb(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), _.range(1, 11)); assert.deepEqual(_.toArray(cb(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), _.range(1, 11));
}); });
// Test custom iteratee
var builtinIteratee = _.iteratee;
_.iteratee = function(value) {
// RegEx values return a function that returns the number of matches
if (_.isRegExp(value)) return function(obj) {
return (obj.match(value) || []).length;
};
return value;
};
var collection = ['foo', 'bar', 'bbiz'];
// Test all methods that claim to be transformed through `_.iteratee`
assert.deepEqual(_.countBy(collection, /b/g), {0: 1, 1: 1, 2: 1});
assert.equal(_.every(collection, /b/g), false);
assert.deepEqual(_.filter(collection, /b/g), ['bar', 'bbiz']);
assert.equal(_.find(collection, /b/g), 'bar');
assert.equal(_.findIndex(collection, /b/g), 1);
assert.equal(_.findKey(collection, /b/g), 1);
assert.equal(_.findLastIndex(collection, /b/g), 2);
assert.deepEqual(_.groupBy(collection, /b/g), {0: ['foo'], 1: ['bar'], 2: ['bbiz']});
assert.deepEqual(_.indexBy(collection, /b/g), {0: 'foo', 1: 'bar', 2: 'bbiz'});
assert.deepEqual(_.map(collection, /b/g), [0, 1, 2]);
assert.equal(_.max(collection, /b/g), 'bbiz');
assert.equal(_.min(collection, /b/g), 'foo');
assert.deepEqual(_.partition(collection, /b/g), [['bar', 'bbiz'], ['foo']]);
assert.deepEqual(_.reject(collection, /b/g), ['foo']);
assert.equal(_.some(collection, /b/g), true);
assert.deepEqual(_.sortBy(collection, /b/g), ['foo', 'bar', 'bbiz']);
assert.equal(_.sortedIndex(collection, 'blah', /b/g), 1);
assert.deepEqual(_.uniq(collection, /b/g), ['foo', 'bar', 'bbiz']);
var objCollection = {a: 'foo', b: 'bar', c: 'bbiz'};
assert.deepEqual(_.mapObject(objCollection, /b/g), {a: 0, b: 1, c: 2});
// Restore the builtin iteratee
_.iteratee = builtinIteratee;
}); });
QUnit.test('restArgs', function(assert) { QUnit.test('restArgs', function(assert) {

View File

@@ -123,7 +123,7 @@
subObj.c = 'd'; subObj.c = 'd';
assert.deepEqual(_.extend({}, subObj), {a: 'b', c: 'd'}, 'extend copies all properties from source'); assert.deepEqual(_.extend({}, subObj), {a: 'b', c: 'd'}, 'extend copies all properties from source');
_.extend(subObj, {}); _.extend(subObj, {});
assert.ok(!subObj.hasOwnProperty('a'), "extend does not convert destination object's 'in' properties to 'own' properties"); assert.notOk(subObj.hasOwnProperty('a'), "extend does not convert destination object's 'in' properties to 'own' properties");
try { try {
result = {}; result = {};
@@ -205,7 +205,7 @@
return this[key] === 3 && this === instance; return this[key] === 3 && this === instance;
}, instance), {c: 3}, 'function is given context'); }, instance), {c: 3}, 'function is given context');
assert.ok(!_.has(_.pick({}, 'foo'), 'foo'), 'does not set own property if property not in object'); assert.notOk(_.has(_.pick({}, 'foo'), 'foo'), 'does not set own property if property not in object');
_.pick(data, function(value, key, obj) { _.pick(data, function(value, key, obj) {
assert.equal(obj, data, 'passes same object as third parameter of iteratee'); assert.equal(obj, data, 'passes same object as third parameter of iteratee');
}); });
@@ -309,7 +309,7 @@
Child.prototype.foo = 'foo'; Child.prototype.foo = 'foo';
var created = _.create(Child.prototype, new Child); var created = _.create(Child.prototype, new Child);
assert.ok(!created.hasOwnProperty('foo'), 'should only add own properties'); assert.notOk(created.hasOwnProperty('foo'), 'should only add own properties');
}); });
QUnit.test('isEqual', function(assert) { QUnit.test('isEqual', function(assert) {
@@ -326,10 +326,10 @@
assert.ok(_.isEqual(null, null), '`null` is equal to `null`'); assert.ok(_.isEqual(null, null), '`null` is equal to `null`');
assert.ok(_.isEqual(), '`undefined` is equal to `undefined`'); assert.ok(_.isEqual(), '`undefined` is equal to `undefined`');
assert.ok(!_.isEqual(0, -0), '`0` is not equal to `-0`'); assert.notOk(_.isEqual(0, -0), '`0` is not equal to `-0`');
assert.ok(!_.isEqual(-0, 0), 'Commutative equality is implemented for `0` and `-0`'); assert.notOk(_.isEqual(-0, 0), 'Commutative equality is implemented for `0` and `-0`');
assert.ok(!_.isEqual(null, void 0), '`null` is not equal to `undefined`'); assert.notOk(_.isEqual(null, void 0), '`null` is not equal to `undefined`');
assert.ok(!_.isEqual(void 0, null), 'Commutative equality is implemented for `null` and `undefined`'); assert.notOk(_.isEqual(void 0, null), 'Commutative equality is implemented for `null` and `undefined`');
// String object and primitive comparisons. // String object and primitive comparisons.
assert.ok(_.isEqual('Curly', 'Curly'), 'Identical string primitives are equal'); assert.ok(_.isEqual('Curly', 'Curly'), 'Identical string primitives are equal');
@@ -337,76 +337,76 @@
assert.ok(_.isEqual(new String('Curly'), 'Curly'), 'String primitives and their corresponding object wrappers are equal'); assert.ok(_.isEqual(new String('Curly'), 'Curly'), 'String primitives and their corresponding object wrappers are equal');
assert.ok(_.isEqual('Curly', new String('Curly')), 'Commutative equality is implemented for string objects and primitives'); assert.ok(_.isEqual('Curly', new String('Curly')), 'Commutative equality is implemented for string objects and primitives');
assert.ok(!_.isEqual('Curly', 'Larry'), 'String primitives with different values are not equal'); assert.notOk(_.isEqual('Curly', 'Larry'), 'String primitives with different values are not equal');
assert.ok(!_.isEqual(new String('Curly'), new String('Larry')), 'String objects with different primitive values are not equal'); assert.notOk(_.isEqual(new String('Curly'), new String('Larry')), 'String objects with different primitive values are not equal');
assert.ok(!_.isEqual(new String('Curly'), {toString: function(){ return 'Curly'; }}), 'String objects and objects with a custom `toString` method are not equal'); assert.notOk(_.isEqual(new String('Curly'), {toString: function(){ return 'Curly'; }}), 'String objects and objects with a custom `toString` method are not equal');
// Number object and primitive comparisons. // Number object and primitive comparisons.
assert.ok(_.isEqual(75, 75), 'Identical number primitives are equal'); assert.ok(_.isEqual(75, 75), 'Identical number primitives are equal');
assert.ok(_.isEqual(new Number(75), new Number(75)), 'Number objects with identical primitive values are equal'); assert.ok(_.isEqual(new Number(75), new Number(75)), 'Number objects with identical primitive values are equal');
assert.ok(_.isEqual(75, new Number(75)), 'Number primitives and their corresponding object wrappers are equal'); assert.ok(_.isEqual(75, new Number(75)), 'Number primitives and their corresponding object wrappers are equal');
assert.ok(_.isEqual(new Number(75), 75), 'Commutative equality is implemented for number objects and primitives'); assert.ok(_.isEqual(new Number(75), 75), 'Commutative equality is implemented for number objects and primitives');
assert.ok(!_.isEqual(new Number(0), -0), '`new Number(0)` and `-0` are not equal'); assert.notOk(_.isEqual(new Number(0), -0), '`new Number(0)` and `-0` are not equal');
assert.ok(!_.isEqual(0, new Number(-0)), 'Commutative equality is implemented for `new Number(0)` and `-0`'); assert.notOk(_.isEqual(0, new Number(-0)), 'Commutative equality is implemented for `new Number(0)` and `-0`');
assert.ok(!_.isEqual(new Number(75), new Number(63)), 'Number objects with different primitive values are not equal'); assert.notOk(_.isEqual(new Number(75), new Number(63)), 'Number objects with different primitive values are not equal');
assert.ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), 'Number objects and objects with a `valueOf` method are not equal'); assert.notOk(_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), 'Number objects and objects with a `valueOf` method are not equal');
// Comparisons involving `NaN`. // Comparisons involving `NaN`.
assert.ok(_.isEqual(NaN, NaN), '`NaN` is equal to `NaN`'); assert.ok(_.isEqual(NaN, NaN), '`NaN` is equal to `NaN`');
assert.ok(_.isEqual(new Number(NaN), NaN), 'Object(`NaN`) is equal to `NaN`'); assert.ok(_.isEqual(new Number(NaN), NaN), 'Object(`NaN`) is equal to `NaN`');
assert.ok(!_.isEqual(61, NaN), 'A number primitive is not equal to `NaN`'); assert.notOk(_.isEqual(61, NaN), 'A number primitive is not equal to `NaN`');
assert.ok(!_.isEqual(new Number(79), NaN), 'A number object is not equal to `NaN`'); assert.notOk(_.isEqual(new Number(79), NaN), 'A number object is not equal to `NaN`');
assert.ok(!_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`'); assert.notOk(_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`');
// Boolean object and primitive comparisons. // Boolean object and primitive comparisons.
assert.ok(_.isEqual(true, true), 'Identical boolean primitives are equal'); assert.ok(_.isEqual(true, true), 'Identical boolean primitives are equal');
assert.ok(_.isEqual(new Boolean, new Boolean), 'Boolean objects with identical primitive values are equal'); assert.ok(_.isEqual(new Boolean, new Boolean), 'Boolean objects with identical primitive values are equal');
assert.ok(_.isEqual(true, new Boolean(true)), 'Boolean primitives and their corresponding object wrappers are equal'); assert.ok(_.isEqual(true, new Boolean(true)), 'Boolean primitives and their corresponding object wrappers are equal');
assert.ok(_.isEqual(new Boolean(true), true), 'Commutative equality is implemented for booleans'); assert.ok(_.isEqual(new Boolean(true), true), 'Commutative equality is implemented for booleans');
assert.ok(!_.isEqual(new Boolean(true), new Boolean), 'Boolean objects with different primitive values are not equal'); assert.notOk(_.isEqual(new Boolean(true), new Boolean), 'Boolean objects with different primitive values are not equal');
// Common type coercions. // Common type coercions.
assert.ok(!_.isEqual(new Boolean(false), true), '`new Boolean(false)` is not equal to `true`'); assert.notOk(_.isEqual(new Boolean(false), true), '`new Boolean(false)` is not equal to `true`');
assert.ok(!_.isEqual('75', 75), 'String and number primitives with like values are not equal'); assert.notOk(_.isEqual('75', 75), 'String and number primitives with like values are not equal');
assert.ok(!_.isEqual(new Number(63), new String(63)), 'String and number objects with like values are not equal'); assert.notOk(_.isEqual(new Number(63), new String(63)), 'String and number objects with like values are not equal');
assert.ok(!_.isEqual(75, '75'), 'Commutative equality is implemented for like string and number values'); assert.notOk(_.isEqual(75, '75'), 'Commutative equality is implemented for like string and number values');
assert.ok(!_.isEqual(0, ''), 'Number and string primitives with like values are not equal'); assert.notOk(_.isEqual(0, ''), 'Number and string primitives with like values are not equal');
assert.ok(!_.isEqual(1, true), 'Number and boolean primitives with like values are not equal'); assert.notOk(_.isEqual(1, true), 'Number and boolean primitives with like values are not equal');
assert.ok(!_.isEqual(new Boolean(false), new Number(0)), 'Boolean and number objects with like values are not equal'); assert.notOk(_.isEqual(new Boolean(false), new Number(0)), 'Boolean and number objects with like values are not equal');
assert.ok(!_.isEqual(false, new String('')), 'Boolean primitives and string objects with like values are not equal'); assert.notOk(_.isEqual(false, new String('')), 'Boolean primitives and string objects with like values are not equal');
assert.ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal'); assert.notOk(_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal');
// Dates. // Dates.
assert.ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), 'Date objects referencing identical times are equal'); assert.ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), 'Date objects referencing identical times are equal');
assert.ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), 'Date objects referencing different times are not equal'); assert.notOk(_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), 'Date objects referencing different times are not equal');
assert.ok(!_.isEqual(new Date(2009, 11, 13), { assert.notOk(_.isEqual(new Date(2009, 11, 13), {
getTime: function(){ getTime: function(){
return 12606876e5; return 12606876e5;
} }
}), 'Date objects and objects with a `getTime` method are not equal'); }), 'Date objects and objects with a `getTime` method are not equal');
assert.ok(!_.isEqual(new Date('Curly'), new Date('Curly')), 'Invalid dates are not equal'); assert.notOk(_.isEqual(new Date('Curly'), new Date('Curly')), 'Invalid dates are not equal');
// Functions. // Functions.
assert.ok(!_.isEqual(First, Second), 'Different functions with identical bodies and source code representations are not equal'); assert.notOk(_.isEqual(First, Second), 'Different functions with identical bodies and source code representations are not equal');
// RegExps. // RegExps.
assert.ok(_.isEqual(/(?:)/gim, /(?:)/gim), 'RegExps with equivalent patterns and flags are equal'); assert.ok(_.isEqual(/(?:)/gim, /(?:)/gim), 'RegExps with equivalent patterns and flags are equal');
assert.ok(_.isEqual(/(?:)/gi, /(?:)/ig), 'Flag order is not significant'); assert.ok(_.isEqual(/(?:)/gi, /(?:)/ig), 'Flag order is not significant');
assert.ok(!_.isEqual(/(?:)/g, /(?:)/gi), 'RegExps with equivalent patterns and different flags are not equal'); assert.notOk(_.isEqual(/(?:)/g, /(?:)/gi), 'RegExps with equivalent patterns and different flags are not equal');
assert.ok(!_.isEqual(/Moe/gim, /Curly/gim), 'RegExps with different patterns and equivalent flags are not equal'); assert.notOk(_.isEqual(/Moe/gim, /Curly/gim), 'RegExps with different patterns and equivalent flags are not equal');
assert.ok(!_.isEqual(/(?:)/gi, /(?:)/g), 'Commutative equality is implemented for RegExps'); assert.notOk(_.isEqual(/(?:)/gi, /(?:)/g), 'Commutative equality is implemented for RegExps');
assert.ok(!_.isEqual(/Curly/g, {source: 'Larry', global: true, ignoreCase: false, multiline: false}), 'RegExps and RegExp-like objects are not equal'); assert.notOk(_.isEqual(/Curly/g, {source: 'Larry', global: true, ignoreCase: false, multiline: false}), 'RegExps and RegExp-like objects are not equal');
// Empty arrays, array-like objects, and object literals. // Empty arrays, array-like objects, and object literals.
assert.ok(_.isEqual({}, {}), 'Empty object literals are equal'); assert.ok(_.isEqual({}, {}), 'Empty object literals are equal');
assert.ok(_.isEqual([], []), 'Empty array literals are equal'); assert.ok(_.isEqual([], []), 'Empty array literals are equal');
assert.ok(_.isEqual([{}], [{}]), 'Empty nested arrays and objects are equal'); assert.ok(_.isEqual([{}], [{}]), 'Empty nested arrays and objects are equal');
assert.ok(!_.isEqual({length: 0}, []), 'Array-like objects and arrays are not equal.'); assert.notOk(_.isEqual({length: 0}, []), 'Array-like objects and arrays are not equal.');
assert.ok(!_.isEqual([], {length: 0}), 'Commutative equality is implemented for array-like objects'); assert.notOk(_.isEqual([], {length: 0}), 'Commutative equality is implemented for array-like objects');
assert.ok(!_.isEqual({}, []), 'Object literals and array literals are not equal'); assert.notOk(_.isEqual({}, []), 'Object literals and array literals are not equal');
assert.ok(!_.isEqual([], {}), 'Commutative equality is implemented for objects and arrays'); assert.notOk(_.isEqual([], {}), 'Commutative equality is implemented for objects and arrays');
// Arrays with primitive and object values. // Arrays with primitive and object values.
assert.ok(_.isEqual([1, 'Larry', true], [1, 'Larry', true]), 'Arrays containing identical primitives are equal'); assert.ok(_.isEqual([1, 'Larry', true], [1, 'Larry', true]), 'Arrays containing identical primitives are equal');
@@ -424,14 +424,14 @@
// Array elements and properties. // Array elements and properties.
assert.ok(_.isEqual(a, b), 'Arrays containing equivalent elements and different non-numeric properties are equal'); assert.ok(_.isEqual(a, b), 'Arrays containing equivalent elements and different non-numeric properties are equal');
a.push('White Rocks'); a.push('White Rocks');
assert.ok(!_.isEqual(a, b), 'Arrays of different lengths are not equal'); assert.notOk(_.isEqual(a, b), 'Arrays of different lengths are not equal');
a.push('East Boulder'); a.push('East Boulder');
b.push('Gunbarrel Ranch', 'Teller Farm'); b.push('Gunbarrel Ranch', 'Teller Farm');
assert.ok(!_.isEqual(a, b), 'Arrays of identical lengths containing different elements are not equal'); assert.notOk(_.isEqual(a, b), 'Arrays of identical lengths containing different elements are not equal');
// Sparse arrays. // Sparse arrays.
assert.ok(_.isEqual(Array(3), Array(3)), 'Sparse arrays of identical lengths are equal'); assert.ok(_.isEqual(Array(3), Array(3)), 'Sparse arrays of identical lengths are equal');
assert.ok(!_.isEqual(Array(3), Array(6)), 'Sparse arrays of different lengths are not equal when both are empty'); assert.notOk(_.isEqual(Array(3), Array(6)), 'Sparse arrays of different lengths are not equal when both are empty');
var sparse = []; var sparse = [];
sparse[1] = 5; sparse[1] = 5;
@@ -440,11 +440,11 @@
// Simple objects. // Simple objects.
assert.ok(_.isEqual({a: 'Curly', b: 1, c: true}, {a: 'Curly', b: 1, c: true}), 'Objects containing identical primitives are equal'); assert.ok(_.isEqual({a: 'Curly', b: 1, c: true}, {a: 'Curly', b: 1, c: true}), 'Objects containing identical primitives are equal');
assert.ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), 'Objects containing equivalent members are equal'); assert.ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), 'Objects containing equivalent members are equal');
assert.ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), 'Objects of identical sizes with different values are not equal'); assert.notOk(_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), 'Objects of identical sizes with different values are not equal');
assert.ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), 'Objects of identical sizes with different property names are not equal'); assert.notOk(_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), 'Objects of identical sizes with different property names are not equal');
assert.ok(!_.isEqual({a: 1, b: 2}, {a: 1}), 'Objects of different sizes are not equal'); assert.notOk(_.isEqual({a: 1, b: 2}, {a: 1}), 'Objects of different sizes are not equal');
assert.ok(!_.isEqual({a: 1}, {a: 1, b: 2}), 'Commutative equality is implemented for objects'); assert.notOk(_.isEqual({a: 1}, {a: 1, b: 2}), 'Commutative equality is implemented for objects');
assert.ok(!_.isEqual({x: 1, y: void 0}, {x: 1, z: 2}), 'Objects with identical keys and different values are not equivalent'); assert.notOk(_.isEqual({x: 1, y: void 0}, {x: 1, z: 2}), 'Objects with identical keys and different values are not equivalent');
// `A` contains nested objects and arrays. // `A` contains nested objects and arrays.
a = { a = {
@@ -479,9 +479,9 @@
// Instances. // Instances.
assert.ok(_.isEqual(new First, new First), 'Object instances are equal'); assert.ok(_.isEqual(new First, new First), 'Object instances are equal');
assert.ok(!_.isEqual(new First, new Second), 'Objects with different constructors and identical own properties are not equal'); assert.notOk(_.isEqual(new First, new Second), 'Objects with different constructors and identical own properties are not equal');
assert.ok(!_.isEqual({value: 1}, new First), 'Object instances and objects sharing equivalent properties are not equal'); assert.notOk(_.isEqual({value: 1}, new First), 'Object instances and objects sharing equivalent properties are not equal');
assert.ok(!_.isEqual({value: 2}, new Second), 'The prototype chain of objects should not be examined'); assert.notOk(_.isEqual({value: 2}, new Second), 'The prototype chain of objects should not be examined');
// Circular Arrays. // Circular Arrays.
(a = []).push(a); (a = []).push(a);
@@ -492,13 +492,13 @@
assert.ok(_.isEqual(a, b), 'Arrays containing circular references and equivalent properties are equal'); assert.ok(_.isEqual(a, b), 'Arrays containing circular references and equivalent properties are equal');
a.push('Shemp'); a.push('Shemp');
b.push('Curly'); b.push('Curly');
assert.ok(!_.isEqual(a, b), 'Arrays containing circular references and different properties are not equal'); assert.notOk(_.isEqual(a, b), 'Arrays containing circular references and different properties are not equal');
// More circular arrays #767. // More circular arrays #767.
a = ['everything is checked but', 'this', 'is not']; a = ['everything is checked but', 'this', 'is not'];
a[1] = a; a[1] = a;
b = ['everything is checked but', ['this', 'array'], 'is not']; b = ['everything is checked but', ['this', 'array'], 'is not'];
assert.ok(!_.isEqual(a, b), 'Comparison of circular references with non-circular references are not equal'); assert.notOk(_.isEqual(a, b), 'Comparison of circular references with non-circular references are not equal');
// Circular Objects. // Circular Objects.
a = {abc: null}; a = {abc: null};
@@ -511,13 +511,13 @@
assert.ok(_.isEqual(a, b), 'Objects containing circular references and equivalent properties are equal'); assert.ok(_.isEqual(a, b), 'Objects containing circular references and equivalent properties are equal');
a.def = new Number(75); a.def = new Number(75);
b.def = new Number(63); b.def = new Number(63);
assert.ok(!_.isEqual(a, b), 'Objects containing circular references and different properties are not equal'); assert.notOk(_.isEqual(a, b), 'Objects containing circular references and different properties are not equal');
// More circular objects #767. // More circular objects #767.
a = {everything: 'is checked', but: 'this', is: 'not'}; a = {everything: 'is checked', but: 'this', is: 'not'};
a.but = a; a.but = a;
b = {everything: 'is checked', but: {that: 'object'}, is: 'not'}; b = {everything: 'is checked', but: {that: 'object'}, is: 'not'};
assert.ok(!_.isEqual(a, b), 'Comparison of circular references with non-circular object references are not equal'); assert.notOk(_.isEqual(a, b), 'Comparison of circular references with non-circular object references are not equal');
// Cyclic Structures. // Cyclic Structures.
a = [{abc: null}]; a = [{abc: null}];
@@ -530,7 +530,7 @@
assert.ok(_.isEqual(a, b), 'Cyclic structures containing equivalent properties are equal'); assert.ok(_.isEqual(a, b), 'Cyclic structures containing equivalent properties are equal');
a[0].def = new String('Larry'); a[0].def = new String('Larry');
b[0].def = new String('Curly'); b[0].def = new String('Curly');
assert.ok(!_.isEqual(a, b), 'Cyclic structures containing different properties are not equal'); assert.notOk(_.isEqual(a, b), 'Cyclic structures containing different properties are not equal');
// Complex Circular References. // Complex Circular References.
a = {foo: {b: {foo: {c: {foo: null}}}}}; a = {foo: {b: {foo: {c: {foo: null}}}}};
@@ -540,7 +540,7 @@
assert.ok(_.isEqual(a, b), 'Cyclic structures with nested and identically-named properties are equal'); assert.ok(_.isEqual(a, b), 'Cyclic structures with nested and identically-named properties are equal');
// Chaining. // Chaining.
assert.ok(!_.isEqual(_({x: 1, y: void 0}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); assert.notOk(_.isEqual(_({x: 1, y: void 0}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal');
a = _({x: 1, y: 2}).chain(); a = _({x: 1, y: 2}).chain();
b = _({x: 1, y: 2}).chain(); b = _({x: 1, y: 2}).chain();
@@ -576,15 +576,15 @@
}); });
QUnit.test('isEmpty', function(assert) { QUnit.test('isEmpty', function(assert) {
assert.ok(!_([1]).isEmpty(), '[1] is not empty'); assert.notOk(_([1]).isEmpty(), '[1] is not empty');
assert.ok(_.isEmpty([]), '[] is empty'); assert.ok(_.isEmpty([]), '[] is empty');
assert.ok(!_.isEmpty({one: 1}), '{one: 1} is not empty'); assert.notOk(_.isEmpty({one: 1}), '{one: 1} is not empty');
assert.ok(_.isEmpty({}), '{} is empty'); assert.ok(_.isEmpty({}), '{} is empty');
assert.ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); assert.ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty');
assert.ok(_.isEmpty(null), 'null is empty'); assert.ok(_.isEmpty(null), 'null is empty');
assert.ok(_.isEmpty(), 'undefined is empty'); assert.ok(_.isEmpty(), 'undefined is empty');
assert.ok(_.isEmpty(''), 'the empty string is empty'); assert.ok(_.isEmpty(''), 'the empty string is empty');
assert.ok(!_.isEmpty('moe'), 'but other strings are not'); assert.notOk(_.isEmpty('moe'), 'but other strings are not');
var obj = {one: 1}; var obj = {one: 1};
delete obj.one; delete obj.one;
@@ -592,27 +592,27 @@
var args = function(){ return arguments; }; var args = function(){ return arguments; };
assert.ok(_.isEmpty(args()), 'empty arguments object is empty'); assert.ok(_.isEmpty(args()), 'empty arguments object is empty');
assert.ok(!_.isEmpty(args('')), 'non-empty arguments object is not empty'); assert.notOk(_.isEmpty(args('')), 'non-empty arguments object is not empty');
// covers collecting non-enumerable properties in IE < 9 // covers collecting non-enumerable properties in IE < 9
var nonEnumProp = {toString: 5}; var nonEnumProp = {toString: 5};
assert.ok(!_.isEmpty(nonEnumProp), 'non-enumerable property is not empty'); assert.notOk(_.isEmpty(nonEnumProp), 'non-enumerable property is not empty');
}); });
if (typeof document === 'object') { if (typeof document === 'object') {
QUnit.test('isElement', function(assert) { QUnit.test('isElement', function(assert) {
assert.ok(!_.isElement('div'), 'strings are not dom elements'); assert.notOk(_.isElement('div'), 'strings are not dom elements');
assert.ok(_.isElement(testElement), 'an element is a DOM element'); assert.ok(_.isElement(testElement), 'an element is a DOM element');
}); });
} }
QUnit.test('isArguments', function(assert) { QUnit.test('isArguments', function(assert) {
var args = (function(){ return arguments; }(1, 2, 3)); var args = (function(){ return arguments; }(1, 2, 3));
assert.ok(!_.isArguments('string'), 'a string is not an arguments object'); assert.notOk(_.isArguments('string'), 'a string is not an arguments object');
assert.ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); assert.notOk(_.isArguments(_.isArguments), 'a function is not an arguments object');
assert.ok(_.isArguments(args), 'but the arguments object is an arguments object'); assert.ok(_.isArguments(args), 'but the arguments object is an arguments object');
assert.ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); assert.notOk(_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array');
assert.ok(!_.isArguments([1, 2, 3]), 'and not vanilla arrays.'); assert.notOk(_.isArguments([1, 2, 3]), 'and not vanilla arrays.');
}); });
QUnit.test('isObject', function(assert) { QUnit.test('isObject', function(assert) {
@@ -622,24 +622,24 @@
assert.ok(_.isObject(testElement), 'and DOM element'); assert.ok(_.isObject(testElement), 'and DOM element');
} }
assert.ok(_.isObject(function() {}), 'and functions'); assert.ok(_.isObject(function() {}), 'and functions');
assert.ok(!_.isObject(null), 'but not null'); assert.notOk(_.isObject(null), 'but not null');
assert.ok(!_.isObject(void 0), 'and not undefined'); assert.notOk(_.isObject(void 0), 'and not undefined');
assert.ok(!_.isObject('string'), 'and not string'); assert.notOk(_.isObject('string'), 'and not string');
assert.ok(!_.isObject(12), 'and not number'); assert.notOk(_.isObject(12), 'and not number');
assert.ok(!_.isObject(true), 'and not boolean'); assert.notOk(_.isObject(true), 'and not boolean');
assert.ok(_.isObject(new String('string')), 'but new String()'); assert.ok(_.isObject(new String('string')), 'but new String()');
}); });
QUnit.test('isArray', function(assert) { QUnit.test('isArray', function(assert) {
assert.ok(!_.isArray(void 0), 'undefined vars are not arrays'); assert.notOk(_.isArray(void 0), 'undefined vars are not arrays');
assert.ok(!_.isArray(arguments), 'the arguments object is not an array'); assert.notOk(_.isArray(arguments), 'the arguments object is not an array');
assert.ok(_.isArray([1, 2, 3]), 'but arrays are'); assert.ok(_.isArray([1, 2, 3]), 'but arrays are');
}); });
QUnit.test('isString', function(assert) { QUnit.test('isString', function(assert) {
var obj = new String('I am a string object'); var obj = new String('I am a string object');
if (testElement) { if (testElement) {
assert.ok(!_.isString(testElement), 'an element is not a string'); assert.notOk(_.isString(testElement), 'an element is not a string');
} }
assert.ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); assert.ok(_.isString([1, 2, 3].join(', ')), 'but strings are');
assert.strictEqual(_.isString('I am a string literal'), true, 'string literals are'); assert.strictEqual(_.isString('I am a string literal'), true, 'string literals are');
@@ -648,9 +648,9 @@
}); });
QUnit.test('isSymbol', function(assert) { QUnit.test('isSymbol', function(assert) {
assert.ok(!_.isSymbol(0), 'numbers are not symbols'); assert.notOk(_.isSymbol(0), 'numbers are not symbols');
assert.ok(!_.isSymbol(''), 'strings are not symbols'); assert.notOk(_.isSymbol(''), 'strings are not symbols');
assert.ok(!_.isSymbol(_.isSymbol), 'functions are not symbols'); assert.notOk(_.isSymbol(_.isSymbol), 'functions are not symbols');
if (typeof Symbol === 'function') { if (typeof Symbol === 'function') {
assert.ok(_.isSymbol(Symbol()), 'symbols are symbols'); assert.ok(_.isSymbol(Symbol()), 'symbols are symbols');
assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols'); assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols');
@@ -659,43 +659,43 @@
}); });
QUnit.test('isNumber', function(assert) { QUnit.test('isNumber', function(assert) {
assert.ok(!_.isNumber('string'), 'a string is not a number'); assert.notOk(_.isNumber('string'), 'a string is not a number');
assert.ok(!_.isNumber(arguments), 'the arguments object is not a number'); assert.notOk(_.isNumber(arguments), 'the arguments object is not a number');
assert.ok(!_.isNumber(void 0), 'undefined is not a number'); assert.notOk(_.isNumber(void 0), 'undefined is not a number');
assert.ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); assert.ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are');
assert.ok(_.isNumber(NaN), 'NaN *is* a number'); assert.ok(_.isNumber(NaN), 'NaN *is* a number');
assert.ok(_.isNumber(Infinity), 'Infinity is a number'); assert.ok(_.isNumber(Infinity), 'Infinity is a number');
assert.ok(!_.isNumber('1'), 'numeric strings are not numbers'); assert.notOk(_.isNumber('1'), 'numeric strings are not numbers');
}); });
QUnit.test('isBoolean', function(assert) { QUnit.test('isBoolean', function(assert) {
assert.ok(!_.isBoolean(2), 'a number is not a boolean'); assert.notOk(_.isBoolean(2), 'a number is not a boolean');
assert.ok(!_.isBoolean('string'), 'a string is not a boolean'); assert.notOk(_.isBoolean('string'), 'a string is not a boolean');
assert.ok(!_.isBoolean('false'), 'the string "false" is not a boolean'); assert.notOk(_.isBoolean('false'), 'the string "false" is not a boolean');
assert.ok(!_.isBoolean('true'), 'the string "true" is not a boolean'); assert.notOk(_.isBoolean('true'), 'the string "true" is not a boolean');
assert.ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); assert.notOk(_.isBoolean(arguments), 'the arguments object is not a boolean');
assert.ok(!_.isBoolean(void 0), 'undefined is not a boolean'); assert.notOk(_.isBoolean(void 0), 'undefined is not a boolean');
assert.ok(!_.isBoolean(NaN), 'NaN is not a boolean'); assert.notOk(_.isBoolean(NaN), 'NaN is not a boolean');
assert.ok(!_.isBoolean(null), 'null is not a boolean'); assert.notOk(_.isBoolean(null), 'null is not a boolean');
assert.ok(_.isBoolean(true), 'but true is'); assert.ok(_.isBoolean(true), 'but true is');
assert.ok(_.isBoolean(false), 'and so is false'); assert.ok(_.isBoolean(false), 'and so is false');
}); });
QUnit.test('isMap', function(assert) { QUnit.test('isMap', function(assert) {
assert.ok(!_.isMap('string'), 'a string is not a map'); assert.notOk(_.isMap('string'), 'a string is not a map');
assert.ok(!_.isMap(2), 'a number is not a map'); assert.notOk(_.isMap(2), 'a number is not a map');
assert.ok(!_.isMap({}), 'an object is not a map'); assert.notOk(_.isMap({}), 'an object is not a map');
assert.ok(!_.isMap(false), 'a boolean is not a map'); assert.notOk(_.isMap(false), 'a boolean is not a map');
assert.ok(!_.isMap(void 0), 'undefined is not a map'); assert.notOk(_.isMap(void 0), 'undefined is not a map');
assert.ok(!_.isMap([1, 2, 3]), 'an array is not a map'); assert.notOk(_.isMap([1, 2, 3]), 'an array is not a map');
if (typeof Set === 'function') { if (typeof Set === 'function') {
assert.ok(!_.isMap(new Set()), 'a set is not a map'); assert.notOk(_.isMap(new Set()), 'a set is not a map');
} }
if (typeof WeakSet === 'function') { if (typeof WeakSet === 'function') {
assert.ok(!_.isMap(new WeakSet()), 'a weakset is not a map'); assert.notOk(_.isMap(new WeakSet()), 'a weakset is not a map');
} }
if (typeof WeakMap === 'function') { if (typeof WeakMap === 'function') {
assert.ok(!_.isMap(new WeakMap()), 'a weakmap is not a map'); assert.notOk(_.isMap(new WeakMap()), 'a weakmap is not a map');
} }
if (typeof Map === 'function') { if (typeof Map === 'function') {
var keyString = 'a string'; var keyString = 'a string';
@@ -706,20 +706,20 @@
}); });
QUnit.test('isWeakMap', function(assert) { QUnit.test('isWeakMap', function(assert) {
assert.ok(!_.isWeakMap('string'), 'a string is not a weakmap'); assert.notOk(_.isWeakMap('string'), 'a string is not a weakmap');
assert.ok(!_.isWeakMap(2), 'a number is not a weakmap'); assert.notOk(_.isWeakMap(2), 'a number is not a weakmap');
assert.ok(!_.isWeakMap({}), 'an object is not a weakmap'); assert.notOk(_.isWeakMap({}), 'an object is not a weakmap');
assert.ok(!_.isWeakMap(false), 'a boolean is not a weakmap'); assert.notOk(_.isWeakMap(false), 'a boolean is not a weakmap');
assert.ok(!_.isWeakMap(void 0), 'undefined is not a weakmap'); assert.notOk(_.isWeakMap(void 0), 'undefined is not a weakmap');
assert.ok(!_.isWeakMap([1, 2, 3]), 'an array is not a weakmap'); assert.notOk(_.isWeakMap([1, 2, 3]), 'an array is not a weakmap');
if (typeof Set === 'function') { if (typeof Set === 'function') {
assert.ok(!_.isWeakMap(new Set()), 'a set is not a weakmap'); assert.notOk(_.isWeakMap(new Set()), 'a set is not a weakmap');
} }
if (typeof WeakSet === 'function') { if (typeof WeakSet === 'function') {
assert.ok(!_.isWeakMap(new WeakSet()), 'a weakset is not a weakmap'); assert.notOk(_.isWeakMap(new WeakSet()), 'a weakset is not a weakmap');
} }
if (typeof Map === 'function') { if (typeof Map === 'function') {
assert.ok(!_.isWeakMap(new Map()), 'a map is not a weakmap'); assert.notOk(_.isWeakMap(new Map()), 'a map is not a weakmap');
} }
if (typeof WeakMap === 'function') { if (typeof WeakMap === 'function') {
var keyObj = {}, obj = new WeakMap(); var keyObj = {}, obj = new WeakMap();
@@ -729,20 +729,20 @@
}); });
QUnit.test('isSet', function(assert) { QUnit.test('isSet', function(assert) {
assert.ok(!_.isSet('string'), 'a string is not a set'); assert.notOk(_.isSet('string'), 'a string is not a set');
assert.ok(!_.isSet(2), 'a number is not a set'); assert.notOk(_.isSet(2), 'a number is not a set');
assert.ok(!_.isSet({}), 'an object is not a set'); assert.notOk(_.isSet({}), 'an object is not a set');
assert.ok(!_.isSet(false), 'a boolean is not a set'); assert.notOk(_.isSet(false), 'a boolean is not a set');
assert.ok(!_.isSet(void 0), 'undefined is not a set'); assert.notOk(_.isSet(void 0), 'undefined is not a set');
assert.ok(!_.isSet([1, 2, 3]), 'an array is not a set'); assert.notOk(_.isSet([1, 2, 3]), 'an array is not a set');
if (typeof Map === 'function') { if (typeof Map === 'function') {
assert.ok(!_.isSet(new Map()), 'a map is not a set'); assert.notOk(_.isSet(new Map()), 'a map is not a set');
} }
if (typeof WeakMap === 'function') { if (typeof WeakMap === 'function') {
assert.ok(!_.isSet(new WeakMap()), 'a weakmap is not a set'); assert.notOk(_.isSet(new WeakMap()), 'a weakmap is not a set');
} }
if (typeof WeakSet === 'function') { if (typeof WeakSet === 'function') {
assert.ok(!_.isSet(new WeakSet()), 'a weakset is not a set'); assert.notOk(_.isSet(new WeakSet()), 'a weakset is not a set');
} }
if (typeof Set === 'function') { if (typeof Set === 'function') {
var obj = new Set(); var obj = new Set();
@@ -753,20 +753,20 @@
QUnit.test('isWeakSet', function(assert) { QUnit.test('isWeakSet', function(assert) {
assert.ok(!_.isWeakSet('string'), 'a string is not a weakset'); assert.notOk(_.isWeakSet('string'), 'a string is not a weakset');
assert.ok(!_.isWeakSet(2), 'a number is not a weakset'); assert.notOk(_.isWeakSet(2), 'a number is not a weakset');
assert.ok(!_.isWeakSet({}), 'an object is not a weakset'); assert.notOk(_.isWeakSet({}), 'an object is not a weakset');
assert.ok(!_.isWeakSet(false), 'a boolean is not a weakset'); assert.notOk(_.isWeakSet(false), 'a boolean is not a weakset');
assert.ok(!_.isWeakSet(void 0), 'undefined is not a weakset'); assert.notOk(_.isWeakSet(void 0), 'undefined is not a weakset');
assert.ok(!_.isWeakSet([1, 2, 3]), 'an array is not a weakset'); assert.notOk(_.isWeakSet([1, 2, 3]), 'an array is not a weakset');
if (typeof Map === 'function') { if (typeof Map === 'function') {
assert.ok(!_.isWeakSet(new Map()), 'a map is not a weakset'); assert.notOk(_.isWeakSet(new Map()), 'a map is not a weakset');
} }
if (typeof WeakMap === 'function') { if (typeof WeakMap === 'function') {
assert.ok(!_.isWeakSet(new WeakMap()), 'a weakmap is not a weakset'); assert.notOk(_.isWeakSet(new WeakMap()), 'a weakmap is not a weakset');
} }
if (typeof Set === 'function') { if (typeof Set === 'function') {
assert.ok(!_.isWeakSet(new Set()), 'a set is not a weakset'); assert.notOk(_.isWeakSet(new Set()), 'a set is not a weakset');
} }
if (typeof WeakSet === 'function') { if (typeof WeakSet === 'function') {
var obj = new WeakSet(); var obj = new WeakSet();
@@ -776,19 +776,19 @@
}); });
QUnit.test('isFunction', function(assert) { QUnit.test('isFunction', function(assert) {
assert.ok(!_.isFunction(void 0), 'undefined vars are not functions'); assert.notOk(_.isFunction(void 0), 'undefined vars are not functions');
assert.ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); assert.notOk(_.isFunction([1, 2, 3]), 'arrays are not functions');
assert.ok(!_.isFunction('moe'), 'strings are not functions'); assert.notOk(_.isFunction('moe'), 'strings are not functions');
assert.ok(_.isFunction(_.isFunction), 'but functions are'); assert.ok(_.isFunction(_.isFunction), 'but functions are');
assert.ok(_.isFunction(function(){}), 'even anonymous ones'); assert.ok(_.isFunction(function(){}), 'even anonymous ones');
if (testElement) { if (testElement) {
assert.ok(!_.isFunction(testElement), 'elements are not functions'); assert.notOk(_.isFunction(testElement), 'elements are not functions');
} }
var nodelist = typeof document != 'undefined' && document.childNodes; var nodelist = typeof document != 'undefined' && document.childNodes;
if (nodelist) { if (nodelist) {
assert.ok(!_.isFunction(nodelist)); assert.notOk(_.isFunction(nodelist));
} }
}); });
@@ -806,65 +806,68 @@
} }
QUnit.test('isDate', function(assert) { QUnit.test('isDate', function(assert) {
assert.ok(!_.isDate(100), 'numbers are not dates'); assert.notOk(_.isDate(100), 'numbers are not dates');
assert.ok(!_.isDate({}), 'objects are not dates'); assert.notOk(_.isDate({}), 'objects are not dates');
assert.ok(_.isDate(new Date()), 'but dates are'); assert.ok(_.isDate(new Date()), 'but dates are');
}); });
QUnit.test('isRegExp', function(assert) { QUnit.test('isRegExp', function(assert) {
assert.ok(!_.isRegExp(_.identity), 'functions are not RegExps'); assert.notOk(_.isRegExp(_.identity), 'functions are not RegExps');
assert.ok(_.isRegExp(/identity/), 'but RegExps are'); assert.ok(_.isRegExp(/identity/), 'but RegExps are');
}); });
QUnit.test('isFinite', function(assert) { QUnit.test('isFinite', function(assert) {
assert.ok(!_.isFinite(void 0), 'undefined is not finite'); assert.notOk(_.isFinite(void 0), 'undefined is not finite');
assert.ok(!_.isFinite(null), 'null is not finite'); assert.notOk(_.isFinite(null), 'null is not finite');
assert.ok(!_.isFinite(NaN), 'NaN is not finite'); assert.notOk(_.isFinite(NaN), 'NaN is not finite');
assert.ok(!_.isFinite(Infinity), 'Infinity is not finite'); assert.notOk(_.isFinite(Infinity), 'Infinity is not finite');
assert.ok(!_.isFinite(-Infinity), '-Infinity is not finite'); assert.notOk(_.isFinite(-Infinity), '-Infinity is not finite');
assert.ok(_.isFinite('12'), 'Numeric strings are numbers'); assert.ok(_.isFinite('12'), 'Numeric strings are numbers');
assert.ok(!_.isFinite('1a'), 'Non numeric strings are not numbers'); assert.notOk(_.isFinite('1a'), 'Non numeric strings are not numbers');
assert.ok(!_.isFinite(''), 'Empty strings are not numbers'); assert.notOk(_.isFinite(''), 'Empty strings are not numbers');
var obj = new Number(5); var obj = new Number(5);
assert.ok(_.isFinite(obj), 'Number instances can be finite'); assert.ok(_.isFinite(obj), 'Number instances can be finite');
assert.ok(_.isFinite(0), '0 is finite'); assert.ok(_.isFinite(0), '0 is finite');
assert.ok(_.isFinite(123), 'Ints are finite'); assert.ok(_.isFinite(123), 'Ints are finite');
assert.ok(_.isFinite(-12.44), 'Floats are finite'); assert.ok(_.isFinite(-12.44), 'Floats are finite');
if (typeof Symbol === 'function') { if (typeof Symbol === 'function') {
assert.ok(!_.isFinite(Symbol()), 'symbols are not numbers'); assert.notOk(_.isFinite(Symbol()), 'symbols are not numbers');
assert.ok(!_.isFinite(Symbol('description')), 'described symbols are not numbers'); assert.notOk(_.isFinite(Symbol('description')), 'described symbols are not numbers');
assert.ok(!_.isFinite(Object(Symbol())), 'boxed symbols are not numbers'); assert.notOk(_.isFinite(Object(Symbol())), 'boxed symbols are not numbers');
} }
}); });
QUnit.test('isNaN', function(assert) { QUnit.test('isNaN', function(assert) {
assert.ok(!_.isNaN(void 0), 'undefined is not NaN'); assert.notOk(_.isNaN(void 0), 'undefined is not NaN');
assert.ok(!_.isNaN(null), 'null is not NaN'); assert.notOk(_.isNaN(null), 'null is not NaN');
assert.ok(!_.isNaN(0), '0 is not NaN'); assert.notOk(_.isNaN(0), '0 is not NaN');
assert.ok(!_.isNaN(new Number(0)), 'wrapped 0 is not NaN'); assert.notOk(_.isNaN(new Number(0)), 'wrapped 0 is not NaN');
assert.ok(_.isNaN(NaN), 'but NaN is'); assert.ok(_.isNaN(NaN), 'but NaN is');
assert.ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); assert.ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN');
if (typeof Symbol !== 'undefined'){
assert.notOk(_.isNaN(Symbol()), 'symbol is not NaN');
}
}); });
QUnit.test('isNull', function(assert) { QUnit.test('isNull', function(assert) {
assert.ok(!_.isNull(void 0), 'undefined is not null'); assert.notOk(_.isNull(void 0), 'undefined is not null');
assert.ok(!_.isNull(NaN), 'NaN is not null'); assert.notOk(_.isNull(NaN), 'NaN is not null');
assert.ok(_.isNull(null), 'but null is'); assert.ok(_.isNull(null), 'but null is');
}); });
QUnit.test('isUndefined', function(assert) { QUnit.test('isUndefined', function(assert) {
assert.ok(!_.isUndefined(1), 'numbers are defined'); assert.notOk(_.isUndefined(1), 'numbers are defined');
assert.ok(!_.isUndefined(null), 'null is defined'); assert.notOk(_.isUndefined(null), 'null is defined');
assert.ok(!_.isUndefined(false), 'false is defined'); assert.notOk(_.isUndefined(false), 'false is defined');
assert.ok(!_.isUndefined(NaN), 'NaN is defined'); assert.notOk(_.isUndefined(NaN), 'NaN is defined');
assert.ok(_.isUndefined(), 'nothing is undefined'); assert.ok(_.isUndefined(), 'nothing is undefined');
assert.ok(_.isUndefined(void 0), 'undefined is undefined'); assert.ok(_.isUndefined(void 0), 'undefined is undefined');
}); });
QUnit.test('isError', function(assert) { QUnit.test('isError', function(assert) {
assert.ok(!_.isError(1), 'numbers are not Errors'); assert.notOk(_.isError(1), 'numbers are not Errors');
assert.ok(!_.isError(null), 'null is not an Error'); assert.notOk(_.isError(null), 'null is not an Error');
assert.ok(!_.isError(Error), 'functions are not Errors'); assert.notOk(_.isError(Error), 'functions are not Errors');
assert.ok(_.isError(new Error()), 'Errors are Errors'); assert.ok(_.isError(new Error()), 'Errors are Errors');
assert.ok(_.isError(new EvalError()), 'EvalErrors are Errors'); assert.ok(_.isError(new EvalError()), 'EvalErrors are Errors');
assert.ok(_.isError(new RangeError()), 'RangeErrors are Errors'); assert.ok(_.isError(new RangeError()), 'RangeErrors are Errors');
@@ -893,13 +896,13 @@
QUnit.test('has', function(assert) { QUnit.test('has', function(assert) {
var obj = {foo: 'bar', func: function(){}}; var obj = {foo: 'bar', func: function(){}};
assert.ok(_.has(obj, 'foo'), 'has() checks that the object has a property.'); assert.ok(_.has(obj, 'foo'), 'has() checks that the object has a property.');
assert.ok(!_.has(obj, 'baz'), "has() returns false if the object doesn't have the property."); assert.notOk(_.has(obj, 'baz'), "has() returns false if the object doesn't have the property.");
assert.ok(_.has(obj, 'func'), 'has() works for functions too.'); assert.ok(_.has(obj, 'func'), 'has() works for functions too.');
obj.hasOwnProperty = null; obj.hasOwnProperty = null;
assert.ok(_.has(obj, 'foo'), 'has() works even when the hasOwnProperty method is deleted.'); assert.ok(_.has(obj, 'foo'), 'has() works even when the hasOwnProperty method is deleted.');
var child = {}; var child = {};
child.prototype = obj; child.prototype = obj;
assert.ok(!_.has(child, 'foo'), 'has() does not check the prototype chain for a property.'); assert.notOk(_.has(child, 'foo'), 'has() does not check the prototype chain for a property.');
assert.strictEqual(_.has(null, 'foo'), false, 'has() returns false for null'); assert.strictEqual(_.has(null, 'foo'), false, 'has() returns false for null');
assert.strictEqual(_.has(void 0, 'foo'), false, 'has() returns false for undefined'); assert.strictEqual(_.has(void 0, 'foo'), false, 'has() returns false for undefined');
}); });
@@ -958,8 +961,8 @@
assert.equal(_.matcher({})(null), true, 'Empty spec called with null object returns true'); assert.equal(_.matcher({})(null), true, 'Empty spec called with null object returns true');
assert.equal(_.matcher({a: 1})(null), false, 'Non-empty spec called with null object returns false'); assert.equal(_.matcher({a: 1})(null), false, 'Non-empty spec called with null object returns false');
assert.ok(_.find(stooges, _.matcher({hair: false})) === curly, 'returns a predicate that can be used by finding functions.'); assert.strictEqual(_.find(stooges, _.matcher({hair: false})), curly, 'returns a predicate that can be used by finding functions.');
assert.ok(_.find(stooges, _.matcher(moe)) === moe, 'can be used to locate an object exists in a collection.'); assert.strictEqual(_.find(stooges, _.matcher(moe)), moe, 'can be used to locate an object exists in a collection.');
assert.deepEqual(_.filter([null, void 0], _.matcher({a: 1})), [], 'Do not throw on null values.'); assert.deepEqual(_.filter([null, void 0], _.matcher({a: 1})), [], 'Do not throw on null values.');
assert.deepEqual(_.filter([null, void 0], _.matcher(null)), [null, void 0], 'null matches null'); assert.deepEqual(_.filter([null, void 0], _.matcher(null)), [null, void 0], 'null matches null');

View File

@@ -52,8 +52,8 @@
QUnit.test('#750 - Return _ instance.', function(assert) { QUnit.test('#750 - Return _ instance.', function(assert) {
assert.expect(2); assert.expect(2);
var instance = _([]); var instance = _([]);
assert.ok(_(instance) === instance); assert.strictEqual(_(instance), instance);
assert.ok(new _(instance) === instance); assert.strictEqual(new _(instance), instance);
}); });
QUnit.test('identity', function(assert) { QUnit.test('identity', function(assert) {
@@ -137,11 +137,12 @@
}); });
QUnit.test('mixin', function(assert) { QUnit.test('mixin', function(assert) {
_.mixin({ var ret = _.mixin({
myReverse: function(string) { myReverse: function(string) {
return string.split('').reverse().join(''); return string.split('').reverse().join('');
} }
}); });
assert.equal(ret, _, 'returns the _ object to facilitate chaining');
assert.equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); assert.equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _');
assert.equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); assert.equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper');
}); });
@@ -188,7 +189,7 @@
var str = 'some string & another string & yet another'; var str = 'some string & another string & yet another';
var escaped = _.escape(str); var escaped = _.escape(str);
assert.ok(escaped.indexOf('&') !== -1, 'handles & aka &amp;'); assert.notStrictEqual(escaped.indexOf('&'), -1, 'handles & aka &amp;');
assert.equal(_.unescape(str), str, 'can unescape &amp;'); assert.equal(_.unescape(str), str, 'can unescape &amp;');
}); });
@@ -370,9 +371,9 @@
}); });
QUnit.test('#547 - _.templateSettings is unchanged by custom settings.', function(assert) { QUnit.test('#547 - _.templateSettings is unchanged by custom settings.', function(assert) {
assert.ok(!_.templateSettings.variable); assert.notOk(_.templateSettings.variable);
_.template('', {}, {variable: 'x'}); _.template('', {}, {variable: 'x'});
assert.ok(!_.templateSettings.variable); assert.notOk(_.templateSettings.variable);
}); });
QUnit.test('#556 - undefined template variables.', function(assert) { QUnit.test('#556 - undefined template variables.', function(assert) {
@@ -397,11 +398,11 @@
assert.expect(2); assert.expect(2);
var count = 0; var count = 0;
var template = _.template('<%= f() %>'); var template = _.template('<%= f() %>');
template({f: function(){ assert.ok(!count++); }}); template({f: function(){ assert.notOk(count++); }});
var countEscaped = 0; var countEscaped = 0;
var templateEscaped = _.template('<%- f() %>'); var templateEscaped = _.template('<%- f() %>');
templateEscaped({f: function(){ assert.ok(!countEscaped++); }}); templateEscaped({f: function(){ assert.notOk(countEscaped++); }});
}); });
QUnit.test('#746 - _.template settings are not modified.', function(assert) { QUnit.test('#746 - _.template settings are not modified.', function(assert) {

View File

@@ -84,18 +84,23 @@
}; };
}; };
var builtinIteratee;
// An internal function to generate callbacks that can be applied to each // An internal function to generate callbacks that can be applied to each
// element in a collection, returning the desired result — either `identity`, // element in a collection, returning the desired result — either `identity`,
// an arbitrary callback, a property matcher, or a property accessor. // an arbitrary callback, a property matcher, or a property accessor.
var cb = function(value, context, argCount) { var cb = function(value, context, argCount) {
if (_.iteratee !== builtinIteratee) return _.iteratee(value, context);
if (value == null) return _.identity; if (value == null) return _.identity;
if (_.isFunction(value)) return optimizeCb(value, context, argCount); if (_.isFunction(value)) return optimizeCb(value, context, argCount);
if (_.isObject(value)) return _.matcher(value); if (_.isObject(value)) return _.matcher(value);
return _.property(value); return _.property(value);
}; };
// An external wrapper for the internal callback generator. // External wrapper for our callback generator. Users may customize
_.iteratee = function(value, context) { // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
// This abstraction hides the internal-only argCount argument.
_.iteratee = builtinIteratee = function(value, context) {
return cb(value, context, Infinity); return cb(value, context, Infinity);
}; };
@@ -439,7 +444,7 @@
// Keep surrogate pair characters together // Keep surrogate pair characters together
return obj.match(reStrSymbol); return obj.match(reStrSymbol);
} }
if (isArrayLike(obj)) return _.map(obj); if (isArrayLike(obj)) return _.map(obj, _.identity);
return _.values(obj); return _.values(obj);
}; };
@@ -462,7 +467,7 @@
// values in the array. Aliased as `head` and `take`. The **guard** check // values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`. // allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) { _.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0; if (array == null || array.length < 1) return void 0;
if (n == null || guard) return array[0]; if (n == null || guard) return array[0];
return _.initial(array, array.length - n); return _.initial(array, array.length - n);
}; };
@@ -477,7 +482,7 @@
// Get the last element of an array. Passing **n** will return the last N // Get the last element of an array. Passing **n** will return the last N
// values in the array. // values in the array.
_.last = function(array, n, guard) { _.last = function(array, n, guard) {
if (array == null) return void 0; if (array == null || array.length < 1) return void 0;
if (n == null || guard) return array[array.length - 1]; if (n == null || guard) return array[array.length - 1];
return _.rest(array, Math.max(0, array.length - n)); return _.rest(array, Math.max(0, array.length - n));
}; };
@@ -491,7 +496,7 @@
// Trim out all falsy values from an array. // Trim out all falsy values from an array.
_.compact = function(array) { _.compact = function(array) {
return _.filter(array); return _.filter(array, Boolean);
}; };
// Internal implementation of a recursive `flatten` function. // Internal implementation of a recursive `flatten` function.
@@ -1094,7 +1099,7 @@
return result; return result;
}); });
// Return a copy of the object without the blacklisted properties. // Return a copy of the object without the blacklisted properties.
_.omit = restArgs(function(obj, keys) { _.omit = restArgs(function(obj, keys) {
var iteratee = keys[0], context; var iteratee = keys[0], context;
if (_.isFunction(iteratee)) { if (_.isFunction(iteratee)) {
@@ -1403,7 +1408,7 @@
return new Date().getTime(); return new Date().getTime();
}; };
// List of HTML entities for escaping. // List of HTML entities for escaping.
var escapeMap = { var escapeMap = {
'&': '&amp;', '&': '&amp;',
'<': '&lt;', '<': '&lt;',
@@ -1568,6 +1573,7 @@
return chainResult(this, func.apply(_, args)); return chainResult(this, func.apply(_, args));
}; };
}); });
return _;
}; };
// Add all of the Underscore functions to the wrapper object. // Add all of the Underscore functions to the wrapper object.
@@ -1602,7 +1608,7 @@
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
_.prototype.toString = function() { _.prototype.toString = function() {
return '' + this._wrapped; return String(this._wrapped);
}; };
// AMD registration happens at the end for compatibility with AMD loaders // AMD registration happens at the end for compatibility with AMD loaders