Compare commits

...

1018 Commits

Author SHA1 Message Date
John-David Dalton
941ffee2d3 Bump to v4.14.2. 2016-08-07 21:46:32 -07:00
John-David Dalton
0a71f3372f Rebuild lodash and docs. 2016-08-07 20:56:55 -07:00
John-David Dalton
f817f68487 Update docdown to 0.7.1. 2016-08-07 16:07:06 -07:00
John-David Dalton
826975f392 Add trailing newline to generated docs. 2016-08-07 14:40:28 -07:00
John-David Dalton
5f244d3c31 Remove em elements from code blocks. 2016-08-07 14:14:23 -07:00
John-David Dalton
71be34859f Wrap doc site in raw tags. 2016-08-07 13:55:38 -07:00
John-David Dalton
f9a4705c9c Add node_modules to travis cache. 2016-08-06 23:01:52 -07:00
John-David Dalton
a546842792 Upgrade travis to phantom.js v2. 2016-08-06 20:38:08 -07:00
John-David Dalton
ba86e20179 Fix IE 9 test fails. 2016-08-06 20:08:43 -07:00
John-David Dalton
b32fc6f6e6 Minor function/method nit. [ci skip] 2016-08-06 17:15:54 -07:00
John-David Dalton
1f13a34687 Add nativeKeysIn and cleanup object coercion. 2016-08-06 17:07:45 -07:00
John-David Dalton
f212b4850d Update links to ecma-262/7.0. [ci skip] 2016-08-04 21:54:03 -07:00
John-David Dalton
1b4555afb6 Restructure keys methods. 2016-08-04 21:53:55 -07:00
John-David Dalton
358013c67e Cleanup overArg description. [ci skip] 2016-08-04 09:40:01 -07:00
John-David Dalton
a98667ca05 Remove old JIT and engine bug guards. 2016-08-03 22:06:03 -07:00
John-David Dalton
02e9f4c333 Simplify _.isEmpty. 2016-08-03 21:42:52 -07:00
John-David Dalton
d7951db01b Fix test fail in es builds. 2016-08-03 17:22:20 -07:00
John-David Dalton
21fba2df9f Reduce deps of _.initial and _.tail. 2016-08-03 13:04:10 -07:00
John-David Dalton
a4947139a6 Overwrite primitives in paths of set methods. [closes #2558] 2016-08-03 10:48:22 -07:00
John-David Dalton
c01e7580cd Avoid error in Edge accessing localStorage when loading tests via the file: protocol. 2016-08-03 08:34:40 -07:00
John-David Dalton
8b4f22ed75 Update marky-markdown wrapping fix. 2016-08-02 12:07:06 -07:00
John-David Dalton
669b76bf99 Update marky-markdown. 2016-08-02 00:16:07 -07:00
Greenkeeper
efee02ace7 Update docdown to 0.7.0. 2016-08-01 20:20:31 -07:00
John-David Dalton
cd8adf5611 Minor doc formatting nits. [ci skip] 2016-08-01 17:28:22 -07:00
John-David Dalton
d216106b88 Add private tag to unexposed functions. [ci skip] 2016-08-01 17:25:16 -07:00
John-David Dalton
6dd8fb12ad Ensure fp.nthArg returns a curried function. 2016-08-01 16:55:12 -07:00
John-David Dalton
a4999575d0 Cleanup npm link creation. 2016-08-01 14:39:37 -07:00
John-David Dalton
fcaff8ff28 Update timeout related doc type tags. [closes #2553] [ci skip] 2016-08-01 08:53:30 -07:00
John-David Dalton
cf0b3e3212 Update docdown options. 2016-07-31 22:16:11 -07:00
John-David Dalton
bccb4150fd Add _.every doc note on matching empty collections. [ci skip] 2016-07-31 16:32:55 -07:00
John-David Dalton
9a297b0eb5 Cleanup partial comparison notes. [ci skip] 2016-07-31 16:32:08 -07:00
Dan J Miller
9c4baf7645 Clarify how comparison with empty sources is handled by _.matches, _.isMatch and _.matchesProperty. (#2548) 2016-07-31 00:54:48 -07:00
John-David Dalton
73b2f20509 Use lodash-doc-globals. 2016-07-30 23:48:17 -07:00
John-David Dalton
642690e692 Fix failing amd test. 2016-07-30 12:10:46 -07:00
John-David Dalton
1468c74c36 Make doubley sure Date.now, clearTimeout, and setTimeout are mockable. 2016-07-30 12:10:46 -07:00
Greenkeeper
0bfa1ec2d0 Update lodash to 4.14.1. 2016-07-30 12:10:46 -07:00
John-David Dalton
7c74464d7a Remove prepublish hook because we don’ publish this branch. [ci skip] 2016-07-30 12:10:46 -07:00
John-David Dalton
de051ac1ac Increment package version to enable ci tests. 2016-07-30 12:10:46 -07:00
John-David Dalton
ba0c4c413d Bump to v4.14.1. 2016-07-29 00:40:38 -07:00
John-David Dalton
7e6f5ef4f5 Rebuild lodash and docs. 2016-07-29 00:40:38 -07:00
John-David Dalton
712eeb009f Add missing semicolon. [ci skip] 2016-07-29 00:40:38 -07:00
Johannes Scharlach
b54e28deb7 Prevent failing circular reference detection. (#2543) 2016-07-28 23:12:53 -07:00
John-David Dalton
1f44cebac3 Update coveralls to 2.11.12. 2016-07-28 23:12:53 -07:00
John-David Dalton
9c05e8392b Add stack.delete for other in equalArrays and equalObjects. 2016-07-28 23:12:53 -07:00
John-David Dalton
9a67fec48a Remove stack.delete from baseMergeDeep. 2016-07-28 23:12:53 -07:00
John-David Dalton
1966ac7979 Prevent failed circular reference detection in _.defaultsDeep. [closes #2537] 2016-07-28 23:12:53 -07:00
John-David Dalton
8b624217c5 Cleanup _.debounce and _.throttle docs. [ci skip] 2016-07-28 23:12:53 -07:00
John-David Dalton
40499af9b9 Fix freeModule typo. 2016-07-28 23:12:53 -07:00
John-David Dalton
b3bd359a0d Use stubArray for easier readability. 2016-07-28 23:12:52 -07:00
John-David Dalton
de07e3f874 Add keys methods tests for array-like values. 2016-07-28 23:12:52 -07:00
John-David Dalton
c7e8953b68 Cleanup array-like tests. 2016-07-28 23:12:52 -07:00
John-David Dalton
80e7fe4bf9 Remove freeGlobal prerequisite for freeExports. [closes #2527] 2016-07-28 23:12:52 -07:00
John-David Dalton
2bc199d7fc Move method equivalence notes. [ci skip] 2016-07-28 23:12:52 -07:00
John-David Dalton
9b710d8e81 Use _.toFinite in random and range methods. 2016-07-28 23:12:52 -07:00
John-David Dalton
cc6a0ee98d Minor .gitignore cleanup. 2016-07-28 23:12:52 -07:00
Brad Buchanan
c9492d79a1 Document behavior of _.debounce when wait is 0 (#2530)
Clarify that when `leading` is false a debounced method with `wait=0` will not invoke immediately, but on the next tick (like `setTimeout`), but when `leading` is true the invocation will be immediate.
2016-07-28 23:12:52 -07:00
Brad Buchanan
94c4719c0d Fix missing semicolon (#2529)
I started on a documentation change but `npm run validate` after my initial pull revealed this linting error:

```
> jscs lodash.js

requireSemicolons: Missing semicolon after statement at lodash.js :
  5864 |    function isFlattenable(value) {
  5865 |      return isArray(value) || isArguments(value) ||
  5866 |        !!(spreadableSymbol && value && value[spreadableSymbol])
-----------------------------------------------------------------------^
  5867 |    }
  5868 |
```
2016-07-28 23:12:51 -07:00
John-David Dalton
c253e8d7b8 Ensure paths with consecutive empty brackets or dots are parsed correctly. 2016-07-28 23:12:51 -07:00
John-David Dalton
98f12fb8e1 Update qunitjs to 2.0.1. 2016-07-28 23:12:51 -07:00
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
John-David Dalton
40ac55acb6 Bump to v4.13.1. 2016-05-23 08:58:01 -07:00
John-David Dalton
42c639d252 Rebuild lodash and docs. 2016-05-23 08:57:55 -07:00
John-David Dalton
d110b64ee4 Ensure _.find and _.findLast pass the correct key param to predicate. [closes #2367] 2016-05-23 08:47:43 -07:00
John-David Dalton
a2617d810c Add failing tests for #2367. 2016-05-23 08:47:24 -07:00
John-David Dalton
90d07bc04c Simplify isMaskable assignment. 2016-05-22 22:11:15 -07:00
John-David Dalton
013d9db86f Bump to v4.13.0. 2016-05-22 19:30:21 -07:00
John-David Dalton
9d4d725bc7 Rebuild lodash and docs. 2016-05-22 19:30:13 -07:00
John-David Dalton
9881cc9e10 Add fp.unionBy, fp.unionWith, fp.uniqWith, fp.xorBy, and fp.xorWith tests. 2016-05-22 19:28:32 -07:00
John-David Dalton
01474fed0b Add fp.intersectionBy and fp.intersectionWith tests. 2016-05-22 19:06:32 -07:00
John-David Dalton
024e6d8ae8 Add fp.differenceBy and fp.differenceWith tests. 2016-05-22 19:05:54 -07:00
John-David Dalton
607ba653f7 Update doc examples and tests for _.difference, _.intersection, _.union, _.uniq, and _.xor methods. 2016-05-22 19:04:32 -07:00
John-David Dalton
9090c1904f Add _.property shorthand note to _.countBy docs. [ci skip] 2016-05-22 19:04:31 -07:00
John-David Dalton
158b762367 Split up "mutation" and "with" method tests. 2016-05-22 01:08:26 -07:00
John-David Dalton
e8b3b2dc31 Use isEven in _.remove test. 2016-05-22 01:08:26 -07:00
John-David Dalton
5d72eec742 Reorg find tests. 2016-05-22 01:08:26 -07:00
John-David Dalton
6fe020c920 Add fp.findFrom and fp.findLastFrom tests. 2016-05-22 01:08:26 -07:00
John-David Dalton
40c5a6af49 Remove without from skipRearg mapping. [closes #2365] 2016-05-21 14:26:54 -07:00
John-David Dalton
803dce242b Update sortedIndex method doc examples. [ci skip] 2016-05-21 11:57:02 -07:00
John-David Dalton
4ed722ccd8 Prefer array use for doc examples of params that accept arrays. [ci skip] 2016-05-21 11:57:02 -07:00
John-David Dalton
f35d479d5e Update jquery to 2.2.4 and webpack to 1.13.1. 2016-05-20 21:52:55 -07:00
John-David Dalton
f3af61de97 Use stubs in mask functions. 2016-05-20 21:32:03 -07:00
John-David Dalton
077fb89083 Simplify getNative. 2016-05-20 21:32:03 -07:00
John-David Dalton
d4d4390846 Use _.stubFalse in _.isBuffer. 2016-05-20 21:32:03 -07:00
John-David Dalton
33e54546fe Make stub functions hoistable. 2016-05-20 21:31:58 -07:00
John-David Dalton
bf008e0680 Add fp methodRearg mappings for set "with" and "by" methods. [closes #2359] 2016-05-20 10:36:18 -07:00
John-David Dalton
08694bd709 Fix markdown-doctest run. 2016-05-20 09:00:45 -07:00
John-David Dalton
91242440fc Should not ignore empty brackes and dots. 2016-05-20 08:42:03 -07:00
John-David Dalton
68ae6fc212 Ensure round methods don't return NaN for large precision values. 2016-05-20 08:15:24 -07:00
John-David Dalton
14a16c2a7a Remove unnecessary doctrine fixes. 2016-05-19 22:18:51 -07:00
John-David Dalton
9cbb50d3a6 Remove unnecessary defineProperty guards. 2016-05-19 21:36:29 -07:00
John-David Dalton
47635b9978 Assign setTimeout to itself to avoid leak detection. 2016-05-19 21:35:44 -07:00
John-David Dalton
f90c3f2483 Ensure _.pullAll works with the same value for array and values. [closes #2356] 2016-05-19 19:47:20 -07:00
John-David Dalton
5a67ecc142 Use setProperty to mock setTimeout to avoid global leak fails in older browsers. 2016-05-19 16:15:53 -07:00
John-David Dalton
a542f8ab54 Remove clearTimeout use. 2016-05-19 13:52:18 -07:00
John-David Dalton
f32349db7d Skip setTimout mock test in PhantomJS. 2016-05-19 13:39:36 -07:00
John-David Dalton
32f5db3f72 Fix failing _.delay test. 2016-05-19 13:39:36 -07:00
John-David Dalton
670e3983b4 Cleanup _.delay and _.defer tests. 2016-05-19 13:39:35 -07:00
John-David Dalton
e1cc4d8552 Add mock Date.now and setTimeout tests. 2016-05-19 13:39:31 -07:00
John-David Dalton
8422bb37b0 Group clearTimeout and setTimeout. 2016-05-19 08:28:49 -07:00
Arend van Beelen jr
ebf9b64062 Little doc correction for _.endsWith(). (#2355) 2016-05-19 08:01:17 -07:00
John-David Dalton
56b397b506 Simplify _.conforms doc example. [ci skip] 2016-05-18 17:40:12 -07:00
John-David Dalton
de6cc79ac8 Shorten _.defer doc comment. [ci skip] 2016-05-18 17:39:37 -07:00
John-David Dalton
d28395fdb9 Replace toPairs with keys in getMatchData. 2016-05-18 14:51:54 -07:00
John-David Dalton
84b8ee7bda Allow clearTimeout, setTimeout, and Date.now to be mocked. 2016-05-18 13:50:07 -07:00
John-David Dalton
b56c732332 Cleanup fp.findFrom and fp.indexOfFrom tests. 2016-05-18 00:31:25 -07:00
John-David Dalton
041c1b4586 Simplify find tests expected. 2016-05-17 23:23:53 -07:00
John-David Dalton
0edc480d17 Increment package version to enable ci tests. 2016-05-17 13:14:20 -07:00
John-David Dalton
1a3bcb4ebd Add _.findLast tests for fromIndex values. 2016-05-17 00:52:38 -07:00
John-David Dalton
7d8c2a84b7 Cleanup up from fromIndex and length test labels. 2016-05-17 00:52:25 -07:00
John-David Dalton
4faac431c4 Make _.debounce and _.throttle tests align on dummy args. 2016-05-16 18:34:10 -07:00
John-David Dalton
df9ded3282 Fix _.throttle test for system time of 0. 2016-05-16 18:33:36 -07:00
John-David Dalton
1fe8d1679e Add nullish guards to private methods used by lodash-webpack-plugin. 2016-05-16 18:31:33 -07:00
John-David Dalton
708505f2b1 Minor doc note fixes. [ci skip] 2016-05-16 18:31:02 -07:00
John-David Dalton
b2da5ee1a7 Add backticks to error message. [ci skip] 2016-05-16 18:30:12 -07:00
John-David Dalton
315e751f43 Add _.isNative doc note. [ci skip] 2016-05-16 18:29:30 -07:00
John-David Dalton
dc5544223f Use new operator when throwing an error for consistency. 2016-05-16 15:56:03 -07:00
John-David Dalton
c14728d31a More test cleanup. 2016-05-16 13:35:05 -07:00
John-David Dalton
7d4b154866 Use consistent results var name in debounce & throttle tests. 2016-05-16 10:47:27 -07:00
John-David Dalton
b69647a0c3 Add isModularize check for _.throttle test for system time of 0. 2016-05-16 10:37:00 -07:00
John-David Dalton
d054442e2c Cleanup date mocks. 2016-05-16 10:31:20 -07:00
John-David Dalton
e50bf1fb44 Add _.throttle test for a system time of 0. 2016-05-16 08:38:20 -07:00
John-David Dalton
d40b6a75da Test label cleanup for find methods. 2016-05-16 08:17:15 -07:00
John-David Dalton
e124e7fb5f Init lastCallTime as undefined to avoid issues when the sytem time is 0. [closes #2342] 2016-05-16 01:00:26 -07:00
John-David Dalton
7c3a163f9c Add back _.includes test for strings with a fromIndex. 2016-05-15 22:29:32 -07:00
John-David Dalton
03af0791aa Remove dead code from tests. 2016-05-15 21:46:33 -07:00
John-David Dalton
464885a539 Add getValue helper. 2016-05-15 20:57:10 -07:00
John-David Dalton
346579ac7a Add interopRequire test helper. 2016-05-15 15:48:52 -07:00
John-David Dalton
76ed206e9b Make _.isNative throw if core-js is detected. 2016-05-15 15:48:47 -07:00
John-David Dalton
06e7c963ef Combine _.find and _.includes tests for fromIndex. 2016-05-14 23:16:38 -07:00
John-David Dalton
573d902026 Simplify umd and exports. 2016-05-14 13:11:58 -07:00
John-David Dalton
66cdfe5896 Update markdown-doctest to 0.6.0. 2016-05-13 20:04:36 -07:00
John-David Dalton
9afd4659c7 Add fake source key detection. 2016-05-13 20:03:13 -07:00
John-David Dalton
7249217600 Add "findFrom" methods to fp dep mappings. 2016-05-12 22:44:26 -07:00
John-David Dalton
2f20c672e0 Update _.times doc example to not duplicate _.stubTrue. [ci skip] 2016-05-12 16:29:16 -07:00
John-David Dalton
6d02a64c47 Add fromIndex param to _.find and _.findLast. 2016-05-12 16:19:35 -07:00
Jeroen Engels
3d078383cb Add findIndexFrom, findLastIndexFrom, indexOfFrom, & lastIndexOfFrom in FP. 2016-05-12 15:08:05 -07:00
John-David Dalton
64e765bf7a Fix _.stubFalse doc example typo. [ci skip] 2016-05-12 13:57:14 -07:00
John-David Dalton
b5b6125730 Minor space nit. [ci skip] 2016-05-12 13:54:56 -07:00
John-David Dalton
e45984f6b8 Add npm prepublish hook. 2016-05-12 07:59:42 -07:00
John-David Dalton
a95cf1c26c Rename mock to stub. 2016-05-12 07:53:34 -07:00
Greenkeeper
4a19913726 Update markdown-doctest to 0.5.0. 2016-05-12 06:37:23 -07:00
John-David Dalton
52ae769bfa Add default accumulator note to _.transform docs. [ci skip] 2016-05-11 22:11:08 -07:00
John-David Dalton
44d7c3887d Rename test helper prop to resolve. 2016-05-11 00:28:36 -07:00
John-David Dalton
315271996c Cleanup _.constant tests. 2016-05-11 00:28:36 -07:00
John-David Dalton
2357704540 Add _.mockArray, _.mockFalse, _.mockObject, _.mockString, and _.mockTrue. 2016-05-11 00:28:31 -07:00
John-David Dalton
262049f737 Remove extraneous _.toPath examples. [ci skip] 2016-05-10 23:33:27 -07:00
John-David Dalton
04d6e351a6 Add fromIndex param to _.findIndex and _.findLastIndex. 2016-05-10 23:33:21 -07:00
Greenkeeper
9fa86ec712 Update ecstatic to 1.4.1. 2016-05-10 19:09:47 -07:00
John-David Dalton
901e3dcff2 Flip "n" and "index" in _.nth and _.nthArg docs. [ci skip] 2016-05-08 16:50:38 -07:00
John-David Dalton
43fffe3200 Bump to v4.12.0. 2016-05-07 22:02:47 -07:00
John-David Dalton
1123e13072 Rebuild lodash and docs. 2016-05-07 22:02:40 -07:00
John-David Dalton
996636d25b Update lodash dep. 2016-05-07 19:31:52 -07:00
John-David Dalton
8864095bab Update firefox version in sauce. 2016-05-07 19:31:52 -07:00
John-David Dalton
def9f5d84a Fix doc typo for _.toPairsIn. [closes #2314] 2016-05-07 10:07:10 -07:00
John-David Dalton
47d024ae7b Use "index" instead of "nth". [closes #2313] [ci skip] 2016-05-07 06:55:24 -07:00
John-David Dalton
05135ca171 Update chrome version in sauce. 2016-05-06 22:58:22 -07:00
John-David Dalton
ca1f22a7c6 Ensure trailing function sources aren't skipping for _.assign, _.assignIn, _.defaults, & _.merge. [closes #2311] 2016-05-06 21:24:57 -07:00
John-David Dalton
9a461a5e48 Add _.toFinite. 2016-05-04 21:09:28 -07:00
John-David Dalton
73e7bab839 Add tooling section. [ci skip] 2016-05-04 17:17:14 -07:00
John-David Dalton
572060aedc Update fp description. [ci skip] 2016-05-04 17:17:01 -07:00
John-David Dalton
f1b63d41f8 Fix test fails for npm package builds. 2016-05-02 21:34:19 -07:00
John-David Dalton
9ee423edcf Add _.toPairs test for sets. 2016-05-02 21:04:00 -07:00
John-David Dalton
70c8651182 Use consistent b values. 2016-05-02 21:03:13 -07:00
John-David Dalton
2b54f23dad Add more stack tests. 2016-05-02 20:17:41 -07:00
John-David Dalton
67ef2bb008 Cleanup customizer test labels. 2016-05-02 20:17:13 -07:00
John-David Dalton
f2b5e58500 Minor hyphen nit. 2016-05-02 19:42:33 -07:00
John-David Dalton
b8fa0d9b29 Add large stack test to other cache tests. 2016-05-02 19:42:23 -07:00
John-David Dalton
264d68dec9 Add support for sets to _.toPairs methods. 2016-05-02 16:53:17 -07:00
John-David Dalton
71f5264ee1 Cleanup returns tags. [ci skip] 2016-05-02 16:51:59 -07:00
John-David Dalton
ce8a1feb94 Avoid paving modified lodash for coverage runs in travis. 2016-05-02 13:31:03 -07:00
John-David Dalton
05c32044e9 Remove extraneous isArrayLikeObject check from isFlattenable. 2016-05-02 13:08:51 -07:00
John-David Dalton
44927be6e2 Drop version from license header. [ci skip] 2016-05-02 10:52:53 -07:00
John-David Dalton
d1779d6cdd Fix phantomjs test fails. 2016-05-02 10:01:17 -07:00
John-David Dalton
a13d640bcc Test internal caches instead of cache modules. 2016-05-02 08:51:44 -07:00
John-David Dalton
c7d4106f66 Add private tags back to map methods. [ci skip] 2016-05-02 07:15:32 -07:00
John-David Dalton
2e59faad8f Fix module paths. 2016-05-02 00:34:58 -07:00
John-David Dalton
6d70b64b2e Ensure module tests ran for coverage. 2016-05-02 00:00:19 -07:00
John-David Dalton
767f9c6bce Simplify module assignment. 2016-05-01 23:37:13 -07:00
John-David Dalton
edd7c2f0b1 Cleanup travis tests. 2016-05-01 23:24:30 -07:00
John-David Dalton
b9cfd31bd5 Add modular build to coverage tests. 2016-05-01 21:00:58 -07:00
John-David Dalton
6883f99141 Add tests for map caches. 2016-05-01 19:12:03 -07:00
John-David Dalton
c2aee218d2 Add promise case to code removal for coverage run. 2016-05-01 19:11:49 -07:00
Greenkeeper
8e44d73705 Update markdown-doctest to 0.4.0. 2016-05-01 19:10:44 -07:00
Anders D. Johnson
9e30cc4542 Fix docs typo space after sentence in _.merge. 2016-05-01 19:09:18 -07:00
John-David Dalton
963e2c23b0 Upgrade to qunit-extras 2.0. 2016-04-30 11:59:06 -07:00
Jeroen Engels
7ee4bf8d02 Remove duplicate method from FP mapping. 2016-04-30 10:43:42 -07:00
John-David Dalton
c3c6bc9666 Cleanup markdown-doctest-setup. 2016-04-29 11:57:41 -07:00
Nick Johnstone
ef1024bb60 Test documentation with markdown-doctest. 2016-04-29 10:32:43 -07:00
John-David Dalton
6c6e1c2be3 Use array and iteratee. [ci skip] 2016-04-28 22:08:28 -07:00
John-David Dalton
e9a08ba9a9 Use https for Alex's blog. [ci skip] 2016-04-28 21:30:22 -07:00
John-David Dalton
59546b9989 Update conduct link in contributing text. [ci skip] 2016-04-28 21:26:46 -07:00
John-David Dalton
816edcce2e Rename getPlaceholder to getHolder. 2016-04-28 14:55:25 -07:00
Greenkeeper
8accfb3372 Update fs-extra to 0.30.0. 2016-04-28 10:56:16 -07:00
John-David Dalton
da146a9afd Add map doc note to _.toPairs and _.toPairsIn. [ci skip] 2016-04-28 10:56:15 -07:00
John-David Dalton
cbcd5ffdc4 Add node_js v6 to travis. 2016-04-27 08:04:33 -07:00
Clinton Montague
6f600ebeac Add _.flip bitmask value to createWrapper documentation. [ci skip] 2016-04-26 16:58:50 -07:00
John-David Dalton
9aa456f26f Use lodashStable.toArray in more places. 2016-04-25 00:04:33 -07:00
John-David Dalton
dc77d7605d Add _.toArray tests for maps. 2016-04-24 23:56:22 -07:00
John-David Dalton
f7c4410f41 Add support for converting maps to _.toPairs and _.toPairsIn. 2016-04-24 23:56:00 -07:00
John-David Dalton
9fa0ec00b8 Remove unneeded var assignment. 2016-04-23 11:43:15 -07:00
John-David Dalton
0125ff7303 Cleanup fp test labels and args tests. 2016-04-23 11:31:14 -07:00
John-David Dalton
fbc91cf7ae Add iteratee arity hints to forEach methods. [closes #2277] 2016-04-23 11:29:52 -07:00
John-David Dalton
43c26b5d6f Ensure matches methods match arrays with duplicate values. [closes #2270] 2016-04-22 23:02:54 -07:00
John-David Dalton
4e38f70e0e Update cache implementations. 2016-04-22 23:02:46 -07:00
John-David Dalton
e2c86dac63 Ensure fp.update does not convert end of path to an object. [closes #2271] 2016-04-22 08:46:35 -07:00
John-David Dalton
aebc0650f8 Simplify _.concat. 2016-04-22 08:32:19 -07:00
John-David Dalton
44cf971405 Bump to v4.11.2. 2016-04-21 08:29:44 -07:00
John-David Dalton
c0d7418054 Rebuild lodash and docs. 2016-04-21 08:29:44 -07:00
John-David Dalton
a0db54b53f Add tests for _.sortedIndex with nulls and symbols. 2016-04-21 08:29:44 -07:00
John-David Dalton
32b813e42b Ensure sortedIndex methods align with sortBy for symbols. 2016-04-21 06:56:07 -07:00
John-David Dalton
3c144b8601 Ensure _.sortBy moves symbols to the end. 2016-04-21 01:01:00 -07:00
John-David Dalton
076e4e6db5 Add math operator method tests for objects. 2016-04-21 01:00:59 -07:00
John-David Dalton
2ea08ccd36 Add math operator method tests for symbols. 2016-04-21 00:44:56 -07:00
John-David Dalton
fc48518f2b Move toKey from baseProperty to property. 2016-04-20 18:12:16 -07:00
John-David Dalton
594c3b3406 Update @see tags. [ci skip] 2016-04-20 17:25:04 -07:00
John-David Dalton
38edd713e4 Ensure punctuation is not treated as words. [closes #2268] 2016-04-20 16:23:46 -07:00
John-David Dalton
6987d70dc2 Only avoid converting -0 to 0 if comparator is provided. 2016-04-20 16:05:21 -07:00
John-David Dalton
0e4b307585 Update full build kb. [ci skip] 2016-04-20 07:49:45 -07:00
John-David Dalton
c81bbe95c6 Use an anchor title. [ci skip] 2016-04-20 07:49:44 -07:00
John-David Dalton
b21a87b50f Fix createSet feature test for Safari 8. 2016-04-20 07:49:44 -07:00
John-David Dalton
e3566eb1ce Use Set only if it coerces -0 correctly. 2016-04-20 01:24:00 -07:00
John-David Dalton
0429434dbb Ensure -0 is treated as 0. 2016-04-20 00:51:25 -07:00
John-David Dalton
80f35ee713 Add _.uniq tests for -0. 2016-04-20 00:25:31 -07:00
John-David Dalton
224595c837 Move links to the top of the readme. 2016-04-19 23:59:20 -07:00
John-David Dalton
61ace9a24b Remove code of conduct doc. 2016-04-19 23:59:14 -07:00
John-David Dalton
8c630ede7e Cleanup package.json. 2016-04-19 23:07:06 -07:00
John-David Dalton
ca3b583695 Add wrapped values tests. 2016-04-19 17:42:46 -07:00
John-David Dalton
c2cbb06d57 Add _.difference and _.intersection tests for -0. 2016-04-19 16:57:41 -07:00
John-David Dalton
f6bf8d2e6d Cleanup -0 tests. 2016-04-19 12:38:00 -07:00
John-David Dalton
60c89b2754 Add _.invoke test for -0 key. 2016-04-19 12:37:47 -07:00
John-David Dalton
b72fba911d Cleanup wrapper resets and add assert for returning function object values. 2016-04-19 11:26:55 -07:00
John-David Dalton
3930c388e4 Fix Safari 9.0 flaky test fail. 2016-04-19 10:23:03 -07:00
John-David Dalton
ddf5ef0839 Add even more -0 tests. 2016-04-19 08:24:33 -07:00
John-David Dalton
c66947405b Add omit and pick tests for -0 keys. 2016-04-19 00:24:09 -07:00
John-David Dalton
ad27b62343 Add tests for -0 keys. 2016-04-19 00:23:16 -07:00
John-David Dalton
5283b0f407 Use _.startCase. 2016-04-18 22:30:24 -07:00
John-David Dalton
af41f9267a Add test for combining enclosing circle backslash. 2016-04-18 22:03:56 -07:00
John-David Dalton
6e8c984250 Use toKey in more functions. 2016-04-18 21:33:32 -07:00
John-David Dalton
c2e018b2ac Avoid rate limiting by Sauce. 2016-04-18 21:23:09 -07:00
John-David Dalton
a47ce3cf13 Simplify building lodash. 2016-04-18 20:56:58 -07:00
John-David Dalton
ba58f35f37 Add arguments object test for values methods. 2016-04-18 17:48:26 -07:00
Greenkeeper
30fd1693ee Update fs-extra to 0.28.0. 2016-04-18 08:30:33 -07:00
John-David Dalton
161c17ce7f Consolidate returns in trim methods. 2016-04-17 21:55:43 -07:00
John-David Dalton
27dfe542bd Use baseToString in _.truncate. 2016-04-17 07:18:39 -07:00
John-David Dalton
353113f17f Start to add @see tags. [ci skip] 2016-04-16 21:48:22 -07:00
John-David Dalton
762e858c48 Use isSymbol instead of baseToNumber to fix _.toNumber test fails. 2016-04-16 20:45:10 -07:00
John-David Dalton
db49702046 Remove unsafe_comps uglify option to fix minified builds. 2016-04-16 20:16:38 -07:00
John-David Dalton
7239bf791f Comma nit in _.inRange doc. [ci skip] 2016-04-16 18:16:27 -07:00
John-David Dalton
9cb75cae1d Add jsdocs for baseToNumber and baseToString. 2016-04-16 18:00:31 -07:00
John-David Dalton
fdb4cf1208 Use baseToString in more places and refactor isIndex and isKeyable. 2016-04-16 07:32:06 -07:00
John-David Dalton
714cf7b18c Add baseGt, baseLt, baseToNumber, baseToString, and createRelationalOperation. 2016-04-15 07:17:48 -07:00
John-David Dalton
1a1e0e1a6b Ensure _.pullAt sorts indexes greater than 9 correctly. [closes #2254] 2016-04-15 07:17:48 -07:00
John-David Dalton
f6c14ec31f Add jscs "disallowUnusedVariables" rule. 2016-04-15 07:17:48 -07:00
John-David Dalton
da7f413f6f Update jscs to 3.0.1 and fs-extra to 0.27.0. 2016-04-15 07:17:34 -07:00
John-David Dalton
3cf28953a7 Update code of conduct to point to the jQuery Foundation's policy. [ci skip] 2016-04-14 11:11:08 -07:00
John-David Dalton
080b761f7f Update export doc note. [ci skip] 2016-04-14 08:37:19 -07:00
John-David Dalton
7f6ad484ec Bump to v4.11.1. 2016-04-13 22:09:00 -07:00
John-David Dalton
391a930d49 Rebuild lodash and docs. 2016-04-13 22:09:00 -07:00
John-David Dalton
a532773703 Cleanup debounce and throttle tests. 2016-04-13 22:08:55 -07:00
John-David Dalton
49f8aa4289 Fix failing debounce test. 2016-04-13 18:17:07 -07:00
ben robbins
44b9b085c0 Add test for _.debounce with a wait of 0. 2016-04-13 18:16:50 -07:00
John-David Dalton
a447353977 Add pluck fp alias of map. 2016-04-13 14:22:40 -07:00
John-David Dalton
dea6ccbf43 Bump to v4.11.0. 2016-04-13 09:57:13 -07:00
John-David Dalton
0c4d8836e7 Rebuild lodash and docs. 2016-04-13 09:57:03 -07:00
Jeroen Engels
ef67e07732 Fix doc nits for _.nth. [ci skip] 2016-04-13 09:52:37 -07:00
John-David Dalton
7e885a4ddd Add _.words unit test for contractions. 2016-04-13 08:21:17 -07:00
John-David Dalton
a3c1f42708 Add _.nth and _.nthArg tests. 2016-04-13 01:09:12 -07:00
John-David Dalton
d3ef5a3acb Use noop instead of alwaysUndefined. 2016-04-13 01:09:12 -07:00
John-David Dalton
5098d63a22 Update qunit to 1.23.1. 2016-04-12 22:38:49 -07:00
John-David Dalton
4275a73170 Add support for contractions to case methods. 2016-04-12 21:48:52 -07:00
John-David Dalton
78a157d675 Move _.map test order around. 2016-04-12 21:48:52 -07:00
John-David Dalton
97a437e8e6 Return implicit undefined. 2016-04-12 10:02:24 -07:00
John-David Dalton
3c37f290a8 Add unwrapped chain test for nth. 2016-04-12 09:38:22 -07:00
John-David Dalton
dcd5d470e0 Use baseUnary to avoid passing incorrect arity hints to baseIteratee. 2016-04-12 08:27:41 -07:00
John-David Dalton
b424f3b60f Ensure fp.over doesn't cap its iteratee args. 2016-04-12 08:14:04 -07:00
John-David Dalton
201ea9a9f0 Add shorthand tests for sortBy and over methods. 2016-04-11 22:46:38 -07:00
John-David Dalton
2469af6c3f Add _.nth. 2016-04-11 22:46:33 -07:00
John-David Dalton
bfe6e06b5a Ensure _.sortBy works with the matchesProperty shorthand. 2016-04-11 17:38:03 -07:00
John-David Dalton
091b5fbe30 Make _.head avoid accessing array when its length is 0. 2016-04-11 17:34:49 -07:00
John-David Dalton
93168e6018 Use references to String#replace and String#split. 2016-04-11 17:29:22 -07:00
John-David Dalton
16ed081818 Absorb copyObjectWith into copyObject. 2016-04-11 17:28:19 -07:00
John-David Dalton
c38b4b29cf Avoid unnecessary array cloning in createRecurryWrapper and mergeData. 2016-04-11 17:27:04 -07:00
John-David Dalton
a20b88d114 Bump to v4.10.0. 2016-04-10 22:44:04 -07:00
John-David Dalton
87912a3b3f Rebuild lodash and docs. 2016-04-10 22:42:52 -07:00
John-David Dalton
53bde1238c Replace "invoking" with "and invokes". [ci skip] 2016-04-10 22:40:38 -07:00
John-David Dalton
fd365c27e2 Add doc comments to the minify file util. [ci skip] 2016-04-10 22:40:38 -07:00
John-David Dalton
4f43841699 Add doc comments to the common file util. [ci skip] 2016-04-10 22:40:38 -07:00
John-David Dalton
e60e97c03f Ensure _.debounce queues a trailing call after maxWait. [closes #2229] 2016-04-10 20:50:51 -07:00
Greenkeeper
e619f8ca83 Update webpack to 1.12.15. 2016-04-10 20:02:01 -07:00
John-David Dalton
cf2f538167 Add castSlice and rename cast related helpers. 2016-04-09 13:57:45 -07:00
John-David Dalton
17e1a6dbe8 Ensure _.slice handles a limit of 0 in Node 0.10. 2016-04-09 00:53:07 -07:00
John-David Dalton
74f6af8686 Update fp aliases. 2016-04-08 17:59:18 -07:00
John-David Dalton
351236f526 Rearrange regexp vars. 2016-04-08 16:32:15 -07:00
John-David Dalton
51ad056710 Remove redundant param descriptions. [ci skip] 2016-04-08 15:04:07 -07:00
John-David Dalton
6512b7f925 Update "over" method iteratee descriptions. [ci skip] 2016-04-08 15:03:06 -07:00
John-David Dalton
c7264e3f1f Add isIterateeCall check to _.split. 2016-04-08 11:03:18 -07:00
John-David Dalton
349ec35c48 Add flow test for handling an empty array. 2016-04-08 11:03:18 -07:00
John-David Dalton
057dd5b0a8 Minor escapeRegExp test nit. 2016-04-08 11:03:18 -07:00
John-David Dalton
f6ac7cb1a1 Shorten chars string coersion. 2016-04-08 11:03:18 -07:00
John-David Dalton
c1958daf65 Update handling of limit to the current es6 draft. 2016-04-08 11:03:10 -07:00
John-David Dalton
ee73c9b436 Bump to v4.9.0. 2016-04-08 02:07:13 -07:00
John-David Dalton
fac5e727e6 Rebuild lodash and docs. 2016-04-08 02:07:13 -07:00
John-David Dalton
977264f55b Fix split test fails across enviros. 2016-04-08 02:07:13 -07:00
John-David Dalton
e776e679af Ensure _.split works with emojis. 2016-04-08 01:20:49 -07:00
John-David Dalton
23901dfd45 Update docdown. 2016-04-07 21:43:33 -07:00
John-David Dalton
87444e1a45 Add sumBy tests. 2016-04-07 21:43:33 -07:00
John-David Dalton
dc63bc2bd9 Fix dynamic test labels for groups of methods. 2016-04-07 21:43:33 -07:00
John-David Dalton
f4ff4f29b1 Simplify toSource. 2016-04-07 21:43:32 -07:00
John-David Dalton
06412d5f12 Remove Hash use from Uglify options because it breaks it. 2016-04-07 21:43:32 -07:00
John-David Dalton
bbc84903a7 Update istanbul to 0.4.3. 2016-04-07 21:43:32 -07:00
John-David Dalton
e014592ea0 Fix typo in Hash descripton. [ci skip] 2016-04-07 21:43:32 -07:00
John-David Dalton
4305ffde18 Add commas. [ci skip] 2016-04-07 21:43:32 -07:00
John-David Dalton
0588dcb3e9 Add Hash util and split out file helper. 2016-04-07 21:43:27 -07:00
John-David Dalton
58afd8c364 Update debounce article links. [ci skip] 2016-04-06 14:10:56 -07:00
John-David Dalton
e120d63ee2 Add doc note about group ordering of _.groupBy. [ci skip] [closes #2212] 2016-04-06 07:59:05 -07:00
John-David Dalton
d7f43eba6a Make exceptions to fp argument ordering stand out. [ci skip] 2016-04-05 23:53:05 -07:00
John-David Dalton
786a92669e Update chaining note. [ci skip] 2016-04-05 23:53:05 -07:00
John-David Dalton
504aead673 Add placeholders section. [ci skip] 2016-04-05 23:52:49 -07:00
John-David Dalton
8c72ffc583 Add more fp browser usage examples. [ci skip] 2016-04-05 23:50:18 -07:00
John-David Dalton
27d3311b6a Don't spell out two hundred. [ci skip] 2016-04-05 23:50:18 -07:00
John-David Dalton
5e2f113d50 Update vendor/backbone to v1.3.3. 2016-04-05 23:50:18 -07:00
Greenkeeper
55e7b8764e Update jquery to 2.2.3. 2016-04-05 23:50:18 -07:00
John-David Dalton
513c0ae64d Update list of fp methods with spread arguments. [ci skip] 2016-04-05 23:50:17 -07:00
John-David Dalton
f0f6a1e382 Simplify deep path doc examples. [ci skip] 2016-04-05 08:44:14 -07:00
John-David Dalton
6f3fb587e2 Simplify deep property tests. 2016-04-05 08:39:09 -07:00
John-David Dalton
083c5b703a Add _.matchesProperty test for matching undefined values of nested objects. 2016-04-05 08:23:34 -07:00
John-David Dalton
3583c56067 Replace double quotes with ticks. [ci skip] 2016-04-05 08:08:31 -07:00
John-David Dalton
9999199d2b Enable over methods to accept matchesProperty shorthands. 2016-04-05 08:06:44 -07:00
John-David Dalton
c084e358bd Bump to v4.8.2. 2016-04-04 15:48:17 -07:00
John-David Dalton
238d45a2cb Rebuild lodash and docs. 2016-04-04 15:48:17 -07:00
John-David Dalton
21d056c470 Break code comments up to display better in the wiki. [ci skip] 2016-04-04 15:48:16 -07:00
John-David Dalton
0308d4de62 Remove skipFixed methods from fixed arity listings. [ci skip] 2016-04-04 11:47:52 -07:00
John-David Dalton
f2a6f6ce6a Update lodash dev dep. 2016-04-04 11:47:52 -07:00
John-David Dalton
cf5d6b5bc8 Revert #2193. 2016-04-04 11:47:46 -07:00
John-David Dalton
7a6b64b2f6 Bump to v4.8.1. 2016-04-04 11:43:03 -07:00
John-David Dalton
bca11bd21e Rebuild lodash and docs. 2016-04-04 11:42:50 -07:00
John-David Dalton
bf39a31907 Fix typo in _falseOptions.jst. 2016-04-04 08:51:04 -07:00
John-David Dalton
792bfbb604 Bump to v4.8.0. 2016-04-03 23:47:26 -07:00
John-David Dalton
1ef96896d5 Rebuild lodash and docs. 2016-04-03 23:47:26 -07:00
John-David Dalton
2293de07a7 Add _falseOptions module. 2016-04-03 23:47:26 -07:00
John-David Dalton
804ad3d805 Move private key higher. [ci skip] 2016-04-03 22:44:28 -07:00
John-David Dalton
c797f83ca5 Add fp convert test for unconverted methods. 2016-04-03 21:55:30 -07:00
John-David Dalton
a71ac53fa7 Add jsdoc comments to fp/_baseConvert. [ci skip] 2016-04-03 21:55:30 -07:00
John-David Dalton
7165ef6f5e Minor doc tweak to _.rearg. [ci skip] 2016-04-03 21:55:30 -07:00
John-David Dalton
c01e0cd7d1 Simplify references to partial or provided arguments. [ci skip] 2016-04-03 21:55:30 -07:00
John-David Dalton
a5990a4c4e Use thru instead of through in docs. [ci skip] 2016-04-03 21:55:30 -07:00
John-David Dalton
75d196b01b Allow convert to work on methods that aren't converted by default. 2016-04-03 21:55:08 -07:00
John-David Dalton
69ce7cde7d Convert methods not found in aryMethod mapping. 2016-04-02 22:49:17 -07:00
John-David Dalton
6861734010 Add matchesStrictComparable helper. 2016-04-02 14:49:25 -07:00
John-David Dalton
0f75d967d0 Add convert method to modules that pass thru. 2016-04-02 14:19:19 -07:00
John-David Dalton
012bff97e0 Add fp/placeholder module. 2016-04-02 14:19:13 -07:00
John-David Dalton
2b58525816 Update many es5 spec links to es6. [ci skip] 2016-04-02 10:33:13 -07:00
John-David Dalton
579cf00d10 Update _.isNaN doc note with a reference to Number.isNaN. [ci skip] 2016-04-02 08:02:36 -07:00
John-David Dalton
cfd25cec75 Minor Lodash letter case nit in readme. [ci skip] 2016-04-02 08:01:35 -07:00
John-David Dalton
c267c4e06b Excuse Underscore _.chunk test. 2016-04-01 20:56:19 -07:00
John-David Dalton
c4a78445b3 Add _.isNative test for Promise. 2016-04-01 19:17:52 -07:00
John-David Dalton
4c8836a24a Cleanup _.isNative. 2016-04-01 19:06:36 -07:00
John-David Dalton
972624297b Add variation to falsey _.slice test. 2016-04-01 18:18:37 -07:00
John-David Dalton
ebf9904e8a Add toSource helper. 2016-04-01 18:18:37 -07:00
John-David Dalton
64652c263f Update _.map doc note on guarded methods. [ci skip] 2016-04-01 18:18:37 -07:00
John-David Dalton
58f93567fc Make _.sampleSize default n to 1 instead of 0. 2016-04-01 18:18:37 -07:00
John-David Dalton
f599c4817a Make _.chunk default size to 1 instead of 0. 2016-04-01 18:18:36 -07:00
John-David Dalton
930b034da5 Make _.repeat default n to 1 instead of 0. 2016-04-01 18:18:36 -07:00
John-David Dalton
c21174f7f9 Add bizarro test for _.isEmpty. 2016-04-01 18:18:36 -07:00
John-David Dalton
e22be612e2 Remove dataViewCtorString branch of getTag for coverage tests. 2016-04-01 18:18:36 -07:00
Craig Martin
669bc1520e Run scripts synchronous in foreground. 2016-04-01 18:18:27 -07:00
John-David Dalton
b257bb9c9e Allow over, overEvery, and overSome to accept matchesProperty shorthands. [closes #2193] 2016-04-01 09:14:13 -07:00
John-David Dalton
b8096df6d8 Fix leaked var. 2016-04-01 09:13:54 -07:00
greenkeeperio-bot
43d530ead9 Update dojo to 1.11.1. 2016-04-01 09:10:36 -07:00
John-David Dalton
9dbd665d05 Space nit in _.toNumber. [ci skip] 2016-04-01 09:10:36 -07:00
John-David Dalton
3902fd1a67 Ensure has treats nested sparse arrays consistently. 2016-04-01 09:10:35 -07:00
John-David Dalton
642d248f99 Cleanup deep property tests of has methods. 2016-04-01 09:10:35 -07:00
John-David Dalton
8bd9a4d2c3 Ensure _.has returns false for nullish objects. [closes #2190] 2016-04-01 09:10:24 -07:00
John-David Dalton
e96ee69f1c Remove rogue comment delimiter from fp wiki template. [ci skip] 2016-04-01 09:10:24 -07:00
John-David Dalton
5bb899a700 Add array path examples to _.set and _.unset docs. [ci skip] 2016-04-01 09:10:24 -07:00
John-David Dalton
431e0fa2f6 Add line number to error message in web worker. 2016-04-01 09:10:24 -07:00
John-David Dalton
ec92292c38 Wrap funcToString call in _.isNative in a try-catch. 2016-04-01 09:10:24 -07:00
Oskar Segersvärd
45953b2ac1 Set the jsdoc type of apply's args parameter to Array. [ci skip] 2016-04-01 09:10:24 -07:00
John-David Dalton
d9f93d0895 Increment package version to enable ci tests. 2016-04-01 09:10:24 -07:00
John-David Dalton
252ea445ca Bump to v4.7.0. 2016-03-31 00:51:19 -07:00
John-David Dalton
9826d9bd46 Rebuild lodash and docs. 2016-03-31 00:51:19 -07:00
John-David Dalton
b53f178c46 Sort reargs and aliases in fp wiki template. 2016-03-31 00:51:19 -07:00
John-David Dalton
5ad5eb8f5d Add divide and multiply to lodash doc block. [ci skip] 2016-03-31 00:28:04 -07:00
John-David Dalton
7add87739a Add _.concat test for shallow cloning array. 2016-03-30 23:32:21 -07:00
John-David Dalton
2cd12c38e3 Temporarily remove ghooks. 2016-03-30 21:27:19 -07:00
Jordan Eldredge
ad72b5b565 Simplify _.result. 2016-03-30 19:52:46 -07:00
Craig Martin
608e74a111 Ensure all background jobs finish before continuing. 2016-03-30 19:50:23 -07:00
John-David Dalton
c36d0af5cd Avoid a JIT bug in Safari 9 for baseIteratee. 2016-03-30 19:50:13 -07:00
John-David Dalton
55c3299d5c Use getIteratee in more places. 2016-03-30 12:17:28 -07:00
greenkeeperio-bot
7a3dda6105 Update ghooks to 1.1.1. 2016-03-30 08:43:30 -07:00
John-David Dalton
171d9eab78 Use copyArray in concat. 2016-03-30 08:43:30 -07:00
John-David Dalton
ab9d2056da Add bindKey to fp aryMethod mapping. 2016-03-30 08:43:30 -07:00
John-David Dalton
4310329971 Add bind and bindKey to fp skipRearg mapping. 2016-03-30 08:43:30 -07:00
John-David Dalton
d038315f61 Add link to github reactions. [ci skip] 2016-03-30 00:54:28 -07:00
John-David Dalton
c0f91c9169 Minor newline nits. 2016-03-29 22:51:25 -07:00
John-David Dalton
519a02ff34 Update fred ages in doc examples. [ci skip] 2016-03-29 22:33:43 -07:00
John-David Dalton
643ce1da74 Revert createPadding behavior for chars that coerce to empty strings. 2016-03-29 22:23:00 -07:00
greenkeeperio-bot
4c789197f9 Update chalk to 1.1.3 and opt-cli to 1.4.0. 2016-03-29 22:22:12 -07:00
John-David Dalton
277c9bdc7c Make shouldInvoke explicitly return true if it's the first call. 2016-03-29 09:53:35 -07:00
John-David Dalton
455eace9c5 Cleanup _.debounce tests. 2016-03-29 00:28:43 -07:00
John-David Dalton
f263a87983 Update excused Underscore tests. 2016-03-28 22:11:56 -07:00
John-David Dalton
4f92fb7007 Ensure cancel resets lastCallTime and lastInvokeTime. 2016-03-28 21:06:11 -07:00
John-David Dalton
4fd43f7fe7 Minor value consistency nits. 2016-03-28 19:27:55 -07:00
John-David Dalton
3fe2efa311 Ensure _.concat cases wraps nullish array values in an array. 2016-03-28 17:44:13 -07:00
John-David Dalton
a7bf3352df Ensure _.concat casts non-array array values to arrays. 2016-03-28 12:34:09 -07:00
John-David Dalton
2ddd893ca2 Update vendor/underscore. 2016-03-28 09:35:41 -07:00
John-David Dalton
5d92b37550 Add updateWith to lodash sequence doc note. [ci skip] 2016-03-28 09:26:03 -07:00
John-David Dalton
dcec882262 Ensure _.words detects compound words where an all caps word is next to a capitalized word. [closes #2163] 2016-03-28 07:57:37 -07:00
John-David Dalton
de53132692 Add args param doc for _.attempt. [closes #2164] [ci skip] 2016-03-28 07:05:08 -07:00
greenkeeperio-bot
23a7871e2d Update docdown to 0.5.0. 2016-03-27 16:32:20 -07:00
John-David Dalton
792347978a Add shim path back to _.isEmpty. 2016-03-27 13:35:14 -07:00
John-David Dalton
61c740a4eb Move isObjectLike condition up in _.isEmpty. 2016-03-27 13:07:28 -07:00
John-David Dalton
c3a614858b Add support for maps and sets to _.isEmpty. [closes #2159] 2016-03-27 13:04:51 -07:00
John-David Dalton
75727d073b More pad optimizations. 2016-03-27 12:37:09 -07:00
John-David Dalton
b1d7450052 Fix typo in pad test label. 2016-03-27 12:31:14 -07:00
John-David Dalton
60e557b059 Reduce lines creeping over 80 characters in length. 2016-03-27 11:43:44 -07:00
John-David Dalton
071e13363c Add "Array" to predicate types. [ci skip] [closes #2157] 2016-03-27 09:59:48 -07:00
John-David Dalton
acf4651c0e Minor newline nit. [ci skip] 2016-03-27 09:59:37 -07:00
John-David Dalton
9b15dc2017 Fix fail in PhantomJS. 2016-03-27 01:23:58 -07:00
John-David Dalton
f4f0791e0c Fix fail in Node 0.10. 2016-03-27 01:23:58 -07:00
John-David Dalton
654976c826 Add DataView support to getTag. 2016-03-27 01:23:58 -07:00
John-David Dalton
50e86c70bd Add other realm tests for comparing array views with _.isEqual. 2016-03-27 01:23:58 -07:00
Dan Levy
d135b846db Adding support for cloning and comparing DataView. 2016-03-27 01:23:58 -07:00
John-David Dalton
ee2153364d Add bizarro Promise test. 2016-03-27 01:23:58 -07:00
John-David Dalton
6d76cdc1b7 Update snippet removals for coverage runs. 2016-03-27 01:23:52 -07:00
John-David Dalton
259bdb6151 Add realm tests for maps, promises, and sets. 2016-03-26 14:09:36 -07:00
John-David Dalton
12438fa0d7 Ensure _.isEqual compares promises by reference. 2016-03-26 13:59:53 -07:00
John-David Dalton
654df6f7f8 Optimize createPadding for the common case. 2016-03-26 13:21:54 -07:00
John-David Dalton
0dfe176fe6 Make pad methods default to a chars of " " if chars is an empty string. 2016-03-26 12:14:02 -07:00
John-David Dalton
0f3338013e Update sauce browsers. 2016-03-25 19:03:47 -07:00
John-David Dalton
dcc239b070 Add falsey iteratee tests. 2016-03-25 16:36:47 -07:00
John-David Dalton
613488eaf8 Use in instead of relying on behavior. 2016-03-25 15:50:49 -07:00
John-David Dalton
97193b9680 Update vendor/backbone. 2016-03-25 14:14:52 -07:00
greenkeeperio-bot
71c0861675 Update opt-cli to 1.3.0, coveralls to 2.11.9, & qunitjs to 1.23.0. 2016-03-25 14:13:42 -07:00
John-David Dalton
f3b35919ef Add baseMean helper. 2016-03-25 14:13:42 -07:00
Tucker Whitehouse
06316f1d47 Add _.meanBy. 2016-03-24 21:41:41 -07:00
Federico De Giuli
271f64ee3f Make _.isEmpty work as expected on buffers. 2016-03-24 21:41:41 -07:00
Kent C. Dodds
583b03ba5f Add git hook instructions to CONTRIBUTING.md. [ci skip] 2016-03-24 21:41:35 -07:00
John-David Dalton
16e2c06ab4 Remove dead code from baseClone. 2016-03-24 10:54:23 -07:00
John-David Dalton
016de80ce7 Add debounce/throttle test for calling cancel and flush without anything queued. 2016-03-24 10:54:23 -07:00
John-David Dalton
577226bbd0 Add number object tests to number coercion methods. 2016-03-24 10:54:23 -07:00
John-David Dalton
1670800df3 Add test for crawling functions with _.result. 2016-03-24 10:54:23 -07:00
Kent C. Dodds
9674d67693 add opt-in githook to config 2016-03-23 10:18:57 -06:00
John-David Dalton
f65d36b3c1 Make _.result resolve values of functions as it deep crawls over them. 2016-03-23 00:44:36 -07:00
John-David Dalton
8d93455076 Add more options docs. [ci skip] 2016-03-22 22:26:34 -07:00
John-David Dalton
cfe5ea264d Remove parens from default options value doc of _.truncate. [ci skip] 2016-03-22 08:44:23 -07:00
John-David Dalton
9a4e11f6f7 Add chars param fix to postprocess. [ci skip] 2016-03-21 22:11:40 -07:00
John-David Dalton
24cef1a919 Add other realm maps/sets tests for _.size. 2016-03-21 21:00:29 -07:00
John-David Dalton
5fe373f7aa Add support for deep cloning maps and sets. 2016-03-21 21:00:19 -07:00
John-David Dalton
25eb4df563 Add support for maps and sets to _.size. 2016-03-21 20:16:15 -07:00
John-David Dalton
6d587bdf34 Add -0 test for math operator methods. 2016-03-21 20:04:46 -07:00
John-David Dalton
03dd9df78e Remove unneeded assert in indexOf test. 2016-03-21 08:46:23 -07:00
greenkeeperio-bot
96c60bab46 Update dojo to 1.11.0. 2016-03-21 00:44:32 -07:00
John-David Dalton
811341efa1 Add code examples to fp wiki. [ci skip] 2016-03-20 14:18:24 -07:00
John-David Dalton
5f94723d7f Add always fp alias. 2016-03-20 11:53:38 -07:00
John-David Dalton
9d1536799b Add complement fp alias. 2016-03-20 11:43:32 -07:00
John-David Dalton
85057d588c Move "Chaining" section lower. [ci skip] 2016-03-20 11:40:34 -07:00
John-David Dalton
234e693d92 Flip priority of "object" and "collection" in _.isEmpty doc description. [ci skip] 2016-03-20 11:29:22 -07:00
John-David Dalton
51833b91d0 Add invertObj and juxt fp aliases. 2016-03-20 11:23:12 -07:00
John-David Dalton
dfb7a4c078 Don't make without an alias so it can be reverted with convert. 2016-03-20 11:16:18 -07:00
John-David Dalton
04ddaf49f5 Organize aliases. 2016-03-20 11:13:24 -07:00
John-David Dalton
b7a6560d90 Add identical fp alias. 2016-03-20 11:13:06 -07:00
John-David Dalton
7d8531d6ed Add _.divide and _.multiply tests. 2016-03-20 11:03:29 -07:00
John-David Dalton
ab77d9d83a Add more math operation method tests. 2016-03-20 10:16:03 -07:00
John-David Dalton
37454b8f42 Add eq and isEqual to fp skipRearg mapping. 2016-03-20 10:02:46 -07:00
John-David Dalton
ef95f165ff Fix npm build tests. 2016-03-20 01:10:23 -07:00
John-David Dalton
6494a072d2 Fix test fails in Safari. 2016-03-20 01:02:53 -07:00
John-David Dalton
984bcc556e Add fp.isMatchWith test. 2016-03-20 00:26:58 -07:00
John-David Dalton
be77e7366c Remove "with" methods from iterateeAry mapping. 2016-03-19 23:43:11 -07:00
John-David Dalton
01d961bad8 Ensure fp.isEqualWith rearg is (c,a,b). [closes #2131] 2016-03-19 23:40:14 -07:00
John-David Dalton
6eb0cb1565 Add _.divide and _.multiply. 2016-03-19 23:01:40 -07:00
John-David Dalton
b2bff1ad45 Ensure array sequence methods don't error for falsey values. 2016-03-19 22:51:32 -07:00
John-David Dalton
6ed9c005d7 Make fp.invokeArgs and fp.invokeArgsMap arg signature (b,c,a). 2016-03-18 08:29:41 -07:00
John-David Dalton
6ef8693bf0 Update case examples. 2016-03-17 21:11:32 -07:00
John-David Dalton
8c5025f935 Move upperFirst definition lower. 2016-03-17 21:11:32 -07:00
John-David Dalton
9735961090 Ensure _.startCase only uppercases the first character of each word. 2016-03-17 21:11:32 -07:00
greenkeeperio-bot
8d7058e6ad Update fs-extra to 0.26.7, jquery to 2.2.2, & requirejs to 2.2.0. 2016-03-17 21:10:36 -07:00
John-David Dalton
4d89d9a1b7 Add fp.convert to "Convert" section. 2016-03-17 21:10:36 -07:00
John-David Dalton
594f414b1a Move the "Convert" section to the bottom. 2016-03-17 21:10:36 -07:00
John-David Dalton
b61d30da1a Make fp.without an alias of fp.difference. [closes #2122] 2016-03-17 21:10:36 -07:00
John-David Dalton
412e19006b Fix fp aliases for all, any, and anyPass. 2016-03-17 21:10:36 -07:00
Jeroen Engels
b8ebceadaf Add missing param for _.reverse. [ci skip] 2016-03-17 21:10:36 -07:00
John-David Dalton
2b4f271899 Add fp.invokeArgsMap. 2016-03-17 21:10:36 -07:00
John-David Dalton
c83857c42a Minor non- nits. [ci skip] 2016-03-15 08:38:55 -07:00
John-David Dalton
b95d1d6123 Ensure _.mergeWith sources are cloned when customizer returns undefiend. [closes #2111] 2016-03-15 08:32:23 -07:00
John-David Dalton
7d1d7d909a Add fp padChars methods. 2016-03-14 22:17:46 -07:00
John-David Dalton
c89a80357c Cleanup fp convert tests. 2016-03-14 22:16:20 -07:00
John-David Dalton
1bbb24fa0c Add fp.convert. 2016-03-14 10:53:40 -07:00
John-David Dalton
dd0aa991ff Add since tag to _.isArray. [ci skip] 2016-03-13 19:59:50 -07:00
John-David Dalton
6f9b1b1822 Simplify _.method example. [ci skip] 2016-03-13 16:35:52 -07:00
John-David Dalton
65fd579ed2 Add fp.invokeArgs. 2016-03-13 16:34:07 -07:00
John-David Dalton
f3279b7ee1 Wrap fp.getOr test in an IIFE. 2016-03-13 15:30:32 -07:00
John-David Dalton
4d185ae7b5 Add fp.restFrom and fp.spreadFrom. 2016-03-13 15:30:01 -07:00
John-David Dalton
81ee5d76b8 Use "sequence" to descript chaining in more places. [ci skip] 2016-03-13 14:49:28 -07:00
John-David Dalton
8bed7137c7 Add chaining note to fp wiki template. [ci skip] 2016-03-13 14:44:58 -07:00
libreninja
f8bcc5b917 Break before unnecessary string concats in _.repeat. 2016-03-13 12:39:05 -07:00
John-David Dalton
81f8518d15 Simplify assocIndexOf description. [ci skip] 2016-03-12 09:01:06 -08:00
John-David Dalton
f88d27ccda Fix param descriptions for assocDelete, mapSet, and stackSet. [ci skip] 2016-03-11 20:00:08 -08:00
John-David Dalton
40ed92d2af More _.debounce cleanup. 2016-03-11 08:04:39 -08:00
John-David Dalton
c7319d004d Add non-function constructor tests for _.isMap, _.isSet, and _.isWeakMap. 2016-03-10 16:33:29 -08:00
John-David Dalton
51a3c5d4e8 Cleanup _.debounce. 2016-03-10 07:59:31 -08:00
John-David Dalton
ecfa002a05 Update Edge testing in Sauce. 2016-03-09 16:55:34 -08:00
John-David Dalton
62962791b3 Rename debounce helper to invokeFunc to fix builds. 2016-03-08 06:58:39 -08:00
Brandon Wallace
864e14cb20 Refactor debounce to simplify, reduce timers, fix bugs. 2016-03-07 22:24:04 -08:00
John-David Dalton
092f90d2fc Cleanup sorting test results. 2016-03-07 08:11:59 -08:00
John-David Dalton
49b33d667d Add toPairs test for inherited string keyed properties. 2016-03-07 08:04:11 -08:00
John-David Dalton
63b097329c Minor curried label nits. [ci skip] 2016-03-07 07:41:18 -08:00
John-David Dalton
2c3ab276ea Add _.entries and _.entriesIn aliases. 2016-03-06 22:56:48 -08:00
John-David Dalton
c30c43d69e Add more since tags. [ci skip] 2016-03-06 22:12:42 -08:00
John-David Dalton
230c18d5d6 Add fp.flatMapDepth test. 2016-03-06 19:13:43 -08:00
John-David Dalton
c16e64cd36 Remove unneeded flatMap lazy chaining tests. 2016-03-06 19:12:47 -08:00
John-David Dalton
64704e16c1 Add _.flatMapDeep and _.flatMapDepth. 2016-03-06 11:15:04 -08:00
greenkeeperio-bot
b41103ee6b Update glob to 7.0.3. 2016-03-05 18:35:22 -08:00
John-David Dalton
8ac1d54858 Add fast path for numbers in _.toNumber. 2016-03-05 16:56:59 -08:00
John-David Dalton
0a9af2968e Add primitives tests. 2016-03-05 16:54:37 -08:00
John-David Dalton
7eba5a2221 Ensure _.toNumber works with symbol objects without a valueOf method. 2016-03-05 16:16:49 -08:00
John-David Dalton
19a8b3886e Flip assignment order for consistency. [ci skip] 2016-03-05 08:43:42 -08:00
John-David Dalton
03716f62e8 Remove runInContext call in convert. 2016-03-05 08:39:00 -08:00
John-David Dalton
d38000bc33 Minor format nit for baseCastPath. [ci skip] 2016-03-05 08:38:34 -08:00
John-David Dalton
a6c88a173b Ensure _.toPath returns a new array. 2016-03-04 18:02:28 -08:00
John-David Dalton
0bad210dec Add tests for number coercion methods. 2016-03-04 18:00:05 -08:00
John-David Dalton
62cc7574fc Remove dead code branch from baseCastPath. 2016-03-04 10:41:09 -08:00
John-David Dalton
f5a134bcbd Remove unused baseForIn. 2016-03-04 10:37:29 -08:00
John-David Dalton
a7bb6b5383 Add getPrototype helper. 2016-03-04 09:17:00 -08:00
John-David Dalton
e02ce1ea8b Ensure _.toPath works with symbols. 2016-03-04 08:09:39 -08:00
John-David Dalton
760a00b82f Make a distinction between property names and identifiers. [ci skip] 2016-03-04 07:51:12 -08:00
John-David Dalton
e6929e801b Add getAllKeysIn helper. 2016-03-04 07:50:40 -08:00
John-David Dalton
8682da4962 Update V8 bug links. [ci skip] 2016-03-04 07:33:32 -08:00
John-David Dalton
8e6f3e48d0 Ensure getOwnPropertySymbols is passed an object to avoid errors in V8. 2016-03-04 07:33:16 -08:00
John-David Dalton
0589dd6909 Ensure _.omit works with symbols. 2016-03-04 02:03:23 -08:00
John-David Dalton
1b8071d2c4 Replace Dojo Foundation references with jQuery Foundation in contributing.md. [ci skip] 2016-03-04 01:24:43 -08:00
John-David Dalton
4debf155d7 Update and add tests for fp convert method. 2016-03-04 00:55:59 -08:00
John-David Dalton
f6df126c43 Cleanup license urls. 2016-03-03 22:58:41 -08:00
Esa-Matti Suuronen
c406e33fcc Add reconvert method to fp functions. 2016-03-03 22:47:30 -08:00
John-David Dalton
9e11ebb62a Ensure _.isPlainObject returns false for objects with a custom [[Prototype]]. [closes #2085] 2016-03-03 22:46:23 -08:00
John-David Dalton
16ed42b188 Add tests for symbol paths. 2016-03-03 22:42:58 -08:00
John-David Dalton
a19890469e Minor format nit. 2016-03-03 22:42:29 -08:00
John-David Dalton
cc1c1c127e Cleanup path test labels. 2016-03-03 22:41:56 -08:00
John-David Dalton
3c1e95a3c2 Cleanup foo references. 2016-03-03 22:41:22 -08:00
John-David Dalton
d4c0777d2c Minor format nits for Foo test functions. 2016-03-03 20:40:20 -08:00
John-David Dalton
8f00000676 Minor format nit of isIterateeCall. 2016-03-03 20:07:10 -08:00
John-David Dalton
4240f737d1 Add symbol support to baseCastPath, isKey, and toNumber. 2016-03-03 20:04:37 -08:00
John-David Dalton
25121a86bb Specify string keyed properties. [closes #2081] [ci skip] 2016-03-03 18:02:47 -08:00
John-David Dalton
e4b3cde0a4 Memoize stringToPath. 2016-03-03 15:58:23 -08:00
Dave Methvin
cf74ebeb71 Update license to the jQuery Foundation. [ci skip] 2016-03-03 12:03:26 -08:00
Jeroen Engels
d682357189 Add @since to the method jsdocs. [ci skip] 2016-03-03 07:47:26 -08:00
John-David Dalton
ddd4c391a1 Add _.updateWith test for a customizer. 2016-03-02 22:25:51 -08:00
greenkeeperio-bot
930ee1d650 Update jscs to 2.11.0. 2016-03-02 14:15:50 -08:00
John-David Dalton
c5344d5336 Ensure _.has returns false for nested inherited properties. [closes #2073] 2016-03-02 07:54:27 -08:00
John-David Dalton
d59c644a10 Use baseGet in parent and _.result. 2016-03-02 07:47:37 -08:00
John-David Dalton
28171945e9 Use smaller objects for _.assign bench. 2016-03-02 07:39:08 -08:00
John-David Dalton
ddf9354d26 Bump to v4.6.1. 2016-03-01 21:55:32 -08:00
John-David Dalton
5f58b65c04 Rebuild lodash and docs. 2016-03-01 21:55:09 -08:00
John-David Dalton
1ec20c5281 Use propertyIsEnumerable var. 2016-03-01 20:33:17 -08:00
John-David Dalton
3421fab58a Update lodash dev dep. 2016-03-01 19:40:05 -08:00
John-David Dalton
deeaf27b54 Avoid cloning symbols internally. 2016-03-01 19:37:44 -08:00
John-David Dalton
429be57b8a Bump to v4.6.0. 2016-03-01 10:58:13 -08:00
John-David Dalton
7f00e8f2f1 Rebuild lodash and docs. 2016-03-01 10:58:13 -08:00
John-David Dalton
89f891ac86 Ensure placeholder uses func when its a lib. 2016-03-01 10:58:13 -08:00
John-David Dalton
63147cd145 Update our code of conduct. [ci skip] 2016-02-29 22:04:07 -08:00
John-David Dalton
2c5f026d3c Add doc note to associate _.merge with _.assign. [ci skip] 2016-02-29 08:17:10 -08:00
John-David Dalton
c10146e2f0 Set constructor of lodash.prototype. 2016-02-29 00:02:13 -08:00
John-David Dalton
548fe881d6 Add _.pullAllWith comparator test. 2016-02-28 20:05:54 -08:00
John-David Dalton
b560b7047b Cleanup "With" tests. 2016-02-28 20:05:27 -08:00
John-David Dalton
6f470abdff Add _.pullAllWith test. 2016-02-28 12:23:32 -08:00
John-David Dalton
eabe95c4e3 Add _.updateWith fp support. 2016-02-28 12:16:21 -08:00
John-David Dalton
fab50ec384 Add _.updateWith tests. 2016-02-28 11:55:09 -08:00
John-David Dalton
0f298de36a Add _.updateWith. 2016-02-28 11:30:16 -08:00
John-David Dalton
f8132e3be4 Add more _.update tests. 2016-02-28 10:54:40 -08:00
John-David Dalton
dfd865dadc Only use SetCache in baseIntersection only when arrays[0] is large. 2016-02-27 21:26:51 -08:00
John-David Dalton
98bdd67cf2 Simplify array mapping in basePullAll and baseOrderBy. 2016-02-27 18:42:24 -08:00
John-David Dalton
e842bec025 Optimize _.intersection to stop search once it matches the size of its smallest array. 2016-02-27 18:35:18 -08:00
John-David Dalton
8278d38a8e Add update to lodash doc note. [ci skip] 2016-02-27 17:03:23 -08:00
John-David Dalton
0699d4cf3d Simplify regexp test. 2016-02-27 17:00:56 -08:00
John-David Dalton
8865633ccd Move baseUpdate and update definitions. 2016-02-27 17:00:46 -08:00
John-David Dalton
7066b9a5c7 Rearrange tests. 2016-02-27 17:00:11 -08:00
John-David Dalton
63f8b1dcec Ensure _.defaultsDeep does not overwrite regexp values. 2016-02-27 14:35:20 -08:00
John-David Dalton
2e790fb865 Add IE 11 doc note to addMapEntry. [ci skip] 2016-02-27 11:13:51 -08:00
John-David Dalton
ac62c24c4a Cleanup passing stack around since Stac#set returns the stack. 2016-02-27 11:06:01 -08:00
John-David Dalton
629de594d5 Avoid deep cloning source values if a customizer is provided. 2016-02-27 10:20:51 -08:00
John-David Dalton
7a69a45ccc Add template sentence tweaks from the wiki. 2016-02-27 10:20:51 -08:00
greenkeeperio-bot
916431118e Update coveralls to 2.11.8. 2016-02-27 10:20:50 -08:00
John-David Dalton
83e584d579 Split circular reference tests up. 2016-02-26 22:08:03 -08:00
Danny Fallon
bbd536fc04 Add test for mergeWith with multi-ref source object. 2016-02-26 22:07:24 -08:00
John-David Dalton
0b76654b71 Ensure stack is popped after recursive merge so that it doesn't affect sibling properties. [closes #2060] 2016-02-26 09:42:42 -08:00
Jeroen Engels
ff7d79d5fc Remove custom rearg for update. 2016-02-26 09:31:58 -08:00
Hassan Zamani
b40b555386 Add _.update. 2016-02-26 01:55:47 -08:00
John-David Dalton
efa1ebff16 Clarify result value order of _.xor. [ci skip] 2016-02-26 00:04:20 -08:00
John-David Dalton
8f0dcde98f Clarify result value origin and order of difference methods. [ci skip] 2016-02-26 00:01:52 -08:00
John-David Dalton
3b1efb635b Clarify result value origin and order of intersection methods. [ci skip] 2016-02-25 23:59:41 -08:00
John-David Dalton
055fdfa0b4 Add _.pullAllWith. 2016-02-25 23:24:13 -08:00
John-David Dalton
a5a21235dc Add mdn references to _.toLower and _.toUpper. [ci skip] 2016-02-25 08:34:43 -08:00
Francis De Brabandere
dfbcfdb0ae Clarify intersection docs on what is returned. [ci skip] 2016-02-24 10:24:40 -08:00
John-David Dalton
a1e917bac2 Remove the word "Added" from alias list. [ci skip] 2016-02-24 01:02:11 -08:00
John-David Dalton
62a9208944 Include aliases in lodash chain doc note. [ci skip] [closes #2044] 2016-02-24 00:48:57 -08:00
John-David Dalton
1bf8eb8cac Update qunit and qunit-extras. 2016-02-23 23:13:34 -08:00
John-David Dalton
893573485c Escape bang in pattern. 2016-02-23 21:22:07 -08:00
John-David Dalton
d5231ad94b Add source tests for _.assign and _.assignIn. 2016-02-23 21:16:32 -08:00
John-David Dalton
a578935621 Remove unhit condition in getNative. 2016-02-23 20:13:08 -08:00
Jeroen Engels
c88c7ff6bb Fix order of arguments in FP docs. [ci skip] 2016-02-23 14:19:48 -08:00
John-David Dalton
21f9cfa6d3 Remove unneeded Ctor variables. 2016-02-23 10:58:27 -08:00
John-David Dalton
45d2fb8a30 Fix _.transform test fail in Safari 8. 2016-02-23 10:58:27 -08:00
John-David Dalton
9c162624fe Cleanup symbolTag case in equalByTag. 2016-02-23 10:58:27 -08:00
John-David Dalton
80b5731709 Leak msWDfn in test/test-fp.js to prevent false fails in Edge on sauce. 2016-02-23 10:58:27 -08:00
John-David Dalton
bab4ffff62 Remove unstable test from local testing. 2016-02-23 08:31:04 -08:00
John-David Dalton
f644c82da4 Replace Symbol checks with Symbol methods as checks instead. [closes #2039] 2016-02-23 08:30:48 -08:00
John-David Dalton
54294f15ef Update _.assign and _.assignIn fast paths. 2016-02-23 08:23:13 -08:00
John-David Dalton
dfe77571fb Remove _.keys fast path. 2016-02-23 08:23:05 -08:00
John-David Dalton
f40f66d29b Remove a isTypedArray check and unnecessary stack creation from baseIsEqualDeep. 2016-02-22 23:38:19 -08:00
John-David Dalton
af06529283 Ensure _.isEqual works with maps and sets with circular references. 2016-02-22 23:38:18 -08:00
John-David Dalton
d8da7a2142 Use isFunction check without the typeof check. 2016-02-22 23:38:18 -08:00
John-David Dalton
c1f8e31775 Use typeof for function checks instead of isFunction. 2016-02-22 23:38:18 -08:00
John-David Dalton
cc4b49226b Use postfix increment operators. 2016-02-22 23:38:18 -08:00
John-David Dalton
f9a2f74716 Optimize _.assign, _.assignIn, & _.keys. 2016-02-22 23:38:18 -08:00
John-David Dalton
a326a6badf Update contributing text with 👍's. [ci skip] 2016-02-22 23:38:18 -08:00
John-David Dalton
e21f4862e1 Update contributing link to tagged release. [ci skip] 2016-02-22 23:38:18 -08:00
greenkeeperio-bot
f0c3ac1789 Update jquery to 2.2.1, uglify-js to 2.6.2, and webpack to 1.12.14. 2016-02-22 23:37:38 -08:00
John-David Dalton
e24513e6e2 Clarify _.isEmpty docs. [ci skip] 2016-02-22 12:19:08 -08:00
John-David Dalton
a224b6f1b0 Add core.min.js and lodash.min.js to the fp module ignored list. 2016-02-22 10:28:34 -08:00
John-David Dalton
26299eb364 Update _.isEmpty doc param type for value. [ci skip] 2016-02-22 10:24:20 -08:00
John-David Dalton
772c461a33 Bump to v4.5.1. 2016-02-21 22:58:49 -08:00
John-David Dalton
110ca4d1b5 Rebuild lodash and docs. 2016-02-21 22:58:49 -08:00
John-David Dalton
aafb05b675 Update for lodash v4 api. 2016-02-21 22:58:49 -08:00
John-David Dalton
ff6fc56a15 Use _baseConvert in fp module. 2016-02-21 21:07:21 -08:00
John-David Dalton
2dfbe9fe77 Use minified lodash in fp module. 2016-02-21 21:07:09 -08:00
John-David Dalton
4a0fe2c17b Use lodash in test/remove.js. 2016-02-21 19:35:08 -08:00
John-David Dalton
9f7e626b9a Make build-module create core.min.js and lodash.min.js. 2016-02-21 19:35:08 -08:00
John-David Dalton
f2985bda5f Add copyFile, minFile, and writeFile to lib/common/util.js. 2016-02-21 19:35:01 -08:00
John-David Dalton
1517745a6a Update placeholder param description of createRecurryWrapper. [ci skip] 2016-02-21 16:57:06 -08:00
John-David Dalton
887cb55919 Add _.placeholder tests. 2016-02-21 13:48:46 -08:00
John-David Dalton
5c42d0ef31 Add intersection tests for two arrays. 2016-02-21 09:59:51 -08:00
John-David Dalton
837d47a309 Update lodash paths travis.yml, test/test.js, and test/index.html. 2016-02-20 23:53:35 -08:00
John-David Dalton
f3766cf889 Add getPlaceholder helper. 2016-02-20 18:07:11 -08:00
John-David Dalton
2b8b63e59f Allow placeholders to persist through more than 1 curried call. 2016-02-20 18:07:05 -08:00
John-David Dalton
d64583b743 Cleanup bitmask groupings in mergeData. 2016-02-20 16:40:59 -08:00
John-David Dalton
9ec65d5ed5 Fix newHolders typo. 2016-02-20 11:28:11 -08:00
John-David Dalton
9fe6afcdcc Use lodashStable.bind in unzip/zip test. 2016-02-20 11:28:11 -08:00
Benjamim Sonntag
6a4e0fb41b Links _.remove and _.pull in the docs. [ci skip] 2016-02-20 11:28:00 -08:00
John-David Dalton
b570884bb3 Remove npm "prepublish" script to avoid running on npm i. 2016-02-19 10:51:48 -08:00
John-David Dalton
8f8f8e288c Update internal module references in tests. 2016-02-19 10:39:38 -08:00
John-David Dalton
8698a5e0e8 Add tests for setting the [[Prototype]] of clones for values where constructor is incorrect. 2016-02-19 08:18:56 -08:00
John-David Dalton
ad5e30e189 Move _.merge test for augmenting objects. 2016-02-19 08:17:44 -08:00
Benjamin Tan
19ee0c74f8 Update link to CONTRIBUTING.md in readme. [ci skip] 2016-02-19 08:02:57 -08:00
John-David Dalton
007e5aa27a Increment package version to enable ci tests. 2016-02-19 01:23:07 -08:00
John-David Dalton
2509f562b5 Update fp wiki template. 2016-02-19 01:23:02 -08:00
John-David Dalton
a58a276ffd Replace "iteratee function" with "iteratee". [ci skip] 2016-02-19 01:04:36 -08:00
John-David Dalton
1a5b9dcce1 Add iteratee signature to _.mapKeys. [ci skip] 2016-02-19 01:04:19 -08:00
John-David Dalton
1240a0dfdd Move contributing text to .github. [ci skip] 2016-02-19 00:46:06 -08:00
Henrik Hjelte
0194169e79 Clarify docs on omitBy predicate params. [ci skip] 2016-02-19 00:11:33 -08:00
John-David Dalton
a71c19e1b5 Avoid unnecessary cloning in fp set methods. [closes #2017] 2016-02-19 00:11:20 -08:00
John-David Dalton
bfbfa719ff Ensure assignValue assigns values if they aren't the same own value. [closes #2022] 2016-02-19 00:01:33 -08:00
John-David Dalton
49389d0a2f Ducktype in _.isError for ES6 support. 2016-02-18 21:52:53 -08:00
John-David Dalton
e380062403 Use getPrototypeOf to set inheritance when constructor is a function. [closes #2018] 2016-02-18 21:52:19 -08:00
John-David Dalton
b83abfa9c1 Make fp arity for orderBy three instead of two. [closes #2019] 2016-02-18 13:37:16 -08:00
John-David Dalton
48dbf203a5 Ensure fp pickBy and omitBy provide value and key arguments. 2016-02-18 01:08:19 -08:00
John-David Dalton
23768398c5 Add iterateeRearg fp mapping back for mapKeys. 2016-02-17 22:21:48 -08:00
John-David Dalton
ab73503859 Bump to v4.5.0. 2016-02-17 22:21:48 -08:00
John-David Dalton
a4f7d4cc2a Rebuild lodash and docs. 2016-02-17 22:21:47 -08:00
Myles Borins
cca5ac60d6 Fix npm-test by removing the call to test-docs. 2016-02-17 22:21:47 -08:00
John-David Dalton
9f7f9fc3c5 Adjust heading order. [ci skip] 2016-02-17 01:26:28 -08:00
John-David Dalton
6e2fb92e9a Remove unused baseArity. 2016-02-16 22:29:41 -08:00
John-David Dalton
4f702e2381 Specify utf8 encoding. 2016-02-16 22:04:47 -08:00
John-David Dalton
b188f903ce Add fp tests for iteratee shorthands. 2016-02-16 21:27:08 -08:00
John-David Dalton
7b93dc9c32 Ensure clone methods clone expando properties of boolean, number, & string objects. [closes #2008] 2016-02-16 21:27:03 -08:00
John-David Dalton
664d66a89e Make string tests more consistent. 2016-02-16 20:44:55 -08:00
John-David Dalton
d9dc0e6fd1 Add _.invertBy tests. 2016-02-16 19:30:23 -08:00
John-David Dalton
53168e4cfd Remove dup _.invertBy test. 2016-02-16 18:49:43 -08:00
John-David Dalton
7998632685 Add castArray chaining test. 2016-02-16 18:48:57 -08:00
John-David Dalton
86f2a1061c Simplify readme. [ci skip] 2016-02-16 18:48:11 -08:00
John-David Dalton
9ca02a448e Update cdn links. [ci skip] 2016-02-16 08:52:49 -08:00
John-David Dalton
17091d3a0e Simplify shorthand test labels. 2016-02-16 08:42:29 -08:00
John-David Dalton
c94b1488e9 Make iteraeeAry pass thru non-functions. [closes #2007] 2016-02-16 07:46:54 -08:00
John-David Dalton
7b2274cb44 Add methods to lodash doc notes. [ci skip] 2016-02-16 01:29:25 -08:00
John-David Dalton
7c27a6f51e Make wording of entries align closer to their titles. [ci skip] 2016-02-16 01:29:25 -08:00
John-David Dalton
e91371d406 Increment package version to enable ci tests. 2016-02-16 01:29:25 -08:00
John-David Dalton
e878559fb9 Bump to v4.4.0. 2016-02-15 23:08:19 -08:00
John-David Dalton
36af8de116 Rebuild lodash and docs. 2016-02-15 23:07:07 -08:00
John-David Dalton
09dd3a8fea Remove noConflict call from the node fp module template. 2016-02-15 23:07:07 -08:00
John-David Dalton
5dd6b90692 Minor comma nit from contributing.md. [ci skip] 2016-02-15 21:30:16 -08:00
John-David Dalton
97fd94744e Add mapping section to fp wiki template. [ci skip] 2016-02-15 17:38:30 -08:00
John-David Dalton
0da3674d5e Update fp doc template. 2016-02-15 17:00:01 -08:00
John-David Dalton
01d530d65e Cleanup fp/build-modules. 2016-02-15 16:59:43 -08:00
John-David Dalton
10dd42b6e4 Restore bizarro tests for Object.create. 2016-02-15 16:47:31 -08:00
John-David Dalton
ba2d3f7704 Use != instead of !== when value is guaranteed to be a string. 2016-02-15 16:36:20 -08:00
Graeme Yeates
607fe2a5f6 Use Object.create in baseCreate (even if shimmed). 2016-02-15 16:35:20 -08:00
John-David Dalton
4643679d79 Remove fp caps mapping. 2016-02-15 13:51:20 -08:00
greenkeeperio-bot
04180c7c96 Update jscs to 2.10.1. 2016-02-15 11:12:14 -08:00
John-David Dalton
3846348f8a Clarify how undefined source values are handled in _.merge. [ci skip] 2016-02-15 10:22:25 -08:00
John-David Dalton
dc2fc9428d Cross reference _.matches and _.isMatch in docs. [ci skip] 2016-02-15 10:22:04 -08:00
John-David Dalton
6e399ce311 Cleanup long lines in isEqualWith docs. [ci skip] 2016-02-15 10:21:19 -08:00
John-David Dalton
641b544801 Add castArray to lodash chaining doc note. [ci skip] 2016-02-15 10:20:40 -08:00
John-David Dalton
761a100397 Ensure _.valuesIn returns results. [closes #2000] 2016-02-15 09:14:10 -08:00
John-David Dalton
cf1a4f893f Update fp doc generation. 2016-02-15 00:18:12 -08:00
John-David Dalton
19613be861 Add isArray to _util.jst. 2016-02-14 23:47:45 -08:00
John-David Dalton
c163659713 Rename fp mapping rename to remap. 2016-02-14 23:47:45 -08:00
John-David Dalton
aae02af265 Cleanup Date shims. 2016-02-14 19:20:17 -08:00
John-David Dalton
cb96bf15b7 Reduce the length of some lines. 2016-02-14 19:14:17 -08:00
John-David Dalton
c006c28f55 Add lib/common/util. 2016-02-14 12:57:34 -08:00
John-David Dalton
d358d00531 Ensure fp castArray shallow clones arrays. 2016-02-14 12:09:17 -08:00
John-David Dalton
abcebb4f48 Remove exposed castFunction and castPath. 2016-02-14 11:02:11 -08:00
John-David Dalton
6e74724c0f Add _.compat test for lazy sequence with a custom _.iteratee. 2016-02-14 09:21:07 -08:00
John-David Dalton
c5f6c43326 Add default wrapper value to jsdoc of _.wrap. [ci skip] 2016-02-14 08:57:28 -08:00
John-David Dalton
a9e8c0ba76 Add changelog mention to the wiki link in readme. [ci skip] 2016-02-14 08:41:43 -08:00
John-David Dalton
5388d8a7b0 Rename _.asArray to _.castArray and add _.castFunction and _.castPath. 2016-02-13 13:40:04 -08:00
Graeme Yeates
ee499b36ea Add _.asArray method. 2016-02-13 09:04:19 -08:00
John-David Dalton
13e4b959a4 Rename skipTest to skipAssert. 2016-02-13 08:32:47 -08:00
John-David Dalton
5a336403f9 Fix fp browser test fails. 2016-02-13 08:31:04 -08:00
John-David Dalton
26265c011a Fix failing _.isError test in phantomjs. 2016-02-13 02:18:37 -08:00
John-David Dalton
4a390bca1c Update tests for es6. 2016-02-13 02:18:15 -08:00
John-David Dalton
af46ead30d Fix caller access in strict mode es6 modules. 2016-02-13 02:01:46 -08:00
John-David Dalton
de0f936e92 Ensure fp convert works with category modules. 2016-02-13 01:23:07 -08:00
John-David Dalton
bf9dcfe89c Add jsdoc constructor tags. [ci skip] 2016-02-12 22:51:26 -08:00
John-David Dalton
df0ecd2a93 Ensure _.isError works with subclasses values. [closes #1994] 2016-02-12 22:51:26 -08:00
John-David Dalton
b3ebb3c3d3 Add _.fromPairs to mention to _.toPairs and _.toPairsIn. [ci skip] 2016-02-12 22:51:26 -08:00
Jeroen Engels
0bead0c69a Update closed issue link in contributing.md to link to enhancement issues. [ci skip] 2016-02-12 22:51:26 -08:00
John-David Dalton
a055b0a04f Fix fp rearg order for zipWith. 2016-02-12 22:51:26 -08:00
John-David Dalton
d6f6007692 Add wiki link to "Further Reading" section of readme. [ci skip] 2016-02-12 22:51:26 -08:00
John-David Dalton
8ee7ffb2ab Add more currying to fp tests. 2016-02-12 22:51:26 -08:00
John-David Dalton
40ff04911e Remove unneeded copyArray from baseMergeDeep. 2016-02-12 22:51:25 -08:00
John-David Dalton
a3676618af Reorg templates. 2016-02-12 22:51:19 -08:00
John-David Dalton
b1ed66c6f5 Add another fp.inRange test. 2016-02-11 22:57:25 -08:00
John-David Dalton
53b3f81abe Ensure _.merge deep clones array/typed-array/plain-object sources. [closes #1987] 2016-02-11 22:56:33 -08:00
John-David Dalton
bd2428dde5 Remove fp doc to be simplified in a later commit. 2016-02-11 21:02:44 -08:00
Jeroen Engels
b7ae5f0885 Add paragraph about making feature requests in docs [ci skip] 2016-02-11 19:57:04 -08:00
John-David Dalton
8c5b64c7d7 Have browser fp convert auto wrap lodash if found. 2016-02-11 15:49:32 -08:00
John-David Dalton
641112dd4d Attempt two to fix bizarro buffer test in Node v0.12. 2016-02-11 10:55:26 -08:00
John-David Dalton
1c47acd040 Ensure maxWait isn't processed on a leading invocation ifleading is false and there isn't an max delay queued. [closes #1964] 2016-02-11 00:18:08 -08:00
greenkeeperio-bot
d58d6f45cc Update glob to 7.0.0. 2016-02-11 00:18:07 -08:00
Artur Baybulatov
7efa921bab Add a note about browser usage of lodash-fp. [ci skip] 2016-02-10 10:54:40 -08:00
John-David Dalton
feafdb3c6a Fix jsdoc type tags. [closes #1976] [ci skip] 2016-02-10 08:26:43 -08:00
John-David Dalton
784ee6a086 Remove fp iterateeRearg mapping. [closes #1971] 2016-02-10 08:19:59 -08:00
John-David Dalton
3014f20b6c Remove copyArray dep from _.flattenDepth. 2016-02-10 00:43:03 -08:00
John-David Dalton
40bb035b09 Minor label cleanup. 2016-02-10 00:15:08 -08:00
John-David Dalton
ba32bf3b8d Cleanup flatten methods and add more flattenDepth tests. 2016-02-10 00:14:10 -08:00
John-David Dalton
e9edc06aaf Enable convert to work when given lodash and options. 2016-02-09 21:56:49 -08:00
Jordan Eldredge
c91196d240 Run style checks before publishing. 2016-02-09 19:39:32 -08:00
Jeroen Engels
08c7bf3c85 Fix code style error and doc nit. [ci skip] 2016-02-09 19:39:32 -08:00
Michael Morgan
046470a8db Added _.flattenDepth for variable-depth flatten. 2016-02-09 19:39:32 -08:00
Billy Janitsch
2b1eedb036 Fix FP rearg for _.zipWith and _.inRange. 2016-02-09 19:39:31 -08:00
Jeroen Engels
02bea6534c fp docs - Remove notes about mutation in description. 2016-02-09 19:36:37 -08:00
Jeroen Engels
6f4099c20b fp docs - Split lib/doc/apply-fp-mapping into multiples files. 2016-02-09 19:36:37 -08:00
Jeroen Engels
39735df82f fp docs - Inject default values and cap args. 2016-02-09 19:36:37 -08:00
Jeroen Engels
5062f22839 fp docs - Remove console.log() from examples. 2016-02-09 19:36:36 -08:00
Jeroen Engels
e397707dc9 fp docs - translate ...args to args[] in example and params. 2016-02-09 19:36:36 -08:00
Jeroen Engels
66d6e226a9 Add scripts to generate the docs for lodash/fp. 2016-02-09 19:36:36 -08:00
Benjamin Tan
fbfa578c11 Write fp docs to a different file. 2016-02-09 19:36:36 -08:00
John-David Dalton
5cd7208ef3 Fix test fail in phantomjs. 2016-02-09 17:11:02 -08:00
John-David Dalton
e5bc6a0315 Fix bizarro buffer test in Node v0.12. 2016-02-09 17:11:02 -08:00
John-David Dalton
495c890aac Add bizarro test for _.isBuffer. 2016-02-09 17:11:02 -08:00
John-David Dalton
5fe4a1b05d Add fp placeholder test for converted partial. 2016-02-09 17:11:02 -08:00
John-David Dalton
d8bf62995b Ensure fp options works when applied individually. 2016-02-09 17:11:02 -08:00
John-David Dalton
e36f7e7161 Enable testing fp/convert in the browser. 2016-02-09 17:11:02 -08:00
John-David Dalton
285b667c3e Update "Why Lodash" section of readme. [ci skip] 2016-02-09 17:11:02 -08:00
John-David Dalton
aefbdbb6d5 Increment package version to enable ci tests. 2016-02-08 00:31:19 -08:00
John-David Dalton
8debfc6e6c Bump to v4.3.0. 2016-02-08 00:31:19 -08:00
John-David Dalton
c9ca772a32 Rebuild lodash and docs. 2016-02-08 00:31:19 -08:00
John-David Dalton
dc65792776 Add fp tests for add, subtract, gt, gte, lt, & lte. 2016-02-08 00:31:19 -08:00
John-David Dalton
18ae1d7c18 Ensure _.add and _.subtract return 0 when no arguments are given. 2016-02-08 00:31:19 -08:00
John-David Dalton
d790a1b3c6 Adjust "provided"/"given" use. [ci skip] 2016-02-08 00:31:18 -08:00
John-David Dalton
349c627110 Add options to baseConvert. 2016-02-08 00:31:13 -08:00
John-David Dalton
db23fcfe9f Rename num params to n. 2016-02-07 22:47:15 -08:00
John-David Dalton
d5a6a75639 Clarify pull request notes in contributing.md. [ci skip] 2016-02-07 22:47:15 -08:00
Robert T. Stewart
404a7181a8 Add 'What is Lodash' section to README.md. [ci skip] 2016-02-07 22:47:15 -08:00
Corbacho
e392b8e240 Improve accuracy of _.throttle. 2016-02-07 22:47:14 -08:00
John-David Dalton
6752d75ad0 Add _.isMap, _.isSet, _.isWeakMap, & _.isWeakSet. 2016-02-07 22:47:14 -08:00
John-David Dalton
e00d9821a8 Add gt, gte, lt, lte to fp skipRearg mapping. 2016-02-07 22:47:14 -08:00
John-David Dalton
1cf7093f46 Allow undefined realm values. 2016-02-07 22:47:14 -08:00
John-David Dalton
88708ec00f Minor test order nit. 2016-02-07 22:47:14 -08:00
John-David Dalton
984b0af883 Add deep clone test for buffers. 2016-02-07 22:47:14 -08:00
John-David Dalton
8810754ada Add _.isArrayBuffer test. 2016-02-07 22:47:14 -08:00
John-David Dalton
0d340b378b Add _.isBuffer test. 2016-02-07 22:47:14 -08:00
John-David Dalton
e30dc968ef Move _.isNull test. 2016-02-07 22:47:13 -08:00
John-David Dalton
ea942b0642 Upgrade sauce tested versions of Chrome and Firefox. 2016-02-07 22:47:13 -08:00
Tyler Garrett
7e9d49b300 Fix DevDoc link in readme. [ci skip] 2016-02-07 22:47:13 -08:00
John-David Dalton
ce60ac4274 Add isDeep flag to cloneBuffer. 2016-02-07 22:47:13 -08:00
John-David Dalton
a04fc310b4 Fix buffer test fails. 2016-02-07 22:47:13 -08:00
John-David Dalton
4a805ea666 Add _.isArrayBuffer and _.isBuffer. 2016-02-07 22:47:13 -08:00
John-David Dalton
1595651780 Add support for cloning buffers. [closes #1940] 2016-02-07 22:47:13 -08:00
John-David Dalton
fc85cac91d Update sauce-tunnel and webpack deps. 2016-02-07 22:47:13 -08:00
John-David Dalton
73134f9dcc Update the readme. 2016-02-07 22:47:13 -08:00
John-David Dalton
eb72bbe6f7 Update license to github formatting. 2016-02-07 22:47:12 -08:00
John-David Dalton
a5ae078f8f Increment package version to enable ci tests. 2016-02-05 00:24:51 -08:00
John-David Dalton
1cd9dc49a9 Bump to v4.2.1. 2016-02-03 01:31:34 -08:00
John-David Dalton
d64a97195b Rebuild lodash and docs. 2016-02-03 01:16:58 -08:00
John-David Dalton
c6a3ace553 Skip pseudo-private aliases. 2016-02-03 01:16:58 -08:00
John-David Dalton
497d57ca95 Ensure fp add and subtract don't have rearg applied. 2016-02-03 00:16:07 -08:00
John-David Dalton
3a07b411fb Add fp tests for placeholders. 2016-02-03 00:16:07 -08:00
John-David Dalton
b0c2a8d5fd Add fp _.partial tests for convert by name. 2016-02-03 00:16:06 -08:00
John-David Dalton
e404d214aa Add _.placeholder support so wrapped functions may support placeholders. 2016-02-03 00:16:06 -08:00
Nathan Tran
7f295dc6e8 Make _baseConvert use spread and not rest. 2016-02-03 00:16:06 -08:00
Prayag Verma
d2a8203efb Remove duplicate to and the words from docs. [ci skip] 2016-02-03 00:16:06 -08:00
John-David Dalton
33bfa8f961 Add trimChars fp mapping. 2016-02-03 00:16:06 -08:00
John-David Dalton
f944254cb8 Cleanup fp.curryN test label. 2016-02-03 00:16:06 -08:00
John-David Dalton
30339cfd86 Add fp.getOr test. 2016-02-03 00:16:06 -08:00
John-David Dalton
7dd5549b05 Increment lodash package version to enable ci tests. 2016-02-03 00:16:06 -08:00
John-David Dalton
b6b59d93d7 Bump to 4.2.0. 2016-02-02 00:33:16 -08:00
John-David Dalton
5af68bbf94 Rebuild lodash and docs. 2016-02-02 00:33:16 -08:00
John-David Dalton
db7debd3da Move benchmark.js to a dev dep. 2016-02-02 00:33:16 -08:00
laispace
29bc8d965b Fix _.sortedUniqBy doc example. [ci skip] 2016-02-01 23:55:34 -08:00
John-David Dalton
daeb55e99d Rename mapping rekey to rename. 2016-02-01 23:53:19 -08:00
John-David Dalton
fa4d85897c Add mutation notes to _.mergeWith, _.set, _.setWith, and _.unset. [ci skip] 2016-02-01 22:53:05 -08:00
John-David Dalton
983363e0cd Cleanup readme. [ci skip] 2016-02-01 22:37:56 -08:00
John-David Dalton
d95dad76b8 Remove dead code. 2016-02-01 22:37:56 -08:00
John-David Dalton
18f74aa5b2 Rename spreadArgs to otherArgs. 2016-02-01 22:37:56 -08:00
John-David Dalton
e96a8f7bc6 Cleanup map tests. 2016-02-01 22:37:56 -08:00
John-David Dalton
29f39be6ad Add _.flapMap tests for collections. 2016-02-01 22:37:56 -08:00
John-David Dalton
7a17967d79 Add _.spread tests for the start param. 2016-02-01 22:37:56 -08:00
John-David Dalton
de5bd32aba Rename rp vars to rest. 2016-02-01 22:37:56 -08:00
Jason Trill
199b2e1a3a Reword docs for _.tap and _.thru. [ci skip] 2016-02-01 22:37:56 -08:00
John-David Dalton
a43e4f10ef Update vendors. 2016-02-01 22:37:55 -08:00
Trevor Hudson
5522e4641d Update _.pickBy docs to include value as an iteratee param. [ci skip] 2016-02-01 22:37:55 -08:00
greenkeeperio-bot
6c82ea8fc3 Update qunitjs to 1.21.0. 2016-02-01 22:37:55 -08:00
John-David Dalton
b4b45b7139 Update docdown. 2016-02-01 22:37:55 -08:00
John-David Dalton
7ebb033016 Add _.at chaining test for objects with index keys. 2016-02-01 22:37:55 -08:00
John-David Dalton
163fdb46f0 Ensure fp _.partial and _.partialRight accept an args param. 2016-02-01 22:37:55 -08:00
John-David Dalton
b38cf204f7 Add start param to _.spread. 2016-02-01 22:37:55 -08:00
John-David Dalton
fe5381b0f4 Cleanup fp mapping. 2016-02-01 22:37:55 -08:00
John-David Dalton
c99e7f1337 Make _.flatMap a "Collection" method. 2016-02-01 22:37:55 -08:00
Mohammed Nauage
b61b674fec Remove sorted behavior from _.indexOf docs. [ci skip] 2016-02-01 22:37:55 -08:00
John-David Dalton
3bdaf99cfa Ensure _.iteratee clones sources for "_.matchesProperty" shorthand. 2016-02-01 22:37:54 -08:00
John-David Dalton
6c85e7015a Add assocPath and dissocPath fp aliases. 2016-02-01 22:37:54 -08:00
John-David Dalton
9788f7101b Ensure fp unset is immutable. [closes #1913] 2016-02-01 22:37:54 -08:00
Billy Janitsch
d0d5a3802d Alias set to assoc in FP. 2016-02-01 22:37:54 -08:00
John-David Dalton
1f160b31ff Make doc code sample comments match source comment style. [ci skip] 2016-01-30 01:02:49 -08:00
Ivan Tanev
13659e87cb Ensure _.attempt preserves custom errors. 2016-01-30 01:02:49 -08:00
John-David Dalton
ac9b0bfc1b Increment package version to enable ci tests. 2016-01-30 01:02:48 -08:00
John-David Dalton
07f7a3f3c5 Bump to 4.1.0. 2016-01-29 14:22:08 -08:00
John-David Dalton
22984f4eb2 Rebuild lodash and docs. 2016-01-29 14:21:44 -08:00
John-David Dalton
2286283f98 Add babel-plugin-lodash mention to readme. [ci skip] 2016-01-29 14:21:37 -08:00
Florent Cailhol
5ca26e6ae0 Remove V8 JIT bug fix for _.isObject. 2016-01-29 01:09:23 -08:00
John-David Dalton
e7c3afc1e5 Add index.js and lodash.js to the list of ignored files when generating fp modules. 2016-01-28 23:58:16 -08:00
John-David Dalton
82e9b4197b Add more fp mutation tests for deep objects. 2016-01-28 23:01:28 -08:00
John-David Dalton
820939f014 Update docdown. 2016-01-28 22:11:48 -08:00
John-David Dalton
e4c9916e17 Add default accumulator values to doc examples. [ci skip] 2016-01-28 22:11:43 -08:00
John-David Dalton
ce88b120eb Use npm config shorthand. 2016-01-28 18:11:53 -08:00
John-David Dalton
23c5101227 Make doc postprocess fix for symbol identifers more generic. 2016-01-28 14:45:15 -08:00
Craig Martin
de3eeb2d47 Use npm pretest hook. 2016-01-28 12:36:13 -08:00
John-David Dalton
03f7205e6d Ensure _.clone and _.cloneDeep work on prototype objects. 2016-01-28 01:05:25 -08:00
John-David Dalton
7bf7ab954b Update vendors and dev deps. 2016-01-28 01:05:25 -08:00
John-David Dalton
97612f3b31 Disable npm progress bar in travis for quicker installs. 2016-01-27 07:38:08 -08:00
John-David Dalton
71702d058c Ignore more files. 2016-01-27 01:19:03 -08:00
John-David Dalton
6a4164d9f3 Ensure remapped fp method modules are created. 2016-01-27 00:47:31 -08:00
John-David Dalton
d3b0eae84c Use mapping for aliasToReal. 2016-01-27 00:47:31 -08:00
John-David Dalton
0105b93f38 Ensure fp convert can work with aliases as name. 2016-01-27 00:19:06 -08:00
John-David Dalton
cae0d2c707 Add aliasToReal fp mapping. 2016-01-27 00:19:06 -08:00
John-David Dalton
dcb1572240 Reorg fp tests. 2016-01-27 00:19:06 -08:00
John-David Dalton
e20f43018b Separate fp _mapping into individual exports. 2016-01-27 00:19:06 -08:00
John-David Dalton
01e176694f Correct fp arg order of assignWith, assignInWith, merge, mergeWith, defaults, and defaultsDeep. 2016-01-27 00:19:06 -08:00
John-David Dalton
a239ccaa9a Add main:modules npm run script. 2016-01-26 21:32:22 -08:00
Jeroen Engels
b97a05b7f2 Add npm scripts to build docs. 2016-01-26 21:32:16 -08:00
John-David Dalton
c86754afde Cleanup hasPath and indexKeys. 2016-01-26 18:20:51 -08:00
John-David Dalton
95da9c0dd4 Optimize _.isEmpty. [closes #1888] 2016-01-26 18:20:50 -08:00
John-David Dalton
567171993b Define trim_trailing_whitespace rule for all files. 2016-01-26 18:20:50 -08:00
Kent C. Dodds
60a0d554a0 Run scripts in parallel. 2016-01-26 10:10:16 -08:00
John-David Dalton
f87af6c642 Add more npm run-scripts. 2016-01-26 08:41:38 -08:00
John-David Dalton
df849e8698 Fix style nits. 2016-01-26 08:41:38 -08:00
John-David Dalton
7a8ef7aeb7 Ensure _.sum and _.sumBy return 0 for empty arrays. [closes #1883] 2016-01-26 01:29:59 -08:00
John-David Dalton
25c7c8b153 Update dev deps. 2016-01-26 00:29:41 -08:00
John-David Dalton
8048f015e5 Ensure _.mergeWith overwrites primitives with source object clones. [closes #1880] 2016-01-26 00:28:38 -08:00
John-David Dalton
8a7fce41bb Add invokeMap to the excused methods in Backbone tests. 2016-01-26 00:28:38 -08:00
John-David Dalton
094a272443 Add _.invertBy. 2016-01-26 00:28:37 -08:00
John-David Dalton
552be2f5fb Remove multiVal param from _.invert. 2016-01-26 00:28:37 -08:00
John-David Dalton
d99954133c Add _.zipObjectDeep. 2016-01-26 00:28:37 -08:00
John-David Dalton
c49ace5587 Add back fp build-modules files. 2016-01-26 00:28:30 -08:00
78 changed files with 27169 additions and 17343 deletions

View File

@@ -8,7 +8,5 @@ charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
[**.{html,js,json,md}]
insert_final_newline = true
trim_trailing_whitespace = true

78
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,78 @@
# Contributing to Lodash
Contributions are always welcome. Before contributing please read the
[code of conduct](https://jquery.org/conduct/) &
[search the issue tracker](https://github.com/lodash/lodash/issues); your issue
may have already been discussed or fixed in `master`. To contribute,
[fork](https://help.github.com/articles/fork-a-repo/) Lodash, commit your changes,
& [send a pull request](https://help.github.com/articles/using-pull-requests/).
## Feature Requests
Feature requests should be submitted in the
[issue tracker](https://github.com/lodash/lodash/issues), with a description of
the expected behavior & use case, where theyll remain closed until sufficient interest,
[e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/),
has been [shown by the community](https://github.com/lodash/lodash/issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).
Before submitting a request, please search for similar ones in the
[closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
## Pull Requests
For additions or bug fixes you should only need to modify `lodash.js`. Include
updated unit tests in the `test` directory as part of your pull request. Dont
worry about regenerating the `dist/` or `doc/` files.
Before running the unit tests youll need to install, `npm i`,
[development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
Run unit tests from the command-line via `npm test`, or open `test/index.html` &
`test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) &
[Underscore](http://underscorejs.org/) test suites are included as well.
## Contributor License Agreement
Lodash is a member of the [jQuery Foundation](https://jquery.org/).
As such, we request that all contributors sign the jQuery Foundation
[contributor license agreement (CLA)](https://contribute.jquery.org/CLA/).
For more information about CLAs, please check out Alex Russells excellent post,
[“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
## Coding Guidelines
In addition to the following guidelines, please follow the conventions already
established in the code.
- **Spacing**:<br>
Use two spaces for indentation. No tabs.
- **Naming**:<br>
Keep variable & method names concise & descriptive.<br>
Variable names `index`, `array`, & `iteratee` are preferable to
`i`, `arr`, & `fn`.
- **Quotes**:<br>
Single-quoted strings are preferred to double-quoted strings; however,
please use a double-quoted string if the value contains a single-quote
character to avoid unnecessary escaping.
- **Comments**:<br>
Please use single-line comments to annotate significant additions, &
[JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for
functions.
Guidelines are enforced using [JSCS](https://www.npmjs.com/package/jscs):
```bash
$ npm run style
```
## Tips
You can opt-in to a pre-push git hook by adding an `.opt-in` file to the root of
the project containing:
```txt
pre-push
```
With that, when you `git push`, the pre-push git hook will trigger and execute
`npm run validate`.

5
.gitignore vendored
View File

@@ -1,7 +1,4 @@
.DS_Store
*.custom.*
*.log
*.map
lodash.compat.min.js
coverage
doc/*.html
node_modules

View File

@@ -77,7 +77,6 @@
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
@@ -85,6 +84,7 @@
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingWhitespace": true,
"disallowUnusedVariables": true,
"jsDoc": {
"checkRedundantAccess": true,

View File

@@ -0,0 +1,11 @@
'use strict';
delete global['__core-js_shared__'];
var _ = require('./lodash.js'),
globals = require('lodash-doc-globals');
module.exports = {
'babel': false,
'globals': _.assign({ '_': _ }, globals)
};

View File

@@ -1,7 +1,11 @@
language: node_js
sudo: false
node_js:
- "5"
- "6"
cache:
directories:
- node_modules
- travis_phantomjs
env:
global:
- BIN="node" ISTANBUL=false OPTION=""
@@ -20,6 +24,8 @@ matrix:
env:
- node_js: "4"
env:
- node_js: "5"
env:
git:
depth: 10
branches:
@@ -32,17 +38,24 @@ notifications:
on_success: change
on_failure: always
before_install:
- "export PHANTOMJS_VERSION=2.1.1"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"
- "nvm use $TRAVIS_NODE_VERSION"
- "npm config set loglevel error"
- "npm set loglevel error"
- "npm set progress false"
- "npm i -g npm@\"^2.0.0\""
- |
PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|"
PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|"
PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|"
PATTERN[4]="|\s*if\s*\(ctorString\b[\s\S]+?\}\s*\}|"
PATTERN[4]="|\bcase\s+(?:dataView|promise|set|map|weakMap)CtorString:.+|g"
PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
PATTERN[6]="|\s*if\s*\(!lodashFunc\)\s*\{\s*return;\s*\}|"
PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
PATTERN[7]="|\s*define\([\s\S]+?\);|"
PATTERN[8]="|\s*root\._\s*=\s*_;|"
@@ -52,18 +65,26 @@ before_install:
node ./test/remove.js "$PTRN" ./lodash.js
done
fi
- "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../"
- "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
- "rm -rf ./node_modules/lodash-cli"
- "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli"
- "mkdir -p ./node_modules/lodash-cli/node_modules/lodash && cd $_ && cp ../../../../lodash.js ./lodash.js && cp ../../../../package.json ./package.json"
- "cd ../../ && npm i && cd ../../"
script:
# Detect code coverage.
- "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js"
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true"
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
- "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash"
- "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./node_modules/lodash && node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js)"
- "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
# Test in Node.js and PhantomJS.
- "[ $ISTANBUL == true ] || node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
- "[ $ISTANBUL == true ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./ && node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js)"
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || cd ./test"
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || $BIN $OPTION ./test.js ../lodash.js"
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
# Test in Sauce Labs.
- "[ $SAUCE_LABS == false ] || node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
- "[ $SAUCE_LABS == false ] || npm run build"
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\""

View File

@@ -1,49 +0,0 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at
[coc@lodash.com](mailto:coc@lodash.com). All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. Maintainers are obligated to maintain
confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

View File

@@ -1,43 +0,0 @@
# Contributing to lodash
Contributions are always welcome. Before contributing, please read the [code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md) & [search the issue tracker](https://github.com/lodash/lodash/issues);
your issue may have already been discussed or fixed in `master`. To contribute, [fork](https://help.github.com/articles/fork-a-repo/) lodash, commit your changes, & [send a pull request](https://help.github.com/articles/using-pull-requests/).
## Tests
Include updated unit tests in the `test` directory as part of your pull request.
Dont worry about regenerating the `dist/` or `doc/` files.
Before running the unit tests youll need to install, `npm i`, [development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
Run unit tests from the command-line via `npm test`, or open `test/index.html` & `test/fp.html` in a web browser.
The [Backbone](http://backbonejs.org/) & [Underscore](http://underscorejs.org/) test suites are included as well.
## Contributor License Agreement
lodash is a member of the [Dojo Foundation](http://dojofoundation.org/).
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
For more information about CLAs, please check out Alex Russells excellent post, [“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
## Coding Guidelines
In addition to the following guidelines, please follow the conventions already established in the code.
- **Spacing**:<br>
Use two spaces for indentation. No tabs.
- **Naming**:<br>
Keep variable & method names concise & descriptive.<br>
Variable names `index`, `collection`, & `callback` are preferable to `i`, `arr`, & `fn`.
- **Quotes**:<br>
Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.
- **Comments**:<br>
Please use single-line comments to annotate significant additions, & [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for functions.
Guidelines are enforced using [JSCS](https://www.npmjs.com/package/jscs):
```bash
$ npm run style
```

29
LICENSE
View File

@@ -1,7 +1,17 @@
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -20,3 +30,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -1,6 +1,15 @@
# lodash v4.0.1
# lodash v4.14.2
The [lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module.
[Site](https://lodash.com/) |
[Docs](https://lodash.com/docs) |
[FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide) |
[Contributing](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md) |
[Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") |
[Code of Conduct](https://jquery.org/conduct/) |
[Twitter](https://twitter.com/bestiejs) |
[Chat](https://gitter.im/lodash/lodash)
The [Lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module.
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
```bash
@@ -9,22 +18,29 @@ $ lodash -o ./dist/lodash.js
$ lodash core -o ./dist/lodash.core.js
```
## Community
## Download
[![Join the chat at https://gitter.im/lodash/lodash](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lodash/lodash)
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.14.2/LICENSE) & supports [modern environments](#support).<br>
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one thats right for you.
## Module formats
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.14.2/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.14.2/dist/lodash.core.min.js))
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.14.2/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.14.2/dist/lodash.min.js))
* [CDN copies](https://www.jsdelivr.com/projects/lodash)
Lodash is also available in a variety of other builds & module formats.
## Why Lodash?
* [lodash](https://www.npmjs.com/package/lodash) & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) packages
* [lodash-amd](https://github.com/lodash/lodash/tree/4.0.1-amd)
* [lodash-es](https://github.com/lodash/lodash/tree/4.0.1-es)
Lodash makes JavaScript easier by taking the hassle out of working with arrays,<br>
numbers, objects, strings, etc. Lodashs modular methods are great for:
## Further Reading
* Iterating arrays, objects, & strings
* Manipulating & testing values
* Creating composite functions
* [API Documentation](https://lodash.com/docs)
* [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences)
* [Changelog](https://github.com/lodash/lodash/wiki/Changelog)
* [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap)
* [More Resources](https://github.com/lodash/lodash/wiki/Resources)
## 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-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)

1872
dist/lodash.core.js vendored

File diff suppressed because it is too large Load Diff

View File

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

1148
dist/lodash.fp.js vendored

File diff suppressed because it is too large Load Diff

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

@@ -1,11 +1,20 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fp=t():e.fp=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e){return i(e,e)}var i=r(1);e.exports=n},function(e,t,r){function n(e,t,r){
if("function"!=typeof r&&(r=t,t=void 0),null==r)throw new TypeError;var u=void 0===t&&"string"==typeof r.VERSION,s=u?r:{ary:e.ary,cloneDeep:e.cloneDeep,curry:e.curry,forEach:e.forEach,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg},c=s.ary,f=s.cloneDeep,p=s.curry,l=s.forEach,h=s.isFunction,d=s.keys,y=s.rearg,g=function(e,t){return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}},m=function(e,t){return 2==t?function(t,r){return e(t,r);
}:function(t){return e(t)}},v=function(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r},W=function(e){return function(t){return e({},t)}},R=function(e,t){return O(e,t,!0)},x=function(e,t){return O(e,function(e){return m(e,t)})},I=function(e,t){return O(e,function(e){var r=t.length;return g(y(m(e,r),t),r)})},O=function(e,t,r){return function(){for(var n=arguments.length,i=Array(n);n--;)i[n]=arguments[n];i[0]=t(i[0]);var a=e.apply(void 0,i);return r?i[0]:a}},k={iteratee:function(e){return function(){
var t=arguments[0],r=arguments[1];r=r>2?r-2:1,t=e(t);var n=t.length;return n&&r>=n?t:m(t,r)}},mixin:function(e){return function(t){var r=this;if(!h(r))return e(r,Object(t));var n=[],i=[];return l(d(t),function(e){var a=t[e];h(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),l(i,function(e,t){var i=n[t];h(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},E=function(e,t){var r=k[e];if(r)return r(t);a.array[e]?t=R(t,v):a.object[e]?t=R(t,W(t)):a.set[e]&&(t=R(t,f));
var n;return l(i.caps,function(r){return l(i.aryMethod[r],function(a){if(e==a){var o=i.iterateeRearg[e],s=!u&&i.aryIteratee[e];return n=c(t,r),r>1&&!i.skipRearg[e]&&(n=y(n,i.methodRearg[e]||i.aryRearg[r])),o?n=I(n,o):s&&(n=x(n,s)),r>1&&(n=p(n,r)),!1}}),!n}),n||(n=t),i.placeholder[e]&&(n.placeholder=o),n};if(!u)return E(t,r);var B=[];return l(i.caps,function(e){l(i.aryMethod[e],function(e){var t=s[i.key[e]||e];t&&B.push([e,E(e,t)])})}),l(B,function(e){s[e[0]]=e[1]}),l(d(s),function(e){l(i.alias[e]||[],function(t){
s[t]=s[e]})}),s}var i=r(2),a=i.mutate,o={};e.exports=n},function(e,t){e.exports={alias:{ary:["nAry"],assignIn:["extend"],assignInWith:["extendWith"],filter:["whereEq"],flatten:["unnest"],flow:["pipe"],flowRight:["compose"],forEach:["each"],forEachRight:["eachRight"],get:["path","prop"],getOr:["pathOr","propOr"],head:["first"],includes:["contains"],initial:["init"],isEqual:["equals"],mapValues:["mapObj"],matchesProperty:["pathEq"],omit:["dissoc","omitAll"],overArgs:["useWith"],overEvery:["allPass"],
overSome:["somePass"],pick:["pickAll"],propertyOf:["propOf"],rest:["unapply"],some:["all"],spread:["apply"],zipObject:["zipObj"]},aryIteratee:{assignWith:2,assignInWith:2,cloneDeepWith:1,cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,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},aryMethod:{1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","template","trim","trimEnd","trimStart","uniqueId","words"],2:["add","after","ary","assign","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","extend","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject"],
3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","isEqualWith","isMatchWith","mergeWith","pullAllBy","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","xorBy","xorWith","zipWith"],4:["fill","setWith"]},aryRearg:{2:[1,0],3:[2,1,0],4:[3,2,0,1]},iterateeRearg:{findKey:[1],findLastKey:[1],mapKeys:[1]},methodRearg:{clamp:[2,0,1],reduce:[2,0,1],reduceRight:[2,0,1],
set:[2,0,1],setWith:[3,1,2,0],slice:[2,0,1],transform:[2,0,1]},caps:[1,2,3,4],key:{curryN:"curry",curryRightN:"curryRight",getOr:"get"},mutate:{array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!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}},placeholder:{bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},skipRearg:{assign:!0,assignIn:!0,concat:!0,defaults:!0,defaultsDeep:!0,
difference:!0,matchesProperty:!0,merge:!0,random:!0,range:!0,rangeRight:!0,zip:!0,zipObject:!0}}}])});
(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()})(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())),
t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(r){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 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=U(e);for(var r=-1,n=e.length,i=n-1,a=z(Object(t)),o=a;null!=o&&++r<n;){
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 J.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;
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=H[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(G,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),
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,
keys:t.keys,rearg:t.rearg,spread:t.spread,toInteger:t.toInteger,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.toInteger,U=w.toPath,G=K(u.aryMethod),H={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){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}},nthArg:function(t){return function(e){var r=e<0?1:V(e)+1;return q(t(e),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 J=r,Q=[];
return P(G,function(t){P(u.aryMethod[t],function(t){var e=J[u.remap[t]||t];e&&Q.push([t,R(t,e)])})}),P(K(J),function(t){var e=J[t];if("function"==typeof e){for(var r=Q.length;r--;)if(Q[r][0]==t)return;e.convert=A(t,e),Q.push([t,e])}}),P(Q,function(t){J[t[0]]=t[1]}),J.convert=v,O&&(J.placeholder=L),P(K(J),function(t){P(u.realToAlias[t]||[],function(e){J[e]=J[t]})}),J}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",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",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","nthArg","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"],
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={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],
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,
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={};
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={}}])});

7410
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

241
dist/lodash.min.js vendored
View File

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

546
dist/mapping.fp.js vendored
View File

@@ -54,209 +54,369 @@ return /******/ (function(modules) { // webpackBootstrap
/* 0 */
/***/ function(module, exports) {
module.exports = {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
/** Used to map method names to their aliases. */
'alias': {
'ary': ['nAry'],
'assignIn': ['extend'],
'assignInWith': ['extendWith'],
'filter': ['whereEq'],
'flatten': ['unnest'],
'flow': ['pipe'],
'flowRight': ['compose'],
'forEach': ['each'],
'forEachRight': ['eachRight'],
'get': ['path', 'prop'],
'getOr': ['pathOr', 'propOr'],
'head': ['first'],
'includes': ['contains'],
'initial': ['init'],
'isEqual': ['equals'],
'mapValues': ['mapObj'],
'matchesProperty': ['pathEq'],
'omit': ['dissoc', 'omitAll'],
'overArgs': ['useWith'],
'overEvery': ['allPass'],
'overSome': ['somePass'],
'pick': ['pickAll'],
'propertyOf': ['propOf'],
'rest': ['unapply'],
'some': ['all'],
'spread': ['apply'],
'zipObject': ['zipObj']
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': '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',
'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'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
'methodOf', 'mixin', 'nthArg', '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'
],
'4': [
'fill', 'setWith', 'updateWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'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
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1]
};
/** Used to map method names to rearg configs. */
exports.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],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': { 'start': 0 },
'assignAllWith': { 'afterRearg': true, 'start': 1 },
'assignInAll': { 'start': 0 },
'assignInAllWith': { 'afterRearg': true, 'start': 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. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
/** Used to map method names to their iteratee ary. */
'aryIteratee': {
'assignWith': 2,
'assignInWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
},
/** Used to map ary to method names. */
'aryMethod': {
1:[
'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs',
'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over',
'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
],
2:[
'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey',
'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey',
'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach',
'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf',
'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy',
'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd',
'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy',
'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject'
],
3:[
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
'unionWith', 'xorBy', 'xorWith', 'zipWith'
],
4:[
'fill', 'setWith'
]
},
/** Used to map ary to rearg configs. */
'aryRearg': {
2: [1, 0],
3: [2, 1, 0],
4: [3, 2, 0, 1]
},
/** Used to map method names to iteratee rearg configs. */
'iterateeRearg': {
'findKey': [1],
'findLastKey': [1],
'mapKeys': [1]
},
/** Used to map method names to rearg configs. */
'methodRearg': {
'clamp': [2, 0, 1],
'reduce': [2, 0, 1],
'reduceRight': [2, 0, 1],
'set': [2, 0, 1],
'setWith': [3, 1, 2, 0],
'slice': [2, 0, 1],
'transform': [2, 0, 1]
},
/** Used to iterate `mapping.aryMethod` keys. */
'caps': [1, 2, 3, 4],
/** Used to map keys to other keys. */
'key': {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get'
},
/** Used to identify methods which mutate arrays or objects. */
'mutate': {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignIn': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'merge': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true
}
},
/** Used to track methods with placeholder support */
'placeholder': {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
},
/** Used to track methods that skip `_.rearg`. */
'skipRearg': {
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'concat': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'difference': true,
'matchesProperty': true,
'defaultsDeepAll': true,
'merge': true,
'random': true,
'range': true,
'rangeRight': true,
'zip': true,
'zipObject': true
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'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'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};
/***/ }
/******/ ])

File diff suppressed because it is too large Load Diff

View File

@@ -1,114 +1,188 @@
var mapping = require('./_mapping'),
mutateMap = mapping.mutate,
placeholder = {};
fallbackHolder = require('./placeholder');
/**
* Creates a function, with an arity of `n`, that invokes `func` with the
* arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} n The arity of the new function.
* @returns {Function} Returns the new function.
*/
function baseArity(func, n) {
return n == 2
? function(a, b) { return func.apply(undefined, arguments); }
: function(a) { return func.apply(undefined, arguments); };
}
/**
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
* any additional arguments.
*
* @private
* @param {Function} func The function to cap arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function baseAry(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
}
/**
* Creates a clone of `array`.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the cloned array.
*/
function cloneArray(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
}
/**
* Creates a function that clones a given object using the assignment `func`.
*
* @private
* @param {Function} func The assignment function.
* @returns {Function} Returns the new cloner function.
*/
function createCloner(func) {
return function(object) {
return func({}, object);
};
}
/**
* Creates a function that wraps `func` and uses `cloner` to clone the first
* argument it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function.
*/
function wrapImmutable(func, cloner) {
return function() {
var length = arguments.length;
if (!length) {
return;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner.apply(undefined, args);
func.apply(undefined, args);
return result;
};
}
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func) {
if (typeof func != 'function') {
function baseConvert(util, name, func, options) {
var setPlaceholder,
isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError;
}
var isLib = name === undefined && typeof func.VERSION == 'string';
options || (options = {});
var _ = isLib ? func : {
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var forceCurry = ('curry' in options) && options.curry,
forceFixed = ('fixed' in options) && options.fixed,
forceRearg = ('rearg' in options) && options.rearg,
placeholder = isLib ? func : fallbackHolder,
pristine = isLib ? func.runInContext() : undefined;
var helpers = isLib ? func : {
'ary': util.ary,
'cloneDeep': util.cloneDeep,
'assign': util.assign,
'clone': util.clone,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isFunction': util.isFunction,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg
'rearg': util.rearg,
'spread': util.spread,
'toInteger': util.toInteger,
'toPath': util.toPath
};
var ary = _.ary,
cloneDeep = _.cloneDeep,
curry = _.curry,
each = _.forEach,
isFunction = _.isFunction,
keys = _.keys,
rearg = _.rearg;
var ary = helpers.ary,
assign = helpers.assign,
clone = helpers.clone,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isFunction = helpers.isFunction,
keys = helpers.keys,
rearg = helpers.rearg,
spread = helpers.spread,
toInteger = helpers.toInteger,
toPath = helpers.toPath;
var baseArity = function(func, n) {
return n == 2
? function(a, b) { return func.apply(undefined, arguments); }
: function(a) { return func.apply(undefined, arguments); };
};
var baseAry = function(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
};
var cloneArray = function(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
};
var createCloner = function(func) {
return function(object) {
return func({}, object);
};
};
var immutWrap = function(func, cloner) {
return overArg(func, cloner, true);
};
var iterateeAry = function(func, n) {
return overArg(func, function(func) {
return baseAry(func, n);
});
};
var iterateeRearg = function(func, indexes) {
return overArg(func, function(func) {
var n = indexes.length;
return baseArity(rearg(baseAry(func, n), indexes), n);
});
};
var overArg = function(func, iteratee, retArg) {
return function() {
var length = arguments.length,
args = Array(length);
while (length--) {
args[length] = arguments[length];
}
args[0] = iteratee(args[0]);
var result = func.apply(undefined, args);
return retArg ? args[0] : result;
};
};
var aryMethodKeys = keys(mapping.aryMethod);
var wrappers = {
'castArray': function(castArray) {
return function() {
var value = arguments[0];
return isArray(value)
? castArray(cloneArray(value))
: castArray.apply(undefined, arguments);
};
},
'iteratee': function(iteratee) {
return function() {
var func = arguments[0],
arity = arguments[1];
arity = arguments[1],
result = iteratee(func, arity),
length = result.length;
arity = arity > 2 ? (arity - 2) : 1;
func = iteratee(func);
var length = func.length;
return (length && length <= arity) ? func : baseAry(func, arity);
if (config.cap && typeof arity == 'number') {
arity = arity > 2 ? (arity - 2) : 1;
return (length && length <= arity) ? result : baseAry(result, arity);
}
return result;
};
},
'mixin': function(mixin) {
@@ -117,105 +191,340 @@ function baseConvert(util, name, func) {
if (!isFunction(func)) {
return mixin(func, Object(source));
}
var methods = [],
methodNames = [];
var pairs = [];
each(keys(source), function(key) {
var value = source[key];
if (isFunction(value)) {
methodNames.push(key);
methods.push(func.prototype[key]);
if (isFunction(source[key])) {
pairs.push([key, func.prototype[key]]);
}
});
mixin(func, Object(source));
each(methodNames, function(methodName, index) {
var method = methods[index];
if (isFunction(method)) {
func.prototype[methodName] = method;
each(pairs, function(pair) {
var value = pair[1];
if (isFunction(value)) {
func.prototype[pair[0]] = value;
} else {
delete func.prototype[methodName];
delete func.prototype[pair[0]];
}
});
return func;
};
},
'nthArg': function(nthArg) {
return function(n) {
var arity = n < 0 ? 1 : (toInteger(n) + 1);
return curry(nthArg(n), arity);
};
},
'rearg': function(rearg) {
return function(func, indexes) {
var arity = indexes ? indexes.length : 0;
return curry(rearg(func, indexes), arity);
};
},
'runInContext': function(runInContext) {
return function(context) {
return baseConvert(util, runInContext(context));
return baseConvert(util, runInContext(context), options);
};
}
};
var wrap = function(name, func) {
var wrapper = wrappers[name];
if (wrapper) {
return wrapper(func);
}
if (mutateMap.array[name]) {
func = immutWrap(func, cloneArray);
}
else if (mutateMap.object[name]) {
func = immutWrap(func, createCloner(func));
}
else if (mutateMap.set[name]) {
func = immutWrap(func, cloneDeep);
}
var result;
each(mapping.caps, function(cap) {
each(mapping.aryMethod[cap], function(otherName) {
if (name == otherName) {
var indexes = mapping.iterateeRearg[name],
n = !isLib && mapping.aryIteratee[name];
/*--------------------------------------------------------------------------*/
result = ary(func, cap);
if (cap > 1 && !mapping.skipRearg[name]) {
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]);
}
if (indexes) {
result = iterateeRearg(result, indexes);
} else if (n) {
result = iterateeAry(result, n);
}
if (cap > 1) {
result = curry(result, cap);
}
/**
* 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`.
*
* @private
* @param {Object} object The object to clone.
* @param {Array|string} path The path to clone by.
* @returns {Object} Returns the cloned object.
*/
function cloneByPath(object, path) {
path = toPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
result = clone(Object(object)),
nested = result;
while (nested != null && ++index < length) {
var key = path[index],
value = nested[key];
if (value != null) {
nested[path[index]] = clone(index == lastIndex ? value : Object(value));
}
nested = nested[key];
}
return result;
}
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied.
*
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function convertLib(options) {
return _.runInContext.convert(options)(undefined);
}
/**
* Create a converter function for `func` of `name`.
*
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @returns {Function} Returns the new converter function.
*/
function createConverter(name, func) {
var oldOptions = options;
return function(options) {
var newUtil = isLib ? pristine : helpers,
newFunc = isLib ? pristine[name] : func,
newOptions = assign(assign({}, oldOptions), options);
return baseConvert(newUtil, name, newFunc, newOptions);
};
}
/**
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
* arguments, ignoring any additional arguments.
*
* @private
* @param {Function} func The function to cap iteratee arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function iterateeAry(func, n) {
return overArg(func, function(func) {
return typeof func == 'function' ? baseAry(func, n) : func;
});
}
/**
* Creates a function that wraps `func` to invoke its iteratee with arguments
* arranged according to the specified `indexes` where the argument value at
* the first index is provided as the first argument, the argument value at
* the second index is provided as the second argument, and so on.
*
* @private
* @param {Function} func The function to rearrange iteratee arguments for.
* @param {number[]} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
*/
function iterateeRearg(func, indexes) {
return overArg(func, function(func) {
var n = indexes.length;
return baseArity(rearg(baseAry(func, n), indexes), n);
});
}
/**
* Creates a function that invokes `func` with its first argument 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() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[index] = transform(args[index]);
return func.apply(undefined, args);
};
}
/**
* Creates a function that wraps `func` and applys the conversions
* rules by `name`.
*
* @private
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @returns {Function} Returns the converted function.
*/
function wrap(name, func) {
name = mapping.aliasToReal[name] || name;
var result,
wrapped = func,
wrapper = wrappers[name];
if (wrapper) {
wrapped = wrapper(func);
}
else if (config.immutable) {
if (mutateMap.array[name]) {
wrapped = wrapImmutable(func, cloneArray);
}
else if (mutateMap.object[name]) {
wrapped = wrapImmutable(func, createCloner(func));
}
else if (mutateMap.set[name]) {
wrapped = wrapImmutable(func, cloneByPath);
}
}
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) {
if (name == otherName) {
var spreadData = mapping.methodSpread[name],
afterRearg = spreadData && spreadData.afterRearg;
result = afterRearg
? castFixed(name, castRearg(name, wrapped, aryKey), aryKey)
: castRearg(name, castFixed(name, wrapped, aryKey), aryKey);
result = castCap(name, result);
result = castCurry(name, result, aryKey);
return false;
}
});
return !result;
});
result || (result = func);
result || (result = wrapped);
if (result == func) {
result = forceCurry ? curry(result, 1) : function() {
return func.apply(this, arguments);
};
}
result.convert = createConverter(name, func);
if (mapping.placeholder[name]) {
result.placeholder = placeholder;
setPlaceholder = true;
result.placeholder = func.placeholder = placeholder;
}
return result;
};
}
if (!isLib) {
/*--------------------------------------------------------------------------*/
if (!isObj) {
return wrap(name, func);
}
// Iterate over methods for the current ary cap.
var _ = func;
// Convert methods by ary cap.
var pairs = [];
each(mapping.caps, function(cap) {
each(mapping.aryMethod[cap], function(key) {
var func = _[mapping.key[key] || key];
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}
});
});
// Convert remaining methods.
each(keys(_), function(key) {
var func = _[key];
if (typeof func == 'function') {
var length = pairs.length;
while (length--) {
if (pairs[length][0] == key) {
return;
}
}
func.convert = createConverter(key, func);
pairs.push([key, func]);
}
});
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function(pair) {
_[pair[0]] = pair[1];
});
// Wrap the lodash method and its aliases.
_.convert = convertLib;
if (setPlaceholder) {
_.placeholder = placeholder;
}
// Assign aliases.
each(keys(_), function(key) {
each(mapping.alias[key] || [], function(alias) {
each(mapping.realToAlias[key] || [], function(alias) {
_[alias] = _[key];
});
});

View File

@@ -1,13 +1,18 @@
var baseConvert = require('./_baseConvert');
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last version.
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied.
*
* @param {Function} lodash The lodash function.
* @param {Function} lodash The lodash function to convert.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function browserConvert(lodash) {
return baseConvert(lodash, lodash);
function browserConvert(lodash, options) {
return baseConvert(lodash, lodash, options);
}
if (typeof _ == 'function') {
_ = browserConvert(_.runInContext());
}
module.exports = browserConvert;

View File

@@ -1,202 +1,362 @@
module.exports = {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
/** Used to map method names to their aliases. */
'alias': {
'ary': ['nAry'],
'assignIn': ['extend'],
'assignInWith': ['extendWith'],
'filter': ['whereEq'],
'flatten': ['unnest'],
'flow': ['pipe'],
'flowRight': ['compose'],
'forEach': ['each'],
'forEachRight': ['eachRight'],
'get': ['path', 'prop'],
'getOr': ['pathOr', 'propOr'],
'head': ['first'],
'includes': ['contains'],
'initial': ['init'],
'isEqual': ['equals'],
'mapValues': ['mapObj'],
'matchesProperty': ['pathEq'],
'omit': ['dissoc', 'omitAll'],
'overArgs': ['useWith'],
'overEvery': ['allPass'],
'overSome': ['somePass'],
'pick': ['pickAll'],
'propertyOf': ['propOf'],
'rest': ['unapply'],
'some': ['all'],
'spread': ['apply'],
'zipObject': ['zipObj']
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': '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',
'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'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
'methodOf', 'mixin', 'nthArg', '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'
],
'4': [
'fill', 'setWith', 'updateWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'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
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1]
};
/** Used to map method names to rearg configs. */
exports.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],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': { 'start': 0 },
'assignAllWith': { 'afterRearg': true, 'start': 1 },
'assignInAll': { 'start': 0 },
'assignInAllWith': { 'afterRearg': true, 'start': 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. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
/** Used to map method names to their iteratee ary. */
'aryIteratee': {
'assignWith': 2,
'assignInWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
},
/** Used to map ary to method names. */
'aryMethod': {
1:[
'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs',
'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over',
'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
],
2:[
'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey',
'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey',
'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach',
'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf',
'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy',
'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd',
'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy',
'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject'
],
3:[
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
'unionWith', 'xorBy', 'xorWith', 'zipWith'
],
4:[
'fill', 'setWith'
]
},
/** Used to map ary to rearg configs. */
'aryRearg': {
2: [1, 0],
3: [2, 1, 0],
4: [3, 2, 0, 1]
},
/** Used to map method names to iteratee rearg configs. */
'iterateeRearg': {
'findKey': [1],
'findLastKey': [1],
'mapKeys': [1]
},
/** Used to map method names to rearg configs. */
'methodRearg': {
'clamp': [2, 0, 1],
'reduce': [2, 0, 1],
'reduceRight': [2, 0, 1],
'set': [2, 0, 1],
'setWith': [3, 1, 2, 0],
'slice': [2, 0, 1],
'transform': [2, 0, 1]
},
/** Used to iterate `mapping.aryMethod` keys. */
'caps': [1, 2, 3, 4],
/** Used to map keys to other keys. */
'key': {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get'
},
/** Used to identify methods which mutate arrays or objects. */
'mutate': {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignIn': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'merge': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true
}
},
/** Used to track methods with placeholder support */
'placeholder': {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
},
/** Used to track methods that skip `_.rearg`. */
'skipRearg': {
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'concat': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'difference': true,
'matchesProperty': true,
'defaultsDeepAll': true,
'merge': true,
'random': true,
'range': true,
'rangeRight': true,
'zip': true,
'zipObject': true
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'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'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};

6
fp/placeholder.js Normal file
View File

@@ -0,0 +1,6 @@
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};

71
lib/common/file.js Normal file
View File

@@ -0,0 +1,71 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
glob = require('glob'),
path = require('path');
var minify = require('../common/minify.js');
/*----------------------------------------------------------------------------*/
/**
* Creates a [fs.copy](https://github.com/jprichardson/node-fs-extra#copy)
* function with `srcPath` and `destPath` partially applied.
*
* @memberOf file
* @param {string} srcPath The path of the file to copy.
* @param {string} destPath The path to copy the file to.
* @returns {Function} Returns the partially applied function.
*/
function copy(srcPath, destPath) {
return _.partial(fs.copy, srcPath, destPath);
}
/**
* Creates an object of base name and compiled template pairs that match `pattern`.
*
* @memberOf file
* @param {string} pattern The glob pattern to be match.
* @returns {Object} Returns the object of compiled templates.
*/
function globTemplate(pattern) {
return _.transform(glob.sync(pattern), function(result, filePath) {
var key = path.basename(filePath, path.extname(filePath));
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
}, {});
}
/**
* Creates a `minify` function with `srcPath` and `destPath` partially applied.
*
* @memberOf file
* @param {string} srcPath The path of the file to minify.
* @param {string} destPath The path to write the file to.
* @returns {Function} Returns the partially applied function.
*/
function min(srcPath, destPath) {
return _.partial(minify, srcPath, destPath);
}
/**
* Creates a [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
* function with `filePath` and `data` partially applied.
*
* @memberOf file
* @param {string} destPath The path to write the file to.
* @param {string} data The data to write to the file.
* @returns {Function} Returns the partially applied function.
*/
function write(destPath, data) {
return _.partial(fs.writeFile, destPath, data);
}
/*----------------------------------------------------------------------------*/
module.exports = {
'copy': copy,
'globTemplate': globTemplate,
'min': min,
'write': write
};

9
lib/common/mapping.js Normal file
View File

@@ -0,0 +1,9 @@
'use strict';
var _mapping = require('../../fp/_mapping'),
util = require('./util'),
Hash = util.Hash;
/*----------------------------------------------------------------------------*/
module.exports = new Hash(_mapping);

View File

@@ -4,23 +4,36 @@ var _ = require('lodash'),
fs = require('fs-extra'),
uglify = require('uglify-js');
var uglifyOptions = require('./uglify.options.js');
var uglifyOptions = require('./uglify.options');
/*----------------------------------------------------------------------------*/
function minify(inpath, outpath, callback, options) {
if (_.isFunction(outpath)) {
/**
* Asynchronously minifies the file at `srcPath`, writes it to `destPath`, and
* invokes `callback` upon completion. The callback is invoked with one argument:
* (error).
*
* If unspecified, `destPath` is `srcPath` with an extension of `.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} [destPath] The path to write the file to.
* @param {Function} callback The function invoked upon completion.
* @param {Object} [option] The UglifyJS options object.
*/
function minify(srcPath, destPath, callback, options) {
if (_.isFunction(destPath)) {
if (_.isObject(callback)) {
options = callback;
}
callback = outpath;
outpath = undefined;
callback = destPath;
destPath = undefined;
}
if (!outpath) {
outpath = inpath.replace(/(?=\.js$)/, '.min');
if (!destPath) {
destPath = srcPath.replace(/(?=\.js$)/, '.min');
}
var output = uglify.minify(inpath, _.defaults(options || {}, uglifyOptions));
fs.writeFile(outpath, output.code, 'utf-8', callback);
var output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
fs.writeFile(destPath, output.code, 'utf-8', callback);
}
module.exports = minify;

View File

@@ -1,16 +1,21 @@
'use strict';
/**
* The UglifyJS options object for
* [compress](https://github.com/mishoo/UglifyJS2#compressor-options),
* [mangle](https://github.com/mishoo/UglifyJS2#mangler-options), and
* [output](https://github.com/mishoo/UglifyJS2#beautifier-options) options.
*/
module.exports = {
'compress': {
'negate_iife': false,
'pure_getters': true,
'unsafe': true,
'unsafe_comps': true,
'warnings': false
},
'mangle': {
'except': ['define']
},
'output': {
'ascii_only': true,
'comments': /^!|@cc_on|@license|@preserve/i,
'comments': /@license/,
'max_line_len': 500
}
};

40
lib/common/util.js Normal file
View File

@@ -0,0 +1,40 @@
'use strict';
var _ = require('lodash');
/*----------------------------------------------------------------------------*/
/**
* Creates a hash object. If a `properties` object is provided, its own
* enumerable properties are assigned to the created hash.
*
* @memberOf util
* @param {Object} [properties] The properties to assign to the hash.
* @returns {Object} Returns the new hash object.
*/
function Hash(properties) {
return _.transform(properties, function(result, value, key) {
result[key] = (_.isPlainObject(value) && !(value instanceof Hash))
? new Hash(value)
: value;
}, this);
}
Hash.prototype = Object.create(null);
/**
* 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 = {
'Hash': Hash,
'pitch': pitch
};

View File

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

81
lib/fp/build-doc.js Normal file
View File

@@ -0,0 +1,81 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
path = require('path');
var file = require('../common/file'),
mapping = require('../common/mapping'),
util = require('../common/util');
var templatePath = path.join(__dirname, 'template/doc'),
template = file.globTemplate(path.join(templatePath, '*.jst'));
var argNames = ['a', 'b', 'c', 'd'];
var templateData = {
'mapping': mapping,
'toArgOrder': toArgOrder,
'toFuncList': toFuncList
};
/**
* Converts arranged argument `indexes` into a named argument string
* representation of their order.
*
* @private
* @param {number[]} indexes The arranged argument indexes.
* @returns {string} Returns the named argument string.
*/
function toArgOrder(indexes) {
var reordered = [];
_.each(indexes, function(newIndex, index) {
reordered[newIndex] = argNames[index];
});
return '`(' + reordered.join(', ') + ')`';
}
/**
* Converts `funcNames` into a chunked list string representation.
*
* @private
* @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),
last = lastChunk ? lastChunk.pop() : undefined;
chunks = _.reject(chunks, _.isEmpty);
lastChunk = _.last(chunks);
var result = '`' + _.map(chunks, function(chunk) {
return chunk.join('`, `') + '`';
}).join(',\n`');
if (last == null) {
return result;
}
if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
result += ',';
}
result += ' &';
result += _.size(lastChunk) < 5 ? ' ' : '\n';
return result + '`' + last + '`';
}
/*----------------------------------------------------------------------------*/
/**
* Creates the FP-Guide wiki at the `target` path.
*
* @private
* @param {string} target The output file path.
*/
function build(target) {
target = path.resolve(target);
fs.writeFile(target, template.wiki(templateData), util.pitch);
}
build(_.last(process.argv));

150
lib/fp/build-modules.js Normal file
View File

@@ -0,0 +1,150 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
glob = require('glob'),
path = require('path');
var file = require('../common/file'),
mapping = require('../common/mapping'),
util = require('../common/util');
var templatePath = path.join(__dirname, 'template/modules'),
template = file.globTemplate(path.join(templatePath, '*.jst'));
var aryMethods = _.union(
mapping.aryMethod[1],
mapping.aryMethod[2],
mapping.aryMethod[3],
mapping.aryMethod[4]
);
var categories = [
'array',
'collection',
'date',
'function',
'lang',
'math',
'number',
'object',
'seq',
'string',
'util'
];
var ignored = [
'_*.js',
'core.js',
'core.min.js',
'fp.js',
'index.js',
'lodash.js',
'lodash.min.js'
];
/**
* Checks if `name` is a method alias.
*
* @private
* @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);
}
/**
* Checks if `name` is a category name.
*
* @private
* @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);
}
/**
* Checks if `name` belongs to a method that's passed thru and not wrapped.
*
* @private
* @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) {
var data = {
'name': _.get(mapping.aliasToReal, moduleName, moduleName),
'mapping': mapping
};
if (isAlias(moduleName)) {
return template.alias(data);
}
if (isCategory(moduleName)) {
return template.category(data);
}
if (isThru(moduleName)) {
return template.thru(data);
}
return template.module(data);
}
/*----------------------------------------------------------------------------*/
/**
* Creates FP modules at the `target` path.
*
* @private
* @param {string} target The output directory path.
*/
function build(target) {
target = path.resolve(target);
var fpPath = path.join(target, 'fp');
// Glob existing lodash module paths.
var modulePaths = glob.sync(path.join(target, '*.js'), {
'nodir': true,
'ignore': ignored.map(function(filename) {
return path.join(target, filename);
})
});
// Add FP alias and remapped module paths.
_.each([mapping.aliasToReal, mapping.remap], function(data) {
_.forOwn(data, function(realName, alias) {
var modulePath = path.join(target, alias + '.js');
if (!_.includes(modulePaths, modulePath)) {
modulePaths.push(modulePath);
}
});
});
var actions = modulePaths.map(function(modulePath) {
var moduleName = path.basename(modulePath, '.js');
return file.write(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
});
actions.unshift(file.copy(path.join(__dirname, '../../fp'), fpPath));
actions.push(file.write(path.join(fpPath, '_falseOptions.js'), template._falseOptions()));
actions.push(file.write(path.join(fpPath, '_util.js'), template._util()));
actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
async.series(actions, util.pitch);
}
build(_.last(process.argv));

View File

@@ -1,10 +0,0 @@
module.exports = {
'ary': require('../ary'),
'cloneDeep': require('../cloneDeep'),
'curry': require('../curry'),
'forEach': require('../internal/arrayEach'),
'isFunction': require('../isFunction'),
'iteratee': require('../iteratee'),
'keys': require('../internal/baseKeys'),
'rearg': require('../rearg')
};

View File

@@ -0,0 +1,227 @@
## lodash/fp
The `lodash/fp` module promotes a more
[functional programming](https://en.wikipedia.org/wiki/Functional_programming)
(FP) friendly style by exporting an instance of `lodash` with its methods wrapped
to produce immutable auto-curried iteratee-first data-last methods.
## Installation
In a browser:
```html
<script src='path/to/lodash.js'></script>
<script src='path/to/lodash.fp.js'></script>
<script>
// Loading `lodash.fp.js` converts `_` to its fp variant.
_.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
// ➜ { 'a: 1, 'b': 2 }
// Use `noConflict` to restore the pre-fp variant.
var fp = _.noConflict();
_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 });
// ➜ { 'a: 1, 'b': 2 }
fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
// ➜ { 'a: 1, 'b': 2 }
</script>
```
In Node.js:
```js
// Load the fp build.
var fp = require('lodash/fp');
// Load a method category.
var object = require('lodash/fp/object');
// Load a single method for smaller builds with browserify/rollup/webpack.
var extend = require('lodash/fp/extend');
```
## Mapping
Immutable auto-curried iteratee-first data-last methods sound great, but what
does that really mean for each method? Below is a breakdown of the mapping used
to convert each method.
#### Capped Iteratee Arguments
Iteratee arguments are capped to avoid gotchas with variadic iteratees.
```js
// The `lodash/map` iteratee receives three arguments:
// (value, index|key, collection)
_.map(['6', '8', '10'], parseInt);
// ➜ [6, NaN, 2]
// The `lodash/fp/map` iteratee is capped at one argument:
// (value)
fp.map(parseInt)(['6', '8', '10']);
// ➜ [6, 8, 10]
```
Methods that cap iteratees to one argument:<br>
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 1)))) %>
Methods that cap iteratees to two arguments:<br>
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 2)))) %>
The iteratee of `mapKeys` is invoked with one argument: (key)
#### Fixed Arity
Methods have fixed arities to support auto-currying.
```js
// `lodash/padStart` accepts an optional `chars` param.
_.padStart('a', 3, '-')
// ➜ '--a'
// `lodash/fp/padStart` does not.
fp.padStart(3)('a');
// ➜ ' a'
fp.padCharsStart('-')(3)('a');
// ➜ '--a'
```
Methods with a fixed arity of one:<br>
<%= toFuncList(_.difference(mapping.aryMethod[1], _.keys(mapping.skipFixed))) %>
Methods with a fixed arity of two:<br>
<%= toFuncList(_.difference(mapping.aryMethod[2], _.keys(mapping.skipFixed))) %>
Methods with a fixed arity of three:<br>
<%= toFuncList(_.difference(mapping.aryMethod[3], _.keys(mapping.skipFixed))) %>
Methods with a fixed arity of four:<br>
<%= toFuncList(_.difference(mapping.aryMethod[4], _.keys(mapping.skipFixed))) %>
#### Rearranged Arguments
Method arguments are rearranged to make composition easier.
```js
// `lodash/filter` is data-first iteratee-last:
// (collection, iteratee)
var compact = _.partial(_.filter, _, Boolean);
compact(['a', null, 'c']);
// ➜ ['a', 'c']
// `lodash/fp/filter` is iteratee-first data-last:
// (iteratee, collection)
var compact = fp.filter(Boolean);
compact(['a', null, 'c']);
// ➜ ['a', 'c']
```
##### Most methods follow these rules
A fixed arity of two has an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[2]) %>
A fixed arity of three has an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[3]) %>
A fixed arity of four has an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[4]) %>
##### Exceptions to the rules
Methods that accept an array of arguments:<br>
<%= toFuncList(_.keys(mapping.methodSpread)) %>
Methods with unchanged argument orders:<br>
<%= toFuncList(_.keys(mapping.skipRearg)) %>
Methods with custom argument orders:<br>
<%= _.map(_.keys(mapping.methodRearg), function(methodName) {
var orders = mapping.methodRearg[methodName];
return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
}).join('\n') %>
#### New Methods
Not all variadic methods have corresponding new method variants. Feel free to
[request](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md#feature-requests)
any additions.
Methods created to accommodate Lodashs variadic methods:<br>
<%= toFuncList(_.keys(mapping.remap)) %>
#### Aliases
There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
<%= _.map(_.keys(mapping.aliasToReal).sort(), function(alias) {
var realName = mapping.aliasToReal[alias];
return ' * `_.' + alias + '` is an alias of `_.' + realName + '`';
}).join('\n') %>
## Placeholders
The placeholder argument, which defaults to `_`, may be used to fill in method
arguments in a different order. Placeholders are filled by the first available
arguments of the curried returned function.
```js
// The equivalent of `2 > 5`.
_.gt(2)(5);
// ➜ false
// The equivalent of `_.gt(5, 2)` or `5 > 2`.
_.gt(_, 2)(5);
// ➜ true
```
## Chaining
The `lodash/fp` module **does not** convert chain sequence methods. See
[Izaak Schroeders article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
on using functional composition as an alternative to method chaining.
## Convert
Although `lodash/fp` & its method modules come pre-converted, there are times
when you may want to customize the conversion. Thats when the `convert` method
comes in handy.
```js
// Every option is `true` by default.
var _fp = fp.convert({
// Specify capping iteratee arguments.
'cap': true,
// Specify currying.
'curry': true,
// Specify fixed arity.
'fixed': true,
// Specify immutable operations.
'immutable': true,
// Specify rearranging arguments.
'rearg': true
});
// The `convert` method is available on each method too.
var mapValuesWithKey = fp.mapValues.convert({ 'cap': false });
// Heres an example of disabling iteratee argument caps to access the `key` param.
mapValuesWithKey(function(value, key) {
return key == 'a' ? -1 : value;
})({ 'a': 1, 'b': 1 });
// => { 'a': -1, 'b': 1 }
```
Manual conversions are also possible with the `convert` module.
```js
var convert = require('lodash/fp/convert');
// Convert by name.
var assign = convert('assign', require('lodash.assign'));
// Convert by object.
var fp = convert({
'assign': require('lodash.assign'),
'chunk': require('lodash.chunk')
});
// Convert by `lodash` instance.
var fp = convert(lodash.runInContext());
```
## Tooling
Use [eslint-plugin-lodash-fp](https://www.npmjs.com/package/eslint-plugin-lodash-fp)
to help use `lodash/fp` more efficiently.

View File

@@ -0,0 +1,7 @@
module.exports = {
'cap': false,
'curry': false,
'fixed': false,
'immutable': false,
'rearg': false
};

View File

@@ -0,0 +1,15 @@
module.exports = {
'ary': require('../ary'),
'assign': require('../_baseAssign'),
'clone': require('../clone'),
'curry': require('../curry'),
'forEach': require('../_arrayEach'),
'isArray': require('../isArray'),
'isFunction': require('../isFunction'),
'iteratee': require('../iteratee'),
'keys': require('../_baseKeys'),
'rearg': require('../rearg'),
'spread': require('../spread'),
'toInteger': require('../toInteger'),
'toPath': require('../toPath')
};

View File

@@ -0,0 +1 @@
module.exports = require('./<%= name %>');

View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../<%= name %>'));

View File

@@ -3,14 +3,16 @@ var baseConvert = require('./_baseConvert'),
/**
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
* version. If `name` is an object its methods will be converted.
* version with conversion `options` applied. If `name` is an object its methods
* will be converted.
*
* @param {string} name The name of the function to wrap.
* @param {Function} [func] The function to wrap.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function|Object} Returns the converted function or object.
*/
function convert(name, func) {
return baseConvert(util, name, func);
function convert(name, func, options) {
return baseConvert(util, name, func, options);
}
module.exports = convert;

View File

@@ -0,0 +1,2 @@
var _ = require('./lodash.min').runInContext();
module.exports = require('./fp/_baseConvert')(_, _);

View File

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

View File

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

View File

@@ -1,11 +1,10 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
fs = require('fs-extra'),
var async = require('async'),
path = require('path');
var minify = require('../common/minify.js');
var file = require('../common/file'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'),
@@ -16,13 +15,17 @@ var baseLodash = path.join(basePath, filename),
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
/**
* Creates browser builds of Lodash at the `target` path.
*
* @private
* @param {string} target The output directory path.
*/
function build() {
async.series([
file.copy(baseLodash, distLodash),
file.min(distLodash)
], util.pitch);
}
async.series([
_.partial(fs.copy, baseLodash, distLodash),
_.partial(minify, distLodash)
], onComplete);
build();

83
lib/main/build-doc.js Normal file
View File

@@ -0,0 +1,83 @@
'use strict';
var _ = require('lodash'),
docdown = require('docdown'),
fs = require('fs-extra'),
path = require('path');
var util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'),
docPath = path.join(basePath, 'doc'),
readmePath = path.join(docPath, 'README.md');
var pkg = require('../../package.json'),
version = pkg.version;
var config = {
'base': {
'path': path.join(basePath, 'lodash.js'),
'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
'toc': 'categories',
'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
},
'github': {
'style': 'github',
'sublinks': [npmLink('&#x24C3;', 'See the npm package')]
},
'site': {
'entryLink': '<a href="${entryHref}" class="fa fa-link"></a>',
'sourceLink': '[source](${sourceHref})',
'tocHref': '',
'tocLink': '',
'sublinks': [npmLink('npm package')]
}
};
/**
* Composes a npm link from `text` and optional `title`.
*
* @private
* @param {string} text The link text.
* @param {string} [title] The link title.
* @returns {string} Returns the composed npm link.
*/
function npmLink(text, title) {
return (
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
'print(' +
'"[' + text + '](https://www.npmjs.com/package/lodash." + name.toLowerCase() + ' +
'"' + (title == null ? '' : ' \\"' + title + '\\"') + ')"' +
');' +
'} %>'
);
}
/**
* Post-process `markdown` to make adjustments.
*
* @private
* @param {string} markdown The markdown to process.
* @returns {string} Returns the processed markdown.
*/
function postprocess(markdown) {
// Wrap symbol property identifiers in brackets.
return markdown.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
}
/*----------------------------------------------------------------------------*/
/**
* Creates the documentation markdown formatted for 'github' or 'site'.
*
* @private
* @param {string} type The format type.
*/
function build(type) {
var options = _.defaults({}, config.base, config[type]),
markdown = docdown(options);
fs.writeFile(readmePath, postprocess(markdown), util.pitch);
}
build(_.last(process.argv));

35
lib/main/build-modules.js Normal file
View File

@@ -0,0 +1,35 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
path = require('path');
var file = require('../common/file'),
util = require('../common/util');
var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist');
var filePairs = [
[path.join(distPath, 'lodash.core.js'), 'core.js'],
[path.join(distPath, 'lodash.core.min.js'), 'core.min.js'],
[path.join(distPath, 'lodash.min.js'), 'lodash.min.js']
];
/*----------------------------------------------------------------------------*/
/**
* Creates supplementary Lodash modules at the `target` path.
*
* @private
* @param {string} target The output directory path.
*/
function build(target) {
var actions = _.map(filePairs, function(pair) {
return file.copy(pair[0], path.join(target, pair[1]));
});
async.series(actions, util.pitch);
}
build(_.last(process.argv));

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

@@ -0,0 +1,73 @@
'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) {
var markdown = fs
// Load markdown.
.readFileSync(readmePath, 'utf8')
// Uncomment docdown HTML hints.
.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 marky-markdown additions.
$('[id^="user-content-"]')
.attr('class', null)
.attr('id', null);
$(':header:not(h3) > a').each(function() {
var $a = $(this);
$a.replaceWith($a.html());
});
// Fix marky-markdown wrapping around headers.
$('p:empty + h3').prev().remove();
$('h3 ~ p:empty').each(function() {
var $p = $(this),
node = this.previousSibling;
while ((node = node.previousSibling) && node.name != 'h3' && node.name != 'p') {
$p.prepend(node.nextSibling);
}
});
$('h3 code em').parent().each(function() {
var $code = $(this);
$code.html($code.html().replace(/<\/?em>/g, '_'));
});
var html = [
// Append YAML front matter.
'---',
'id: docs',
'layout: docs',
'title: Lodash Documentation',
'version: ' + (version || null),
'---',
'',
// Wrap in raw tags to avoid Liquid template tag processing.
'{% raw %}',
_.trim($.html()),
'{% endraw %}',
''
].join('\n');
fs.writeFile(path.join(docPath, version + '.html'), html, util.pitch);
}
build();

7410
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,35 +1,57 @@
{
"name": "lodash",
"version": "4.0.1",
"main": "lodash.js",
"version": "4.14.2",
"license": "MIT",
"private": true,
"devDependencies": {
"async": "^1.5.2",
"chalk": "^1.1.1",
"codecov.io": "~0.1.6",
"coveralls": "^2.11.6",
"curl-amd": "~0.8.12",
"docdown": "~0.3.0",
"dojo": "^1.10.4",
"ecstatic": "^1.4.0",
"fs-extra": "~0.26.4",
"glob": "^6.0.4",
"istanbul": "0.4.2",
"jquery": "^2.2.0",
"jscs": "^2.8.0",
"lodash": "^3.10.1",
"platform": "^1.3.1",
"qunit-extras": "^1.4.5",
"qunitjs": "~1.20.0",
"request": "^2.67.0",
"requirejs": "^2.1.22",
"sauce-tunnel": "2.3.0",
"uglify-js": "2.6.1",
"webpack": "^1.12.11"
},
"main": "lodash.js",
"scripts": {
"build": "node lib/main/build-dist.js && node lib/fp/build-dist.js",
"style": "jscs lodash.js lib/**/*.js",
"test": "npm run build && node test/test && node test/test-fp"
"build": "npm run build:main && npm run build:fp",
"build:fp": "node lib/fp/build-dist.js",
"build:fp-modules": "node lib/fp/build-modules.js",
"build:main": "node lib/main/build-dist.js",
"build:main-modules": "node lib/main/build-modules.js",
"doc": "node lib/main/build-doc github && npm run test:doc",
"doc:fp": "node lib/fp/build-doc",
"doc:site": "node lib/main/build-doc site",
"doc:sitehtml": "optional-dev-dependency marky-markdown@^8.0.0 && npm run doc:site && node lib/main/build-site",
"pretest": "npm run build",
"style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test",
"style:fp": "jscs fp/*.js lib/**/*.js",
"style:main": "jscs lodash.js",
"style:perf": "jscs perf/*.js perf/**/*.js",
"style:test": "jscs test/*.js test/**/*.js",
"test": "npm run test:main && npm run test:fp",
"test:doc": "markdown-doctest",
"test:fp": "node test/test-fp",
"test:main": "node test/test",
"validate": "npm run style && npm run test"
},
"devDependencies": {
"async": "^2.0.1",
"benchmark": "^2.1.1",
"chalk": "^1.1.3",
"codecov.io": "~0.1.6",
"coveralls": "^2.11.12",
"curl-amd": "~0.8.12",
"docdown": "~0.7.1",
"dojo": "^1.11.2",
"ecstatic": "^1.4.1",
"fs-extra": "~0.30.0",
"glob": "^7.0.5",
"istanbul": "0.4.4",
"jquery": "^3.1.0",
"jscs": "^3.0.7",
"lodash": "4.14.1",
"lodash-doc-globals": "^0.1.1",
"markdown-doctest": "^0.8.1",
"optional-dev-dependency": "^1.3.0",
"platform": "^1.3.1",
"qunit-extras": "^2.1.0",
"qunitjs": "^2.0.1",
"request": "^2.74.0",
"requirejs": "^2.2.0",
"sauce-tunnel": "^2.5.0",
"uglify-js": "2.7.0",
"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.
addListener(window, 'load', function() {
addEventListener('load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
otherIndex = otherList.selectedIndex,
@@ -96,8 +77,8 @@
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(otherList, 'change', eventHandler);
buildList.addEventListener('change', eventHandler);
otherList.addEventListener('change', eventHandler);
});
// The lodash build file path.

View File

@@ -10,23 +10,34 @@
height: 100%;
}
#FirebugUI {
top: 2em;
top: 2.5em;
}
#perf-toolbar {
background-color: #EEE;
color: #5E740B;
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
font-size: small;
padding: 0.5em 0 0.5em 2em;
padding: 0.5em 1em 0.5em 1em;
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>
</head>
<body>
<div id="perf-toolbar"></div>
<script src="../node_modules/platform/platform.js"></script>
<script src="../lodash.js"></script>
<script src="../vendor/benchmark.js/benchmark.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="../node_modules/benchmark/benchmark.js"></script>
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="./asset/perf-ui.js"></script>
<script>

View File

@@ -1,4 +1,5 @@
;(function() {
'use strict';
/** Used to access the Firebug Lite panel (set by `run`). */
var fbPanel;
@@ -43,11 +44,11 @@
if (!amd) {
try {
result = require('fs').realpathSync(result);
} catch(e) {}
} catch (e) {}
try {
result = require.resolve(result);
} catch(e) {}
} catch (e) {}
}
return result;
}());
@@ -82,12 +83,6 @@
/** Used to queue benchmark suites. */
var suites = [];
/** Used to resolve a value's internal [[Class]]. */
var toString = Object.prototype.toString;
/** Detect if in a browser environment. */
var isBrowser = isHostType(root, 'document') && isHostType(root, 'navigator');
/** Use a single "load" function. */
var load = (typeof require == 'function' && !amd)
? require
@@ -109,7 +104,7 @@
/** Load Benchmark.js. */
var Benchmark = root.Benchmark || (root.Benchmark = (
Benchmark = load('../vendor/benchmark.js/benchmark.js') || root.Benchmark,
Benchmark = load('../node_modules/benchmark/benchmark.js') || root.Benchmark,
Benchmark = Benchmark.Benchmark || Benchmark,
Benchmark.runInContext(lodash.extend({}, root, { '_': lodash }))
));
@@ -565,11 +560,11 @@
suites.push(
Benchmark.Suite('`_.assign`')
.add(buildName, {
'fn': 'lodashAssign({}, object)',
'fn': 'lodashAssign({}, { "a": 1, "b": 2, "c": 3 })',
'teardown': 'function assign(){}'
})
.add(otherName, {
'fn': '_assign({}, object)',
'fn': '_assign({}, { "a": 1, "b": 2, "c": 3 })',
'teardown': 'function assign(){}'
})
);
@@ -577,11 +572,11 @@
suites.push(
Benchmark.Suite('`_.assign` with multiple sources')
.add(buildName, {
'fn': 'lodashAssign({}, object, object)',
'fn': 'lodashAssign({}, { "a": 1, "b": 2 }, { "c": 3, "d": 4 })',
'teardown': 'function assign(){}'
})
.add(otherName, {
'fn': '_assign({}, object, object)',
'fn': '_assign({}, { "a": 1, "b": 2 }, { "c": 3, "d": 4 })',
'teardown': 'function assign(){}'
})
);

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.
addListener(window, 'load', function() {
addEventListener('load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
loaderIndex = loaderList.selectedIndex,
@@ -59,8 +40,8 @@
setTimeout(init, 15);
return;
}
toolbar.appendChild(span1);
toolbar.appendChild(span2);
toolbar.insertBefore(span2, toolbar.lastChild);
toolbar.insertBefore(span1, span2);
buildList.selectedIndex = (function() {
switch (build) {
@@ -84,12 +65,11 @@
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(loaderList, 'change', eventHandler);
buildList.addEventListener('change', eventHandler);
loaderList.addEventListener('change', eventHandler);
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
@@ -100,7 +80,6 @@
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-loader">Loader: </label>' +
'<select id="qunit-loader">' +
@@ -110,6 +89,12 @@
'<option value="requirejs">RequireJS</option>' +
'</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,
loaderList = span2.lastChild;
@@ -154,13 +139,13 @@
ui.isForeign = RegExp('^(\\w+:)?//').test(build);
// Used to indicate testing a modularized build.
ui.isModularize = /\b(?:amd|commonjs|es6?|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
ui.isModularize = /\b(?:amd|commonjs|es|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
// Used to indicate testing in Sauce Labs' automated test cloud.
ui.isSauceLabs = location.port == '9001';
// Used to indicate that lodash is in strict mode.
ui.isStrict = /\bes6?\b/.test([location.pathname, location.search]);
ui.isStrict = /\bes\b/.test([location.pathname, location.search]);
ui.urlParams = { 'build': build, 'loader': loader };
ui.timing = { 'loadEventEnd': 0 };

View File

@@ -1,11 +1,16 @@
'use strict';
self.console || (self.console = { 'log': function() {} });
addEventListener('message', function(e) {
if (e.data) {
try {
importScripts('../' + e.data);
} catch(e) {
self._ = { 'VERSION': e.message };
} catch (e) {
var lineNumber = e.lineNumber,
message = (lineNumber == null ? '' : (lineNumber + ': ')) + e.message;
self._ = { 'VERSION': message };
}
postMessage(_.VERSION);
}

View File

@@ -51,6 +51,7 @@
'groupBy',
'includes',
'invert',
'invokeMap',
'keyBy',
'omit',
'partition',

View File

@@ -22,7 +22,7 @@
};
}
</script>
<script src="../node_modules/lodash/index.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>
<script>var lodashStable = _.noConflict();</script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
@@ -82,6 +82,22 @@
funcProto._method = noop;
// Set bad shims.
setProperty(Object, '_create', Object.create);
setProperty(Object, 'create', (function() {
function object() {}
return function(prototype) {
if (prototype === Object(prototype)) {
object.prototype = prototype;
var result = new object;
object.prototype = undefined;
}
return result || {};
};
}()));
setProperty(Object, '_getOwnPropertySymbols', Object.getOwnPropertySymbols);
setProperty(Object, 'getOwnPropertySymbols', undefined);
setProperty(objectProto, '_propertyIsEnumerable', propertyIsEnumerable);
setProperty(objectProto, 'propertyIsEnumerable', function(key) {
return !(key == 'valueOf' && this && this.valueOf === 1) && _propertyIsEnumerable.call(this, key);
@@ -103,11 +119,8 @@
setProperty(Map, 'toString', createToString('Map'));
}
setProperty(Object, '_create', Object.create);
setProperty(Object, 'create', noop);
setProperty(Object, '_getOwnPropertySymbols', Object.getOwnPropertySymbols);
setProperty(Object, 'getOwnPropertySymbols', undefined);
setProperty(window, '_Promise', window.Promise);
setProperty(window, 'Promise', noop);
setProperty(window, '_Set', window.Set);
setProperty(window, 'Set', noop);
@@ -131,6 +144,8 @@
var funcProto = Function.prototype,
objectProto = Object.prototype;
setProperty(objectProto, 'propertyIsEnumerable', objectProto._propertyIsEnumerable);
if (Object._create) {
Object.create = Object._create;
} else {
@@ -146,6 +161,11 @@
} else {
setProperty(window, 'Map', undefined);
}
if (_Promise) {
Promise = _Promise;
} else {
setProperty(window, 'Promise', undefined);
}
if (_Set) {
Set = _Set;
} else {
@@ -159,9 +179,8 @@
} else {
setProperty(window, 'WeakMap', undefined);
}
setProperty(objectProto, 'propertyIsEnumerable', objectProto._propertyIsEnumerable);
setProperty(window, '_Map', undefined);
setProperty(window, '_Promise', undefined);
setProperty(window, '_Set', undefined);
setProperty(window, '_Symbol', undefined);
setProperty(window, '_WeakMap', undefined);
@@ -173,9 +192,9 @@
setProperty(window, 'module', document.getElementById('module'));
delete funcProto._method;
delete objectProto._propertyIsEnumerable;
delete Object._create;
delete Object._getOwnPropertySymbols;
delete objectProto._propertyIsEnumerable;
}
// Load lodash to expose it to the bad extensions/shims.
@@ -286,9 +305,9 @@
if (ui.isModularize) {
require(getConfig(), [
'lodash/internal/baseEach',
'lodash/internal/isIndex',
'lodash/internal/isIterateeCall'
'lodash/_baseEach',
'lodash/_isIndex',
'lodash/_isIterateeCall'
], function(baseEach, isIndex, isIterateeCall) {
lodash._baseEach = baseEach;
lodash._isIndex = isIndex;

View File

@@ -1,15 +1,15 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs'),
var _ = require('../lodash'),
fs = require('fs'),
path = require('path');
var args = (args = process.argv)
.slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0);
var filePath = path.resolve(args[1]),
reLine = /.*/gm,
slice = Array.prototype.slice;
reLine = /.*/gm;
var pattern = (function() {
var result = args[0],
@@ -22,6 +22,6 @@ var pattern = (function() {
/*----------------------------------------------------------------------------*/
fs.writeFileSync(filePath, fs.readFileSync(filePath, 'utf8').replace(pattern, function(match) {
var snippet = slice.call(arguments, -3, -1)[0];
var snippet = _.slice(arguments, -3, -2)[0];
return match.replace(snippet, snippet.replace(reLine, ''));
}));

View File

@@ -97,17 +97,18 @@ var browserNameMap = {
'googlechrome': 'Chrome',
'iehta': 'Internet Explorer',
'ipad': 'iPad',
'iphone': 'iPhone'
'iphone': 'iPhone',
'microsoftedge': 'Edge'
};
/** List of platforms to load the runner on. */
var platforms = [
['Linux', 'android', '5.1'],
['Windows 10', 'chrome', '47'],
['Windows 10', 'chrome', '46'],
['Windows 10', 'firefox', '43'],
['Windows 10', 'firefox', '42'],
['Windows 10', 'microsoftedge', '20.10240'],
['Windows 10', 'chrome', '51'],
['Windows 10', 'chrome', '50'],
['Windows 10', 'firefox', '47'],
['Windows 10', 'firefox', '46'],
['Windows 10', 'microsoftedge', '13'],
['Windows 10', 'internet explorer', '11'],
['Windows 8', 'internet explorer', '10'],
['Windows 7', 'internet explorer', '9'],
@@ -213,18 +214,7 @@ if (tunneled) {
* @returns {string} Returns the formal browser name.
*/
function browserName(identifier) {
return browserNameMap[identifier] || capitalizeWords(identifier);
}
/**
* Capitalizes the first character of each word in `string`.
*
* @private
* @param {string} string The string to augment.
* @returns {string} Returns the augmented string.
*/
function capitalizeWords(string) {
return _.map(string.split(' '), _.capitalize).join(' ');
return browserNameMap[identifier] || _.startCase(identifier);
}
/**
@@ -304,7 +294,7 @@ function optionToArray(name, string) {
function optionToValue(name, string) {
var result = string.match(RegExp('^' + name + '(?:=([\\s\\S]+))?$'));
if (result) {
result = _.result(result, 1);
result = _.get(result, 1);
result = result ? _.trim(result) : true;
}
if (result === 'false') {
@@ -376,8 +366,8 @@ function onJobStart(error, res, body) {
if (this.stopping) {
return;
}
var statusCode = _.result(res, 'statusCode'),
taskId = _.first(_.result(body, 'js tests'));
var statusCode = _.get(res, 'statusCode'),
taskId = _.first(_.get(body, 'js tests'));
if (error || !taskId || statusCode != 200) {
if (this.attempts < this.retries) {
@@ -418,19 +408,19 @@ function onJobStatus(error, res, body) {
if (!this.running || this.stopping) {
return;
}
var completed = _.result(body, 'completed', false),
data = _.first(_.result(body, 'js tests')),
var completed = _.get(body, 'completed', false),
data = _.first(_.get(body, 'js tests')),
elapsed = (_.now() - this.timestamp) / 1000,
jobId = _.result(data, 'job_id', null),
jobResult = _.result(data, 'result', null),
jobStatus = _.result(data, 'status', ''),
jobUrl = _.result(data, 'url', null),
jobId = _.get(data, 'job_id', null),
jobResult = _.get(data, 'result', null),
jobStatus = _.get(data, 'status', ''),
jobUrl = _.get(data, 'url', null),
expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')),
options = this.options,
platform = options.platforms[0];
if (_.isObject(jobResult)) {
var message = _.result(jobResult, 'message');
var message = _.get(jobResult, 'message');
} else {
if (typeof jobResult == 'string') {
message = jobResult;
@@ -450,9 +440,9 @@ function onJobStatus(error, res, body) {
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
return;
}
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
failures = _.result(jobResult, 'failed'),
failures = _.get(jobResult, 'failed'),
label = options.name + ':',
tunnel = this.tunnel;
@@ -473,7 +463,7 @@ function onJobStatus(error, res, body) {
return;
}
else {
if (typeof message == 'undefined') {
if (message === undefined) {
message = 'Results are unavailable. ' + details;
}
console.error(label, description, chalk.red('failed') + ';', message);
@@ -601,7 +591,7 @@ Job.prototype.restart = function(callback) {
var options = this.options,
platform = options.platforms[0],
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
label = options.name + ':';
logInline();
@@ -826,13 +816,16 @@ Tunnel.prototype.start = function(callback) {
* @param {Object} Returns the tunnel instance.
*/
Tunnel.prototype.dequeue = function() {
var jobs = this.jobs,
var count = 0,
jobs = this.jobs,
active = jobs.active,
queue = jobs.queue,
throttled = this.throttled;
while (queue.length && (active.length < throttled)) {
active.push(queue.shift().start());
var job = queue.shift();
active.push(job);
_.delay(_.bind(job.start, job), ++count * 1000);
}
return this;
};

File diff suppressed because it is too large Load Diff

10301
test/test.js

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,12 @@
QUnit.config.hidepassed = true;
QUnit.config.excused = {
'Arrays': {
'chunk': [
'defaults to empty array (chunk size 0)'
],
'difference': [
'can perform an OO-style difference'
],
'drop': [
'is an alias for rest'
],
@@ -50,9 +56,6 @@
'works on an arguments object',
'can handle very deep arrays'
],
'head': [
'is an alias for first'
],
'indexOf': [
"sorted indexOf doesn't uses binary search",
'0'
@@ -80,9 +83,6 @@
'an array of pairs zipped together into an object',
'an object converted to pairs and back to an object'
],
'range': [
'range with two arguments a &amp; b, b&lt;a generates an empty array'
],
'rest': [
'returns the whole array when index is 0',
'returns elements starting at the given index',
@@ -99,11 +99,15 @@
'is an alias for first'
],
'uniq': [
'can find the unique values of an array using a custom iterator',
'can find the unique values of an array using a custom iterator without specifying whether array is sorted',
'string iterator works with sorted array',
'can use pluck like iterator',
'uses the result of `iterator` for uniqueness comparisons (unsorted case)',
'`sorted` argument defaults to false when omitted',
'when `iterator` is a string, uses that key for comparisons (unsorted case)',
'uses the result of `iterator` for uniqueness comparisons (sorted case)',
'when `iterator` is a string, uses that key for comparisons (sorted case)',
'can use falsey pluck like iterator'
],
'union': [
'can perform an OO-style union'
]
},
'Chaining': {
@@ -119,7 +123,8 @@
'Iterating objects with sketchy length properties': true,
'Resistant to collection length and properties changing while iterating': true,
'countBy': [
'true'
'{}',
'[{}]'
],
'each': [
'context object property accessed'
@@ -131,24 +136,17 @@
],
'filter': [
'given context',
'[{"a":1,"b":2},{"a":1,"b":3},{"a":1,"b":4}]',
'[{"a":1,"b":2},{"a":2,"b":2}]',
'Empty object accepts all items',
'OO-filter'
],
'find': [
'{"a":1,"b":4}',
'undefined when not found',
'undefined when searching empty list',
'works on objects',
'undefined',
'called with context'
],
'findWhere': [
'checks properties given function'
],
'groupBy': [
'true'
'{}',
'[{}]'
],
'includes': [
"doesn't delegate to binary search"
@@ -188,8 +186,7 @@
'partition': [
'can reference the array index',
'Died on test #8',
'partition takes a context argument',
'function(a){[code]}'
'partition takes a context argument'
],
'pluck': [
'[1]'
@@ -213,15 +210,15 @@
'checks properties given function'
],
'Can use various collection methods on NodeLists': [
'<span id="id2"></span>',
'<span id="id1"></span>'
'<span id="id2"></span>'
]
},
'Functions': {
'debounce asap': true,
'debounce asap cancel': true,
'debounce after system time is set backwards': true,
'debounce asap recursively': true,
'debounce after system time is set backwards': true,
'debounce re-entrant': true,
'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': true,
'throttle does not trigger trailing call when trailing is set to false': true,
@@ -235,17 +232,17 @@
'bindAll': [
'throws an error for bindAll with no functions named'
],
'debounce': [
'incr was debounced'
],
'iteratee': [
'"bbiz"',
'"foo"',
'1'
],
'memoize': [
'{"bar":"BAR","foo":"FOO"}',
'Died on test #8'
],
'partial':[
'can partially apply with placeholders',
'accepts more arguments than the number of placeholders',
'accepts fewer arguments than the number of placeholders',
'unfilled placeholders are undefined',
'keeps prototype',
'allows the placeholder to be swapped out'
]
},
'Objects': {
@@ -255,10 +252,6 @@
'is not fooled by sparse arrays with additional properties',
'[]'
],
'defaults': [
'defaults skips nulls',
'defaults skips undefined'
],
'extend': [
'extending null results in null',
'extending undefined results in undefined'
@@ -275,14 +268,15 @@
'Commutative equality is implemented for `0` and `-0`',
'`new Number(0)` and `-0` are not equal',
'Commutative equality is implemented for `new Number(0)` and `-0`',
'Invalid dates are not equal',
'false'
],
'isFinite': [
'Numeric strings are numbers',
'Number instances can be finite'
],
'isMatch': [
'doesnt falsey match constructor on undefined/null'
'isSet': [
'Died on test #9'
],
'findKey': [
'called with context'
@@ -296,10 +290,6 @@
'called with context',
'mapValue identity'
],
'matcher': [
'null matches null',
'treats primitives as empty'
],
'omit': [
'can accept a predicate',
'function is given context'
@@ -310,7 +300,6 @@
]
},
'Utility': {
'noConflict (node vm)': true,
'now': [
'Produces the correct time in milliseconds'
],
@@ -374,8 +363,6 @@
// Only excuse in Sauce Labs.
if (!ui.isSauceLabs) {
delete QUnit.config.excused.Functions['throttle repeatedly with results'];
delete QUnit.config.excused.Functions['more throttle does not trigger leading call when leading is set to false'];
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
delete QUnit.config.excused.Utility.now;
}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2015 Jeremy Ashkenas, DocumentCloud
Copyright (c) 2010-2016 Jeremy Ashkenas, DocumentCloud
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@@ -1,6 +1,6 @@
// Backbone.js 1.2.3
// Backbone.js 1.3.3
// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
@@ -9,8 +9,8 @@
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
// We use `self` instead of `window` for `WebWorker` support.
var root = (typeof self == 'object' && self.self == self && self) ||
(typeof global == 'object' && global.global == global && global);
var root = (typeof self == 'object' && self.self === self && self) ||
(typeof global == 'object' && global.global === global && global);
// Set up Backbone appropriately for the environment. Start with AMD.
if (typeof define === 'function' && define.amd) {
@@ -44,7 +44,7 @@
var slice = Array.prototype.slice;
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.2.3';
Backbone.VERSION = '1.3.3';
// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable.
@@ -146,7 +146,7 @@
events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
}
} else if (name && eventSplitter.test(name)) {
// Handle space separated event names by delegating them individually.
// Handle space-separated event names by delegating them individually.
for (names = name.split(eventSplitter); i < names.length; i++) {
events = iteratee(events, names[i], callback, opts);
}
@@ -242,7 +242,6 @@
listening.obj.off(name, callback, this);
}
if (_.isEmpty(listeningTo)) this._listeningTo = void 0;
return this;
};
@@ -299,7 +298,7 @@
delete events[name];
}
}
if (_.size(events)) return events;
return events;
};
// Bind an event to only be triggered a single time. After the first time
@@ -309,7 +308,8 @@
Events.once = function(name, callback, context) {
// Map the event into a `{event: once}` object.
var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
return this.on(events, void 0, context);
if (typeof name === 'string' && context == null) callback = void 0;
return this.on(events, callback, context);
};
// Inversion-of-control versions of `once`.
@@ -348,7 +348,7 @@
};
// Handles triggering the appropriate event callbacks.
var triggerApi = function(objEvents, name, cb, args) {
var triggerApi = function(objEvents, name, callback, args) {
if (objEvents) {
var events = objEvents[name];
var allEvents = objEvents.all;
@@ -394,11 +394,13 @@
var Model = Backbone.Model = function(attributes, options) {
var attrs = attributes || {};
options || (options = {});
this.preinitialize.apply(this, arguments);
this.cid = _.uniqueId(this.cidPrefix);
this.attributes = {};
if (options.collection) this.collection = options.collection;
if (options.parse) attrs = this.parse(attrs, options) || {};
attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
var defaults = _.result(this, 'defaults');
attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
this.set(attrs, options);
this.changed = {};
this.initialize.apply(this, arguments);
@@ -421,6 +423,10 @@
// You may want to override this if you're experiencing name clashes with model ids.
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
// initialization logic.
initialize: function(){},
@@ -561,12 +567,14 @@
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
var old = this._changing ? this._previousAttributes : this.attributes;
var changed = {};
var hasChanged;
for (var attr in diff) {
var val = diff[attr];
if (_.isEqual(old[attr], val)) continue;
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
@@ -714,7 +722,7 @@
// Check if the model is currently in a valid state.
isValid: function(options) {
return this._validate({}, _.defaults({validate: true}, options));
return this._validate({}, _.extend({}, options, {validate: true}));
},
// Run validation against the next complete set of model attributes,
@@ -753,6 +761,7 @@
// its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
this.preinitialize.apply(this, arguments);
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
@@ -769,7 +778,8 @@
at = Math.min(Math.max(at, 0), array.length);
var tail = Array(array.length - at);
var length = insert.length;
for (var i = 0; i < tail.length; i++) tail[i] = array[i + at];
var i;
for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
for (i = 0; i < length; i++) array[i + at] = insert[i];
for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
};
@@ -781,6 +791,11 @@
// This should be overridden in most cases.
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
// initialization logic.
initialize: function(){},
@@ -809,7 +824,10 @@
var singular = !_.isArray(models);
models = singular ? [models] : models.slice();
var removed = this._removeModels(models, options);
if (!options.silent && removed.length) this.trigger('update', this, options);
if (!options.silent && removed.length) {
options.changes = {added: [], merged: [], removed: removed};
this.trigger('update', this, options);
}
return singular ? removed[0] : removed;
},
@@ -820,18 +838,22 @@
set: function(models, options) {
if (models == null) return;
options = _.defaults({}, options, setOptions);
if (options.parse && !this._isModel(models)) models = this.parse(models, options);
options = _.extend({}, setOptions, options);
if (options.parse && !this._isModel(models)) {
models = this.parse(models, options) || [];
}
var singular = !_.isArray(models);
models = singular ? (models ? [models] : []) : models.slice();
models = singular ? [models] : models.slice();
var at = options.at;
if (at != null) at = +at;
if (at > this.length) at = this.length;
if (at < 0) at += this.length + 1;
var set = [];
var toAdd = [];
var toMerge = [];
var toRemove = [];
var modelMap = {};
@@ -845,8 +867,8 @@
// Turn bare objects into model references, and prevent invalid models
// from being added.
var model;
for (var i = 0; i < models.length; i++) {
var model, i;
for (i = 0; i < models.length; i++) {
model = models[i];
// If a duplicate is found, prevent it from being added and
@@ -857,6 +879,7 @@
var attrs = this._isModel(model) ? model.attributes : model;
if (options.parse) attrs = existing.parse(attrs, options);
existing.set(attrs, options);
toMerge.push(existing);
if (sortable && !sort) sort = existing.hasChanged(sortAttr);
}
if (!modelMap[existing.cid]) {
@@ -890,8 +913,8 @@
var orderChanged = false;
var replace = !sortable && add && remove;
if (set.length && replace) {
orderChanged = this.length != set.length || _.some(this.models, function(model, index) {
return model !== set[index];
orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
return m !== set[index];
});
this.models.length = 0;
splice(this.models, set, 0);
@@ -905,7 +928,7 @@
// Silently sort the collection if appropriate.
if (sort) this.sort({silent: true});
// Unless silenced, it's time to fire all appropriate add/sort events.
// Unless silenced, it's time to fire all appropriate add/sort/update events.
if (!options.silent) {
for (i = 0; i < toAdd.length; i++) {
if (at != null) options.index = at + i;
@@ -913,7 +936,14 @@
model.trigger('add', model, this, options);
}
if (sort || orderChanged) this.trigger('sort', this, options);
if (toAdd.length || toRemove.length) this.trigger('update', this, options);
if (toAdd.length || toRemove.length || toMerge.length) {
options.changes = {
added: toAdd,
removed: toRemove,
merged: toMerge
};
this.trigger('update', this, options);
}
}
// Return the added (or merged) model (or models).
@@ -963,11 +993,18 @@
return slice.apply(this.models, arguments);
},
// Get a model from the set by id.
// Get a model from the set by id, cid, model object with id or cid
// properties, or an attributes object that is transformed through modelId.
get: function(obj) {
if (obj == null) return void 0;
var id = this.modelId(this._isModel(obj) ? obj.attributes : obj);
return this._byId[obj] || this._byId[id] || this._byId[obj.cid];
return this._byId[obj] ||
this._byId[this.modelId(obj.attributes || obj)] ||
obj.cid && this._byId[obj.cid];
},
// Returns `true` if the model is in the collection.
has: function(obj) {
return this.get(obj) != null;
},
// Get the model at the given index.
@@ -1042,9 +1079,9 @@
if (!wait) this.add(model, options);
var collection = this;
var success = options.success;
options.success = function(model, resp, callbackOpts) {
if (wait) collection.add(model, callbackOpts);
if (success) success.call(callbackOpts.context, model, resp, callbackOpts);
options.success = function(m, resp, callbackOpts) {
if (wait) collection.add(m, callbackOpts);
if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
};
model.save(null, options);
return model;
@@ -1195,6 +1232,7 @@
// if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
this.preinitialize.apply(this, arguments);
_.extend(this, _.pick(options, viewOptions));
this._ensureElement();
this.initialize.apply(this, arguments);
@@ -1218,6 +1256,10 @@
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
// initialization logic.
initialize: function(){},
@@ -1443,6 +1485,7 @@
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = Backbone.Router = function(options) {
options || (options = {});
this.preinitialize.apply(this, arguments);
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this.initialize.apply(this, arguments);
@@ -1458,6 +1501,10 @@
// Set up all inheritable **Backbone.Router** properties and methods.
_.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
// initialization logic.
initialize: function(){},
@@ -1584,8 +1631,8 @@
// Does the pathname match the root?
matchRoot: function() {
var path = this.decodeFragment(this.location.pathname);
var root = path.slice(0, this.root.length - 1) + '/';
return root === this.root;
var rootPath = path.slice(0, this.root.length - 1) + '/';
return rootPath === this.root;
},
// Unicode characters in `location.pathname` are percent encoded so they're
@@ -1657,8 +1704,8 @@
// If we've started off with a route from a `pushState`-enabled
// browser, but we're currently in a browser that doesn't support it...
if (!this._hasPushState && !this.atRoot()) {
var root = this.root.slice(0, -1) || '/';
this.location.replace(root + '#' + this.getPath());
var rootPath = this.root.slice(0, -1) || '/';
this.location.replace(rootPath + '#' + this.getPath());
// Return immediately as browser will do redirect to new url
return true;
@@ -1782,17 +1829,20 @@
fragment = this.getFragment(fragment || '');
// Don't include a trailing slash on the root.
var root = this.root;
var rootPath = this.root;
if (fragment === '' || fragment.charAt(0) === '?') {
root = root.slice(0, -1) || '/';
rootPath = rootPath.slice(0, -1) || '/';
}
var url = root + fragment;
var url = rootPath + fragment;
// Strip the hash and decode for matching.
fragment = this.decodeFragment(fragment.replace(pathStripper, ''));
// Strip the fragment of the query and hash for matching.
fragment = fragment.replace(pathStripper, '');
if (this.fragment === fragment) return;
this.fragment = fragment;
// Decode for matching.
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 (this._usePushState) {
@@ -1893,5 +1943,4 @@
};
return Backbone;
});

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
(function() {
(function(QUnit) {
QUnit.module('Backbone.Events');
@@ -352,8 +352,8 @@
_.extend(obj, Backbone.Events);
obj.on('all', function(event) {
obj.counter++;
if (event == 'a') a = true;
if (event == 'b') b = true;
if (event === 'a') a = true;
if (event === 'b') b = true;
})
.trigger('a b');
assert.ok(a);
@@ -417,6 +417,18 @@
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
});
QUnit.test('bind a callback with a default context when none supplied', function(assert) {
assert.expect(1);
var obj = _.extend({
assertTrue: function() {
assert.equal(this, obj, '`this` was bound to the callback');
}
}, Backbone.Events);
obj.once('event', obj.assertTrue);
obj.trigger('event');
});
QUnit.test('bind a callback with a supplied context', function(assert) {
assert.expect(1);
var TestClass = function() {
@@ -477,7 +489,7 @@
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
assert.expect(1);
var view = _.extend({}, Backbone.Events).on('test', 'noop');
assert.throws(function() {
assert.raises(function() {
view.trigger('test');
});
});
@@ -587,6 +599,19 @@
assert.equal(obj.counter, 3);
});
QUnit.test('bind a callback with a supplied context using once with object notation', function(assert) {
assert.expect(1);
var obj = {counter: 0};
var context = {};
_.extend(obj, Backbone.Events);
obj.once({
a: function() {
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
}
}, context).trigger('a');
});
QUnit.test('once with off only by context', function(assert) {
assert.expect(0);
var context = {};
@@ -678,4 +703,4 @@
two.trigger('y', 2);
});
})();
})(QUnit);

View File

@@ -1,4 +1,4 @@
(function() {
(function(QUnit) {
var ProxyModel = Backbone.Model.extend();
var Klass = Backbone.Collection.extend({
@@ -34,6 +34,12 @@
assert.equal(model.collection, collection);
});
QUnit.test('Object.prototype properties are overridden by attributes', function(assert) {
assert.expect(1);
var model = new Backbone.Model({hasOwnProperty: true});
assert.equal(model.get('hasOwnProperty'), true);
});
QUnit.test('initialize with attributes and options', function(assert) {
assert.expect(1);
var Model = Backbone.Model.extend({
@@ -57,17 +63,34 @@
assert.equal(model.get('value'), 2);
});
QUnit.test('initialize with defaults', function(assert) {
QUnit.test('preinitialize', function(assert) {
assert.expect(2);
var Model = Backbone.Model.extend({
defaults: {
firstName: 'Unknown',
lastName: 'Unknown'
preinitialize: function() {
this.one = 1;
}
});
var model = new Model({'firstName': 'John'});
assert.equal(model.get('firstName'), 'John');
assert.equal(model.get('lastName'), 'Unknown');
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) {
@@ -89,7 +112,7 @@
doc.collection.url = '/collection/';
assert.equal(doc.url(), '/collection/1-the-tempest');
doc.collection = null;
assert.throws(function() { doc.url(); });
assert.raises(function() { doc.url(); });
doc.collection = collection;
});
@@ -251,12 +274,12 @@
var changeCount = 0;
a.on('change:foo', function() { changeCount += 1; });
a.set({foo: 2});
assert.ok(a.get('foo') == 2, 'Foo should have changed.');
assert.ok(changeCount == 1, 'Change count should have incremented.');
assert.equal(a.get('foo'), 2, 'Foo should have changed.');
assert.equal(changeCount, 1, 'Change count should have incremented.');
// set with value that is not new shouldn't fire change event
a.set({foo: 2});
assert.ok(a.get('foo') == 2, 'Foo should NOT have changed, still 2');
assert.ok(changeCount == 1, 'Change count should NOT have incremented.');
assert.equal(a.get('foo'), 2, 'Foo should NOT have changed, still 2');
assert.equal(changeCount, 1, 'Change count should NOT have incremented.');
a.validate = function(attrs) {
assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting');
@@ -264,7 +287,7 @@
a.unset('foo', {validate: true});
assert.equal(a.get('foo'), void 0, 'Foo should have changed');
delete a.validate;
assert.ok(changeCount == 2, 'Change count should have incremented for unset.');
assert.equal(changeCount, 2, 'Change count should have incremented for unset.');
a.unset('id');
assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.');
@@ -273,8 +296,8 @@
QUnit.test('#2030 - set with failed validate, followed by another set triggers change', function(assert) {
var attr = 0, main = 0, error = 0;
var Model = Backbone.Model.extend({
validate: function(attr) {
if (attr.x > 1) {
validate: function(attrs) {
if (attrs.x > 1) {
error++;
return 'this is an error';
}
@@ -379,15 +402,15 @@
var Collection = Backbone.Collection.extend({
model: Model
});
var collection = new Collection([{id: 'c5'}, {id: 'c6'}, {id: 'c7'}]);
var col = new Collection([{id: 'c5'}, {id: 'c6'}, {id: 'c7'}]);
assert.equal(collection.get('c6').cid.charAt(0), 'm');
collection.set([{id: 'c6', value: 'test'}], {
assert.equal(col.get('c6').cid.charAt(0), 'm');
col.set([{id: 'c6', value: 'test'}], {
merge: true,
add: true,
remove: false
});
assert.ok(collection.get('c6').has('value'));
assert.ok(col.get('c6').has('value'));
});
QUnit.test('set an empty string', function(assert) {
@@ -428,7 +451,7 @@
});
QUnit.test('defaults', function(assert) {
assert.expect(4);
assert.expect(9);
var Defaulted = Backbone.Model.extend({
defaults: {
one: 1,
@@ -438,6 +461,9 @@
var model = new Defaulted({two: undefined});
assert.equal(model.get('one'), 1);
assert.equal(model.get('two'), 2);
model = new Defaulted({two: 3});
assert.equal(model.get('one'), 1);
assert.equal(model.get('two'), 3);
Defaulted = Backbone.Model.extend({
defaults: function() {
return {
@@ -449,6 +475,15 @@
model = new Defaulted({two: undefined});
assert.equal(model.get('one'), 3);
assert.equal(model.get('two'), 4);
Defaulted = Backbone.Model.extend({
defaults: {hasOwnProperty: true}
});
model = new Defaulted();
assert.equal(model.get('hasOwnProperty'), true);
model = new Defaulted({hasOwnProperty: undefined});
assert.equal(model.get('hasOwnProperty'), true);
model = new Defaulted({hasOwnProperty: false});
assert.equal(model.get('hasOwnProperty'), false);
});
QUnit.test('change, hasChanged, changedAttributes, previous, previousAttributes', function(assert) {
@@ -480,8 +515,8 @@
assert.expect(2);
var value;
var model = new Backbone.Model({name: 'Rob'});
model.on('change', function(model, options) {
value = options.prefix + model.get('name');
model.on('change', function(m, options) {
value = options.prefix + m.get('name');
});
model.set({name: 'Bob'}, {prefix: 'Mr. '});
assert.equal(value, 'Mr. Bob');
@@ -517,10 +552,10 @@
model.validate = function(attrs) {
if (attrs.admin) return "Can't change admin status.";
};
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success.call(this, {admin: true});
};
model.on('invalid', function(model, error) {
model.on('invalid', function(m, error) {
lastError = error;
});
model.save(null);
@@ -542,7 +577,7 @@
model.on('error', function() {
assert.ok(true);
});
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.error();
};
model.save({data: 2, id: 1});
@@ -560,8 +595,8 @@
assert.equal(this, obj);
}
};
model.sync = function(method, model, options) {
options.success.call(options.context);
model.sync = function(method, m, opts) {
opts.success.call(opts.context);
};
model.save({data: 2, id: 1}, options);
model.fetch(options);
@@ -578,8 +613,8 @@
assert.equal(this, obj);
}
};
model.sync = function(method, model, options) {
options.error.call(options.context);
model.sync = function(method, m, opts) {
opts.error.call(opts.context);
};
model.save({data: 2, id: 1}, options);
model.fetch(options);
@@ -593,7 +628,7 @@
model.parse = function() {
assert.ok(false);
};
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success({i: ++i});
};
model.fetch({parse: false});
@@ -627,7 +662,7 @@
QUnit.test('save in positional style', function(assert) {
assert.expect(1);
var model = new Backbone.Model();
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success();
};
model.save('title', 'Twelfth Night');
@@ -637,13 +672,13 @@
QUnit.test('save with non-object success response', function(assert) {
assert.expect(2);
var model = new Backbone.Model();
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success('', options);
options.success(null, options);
};
model.save({testing: 'empty'}, {
success: function(model) {
assert.deepEqual(model.attributes, {testing: 'empty'});
success: function(m) {
assert.deepEqual(m.attributes, {testing: 'empty'});
}
});
});
@@ -660,16 +695,16 @@
QUnit.test('save will pass extra options to success callback', function(assert) {
assert.expect(1);
var SpecialSyncModel = Backbone.Model.extend({
sync: function(method, model, options) {
sync: function(method, m, options) {
_.extend(options, {specialSync: true});
return Backbone.Model.prototype.sync.call(this, method, model, options);
return Backbone.Model.prototype.sync.call(this, method, m, options);
},
urlRoot: '/test'
});
var model = new SpecialSyncModel();
var onSuccess = function(model, response, options) {
var onSuccess = function(m, response, options) {
assert.ok(options.specialSync, 'Options were passed correctly to callback');
};
@@ -687,16 +722,16 @@
QUnit.test('fetch will pass extra options to success callback', function(assert) {
assert.expect(1);
var SpecialSyncModel = Backbone.Model.extend({
sync: function(method, model, options) {
sync: function(method, m, options) {
_.extend(options, {specialSync: true});
return Backbone.Model.prototype.sync.call(this, method, model, options);
return Backbone.Model.prototype.sync.call(this, method, m, options);
},
urlRoot: '/test'
});
var model = new SpecialSyncModel();
var onSuccess = function(model, response, options) {
var onSuccess = function(m, response, options) {
assert.ok(options.specialSync, 'Options were passed correctly to callback');
};
@@ -717,16 +752,16 @@
QUnit.test('destroy will pass extra options to success callback', function(assert) {
assert.expect(1);
var SpecialSyncModel = Backbone.Model.extend({
sync: function(method, model, options) {
sync: function(method, m, options) {
_.extend(options, {specialSync: true});
return Backbone.Model.prototype.sync.call(this, method, model, options);
return Backbone.Model.prototype.sync.call(this, method, m, options);
},
urlRoot: '/test'
});
var model = new SpecialSyncModel({id: 'id'});
var onSuccess = function(model, response, options) {
var onSuccess = function(m, response, options) {
assert.ok(options.specialSync, 'Options were passed correctly to callback');
};
@@ -746,9 +781,9 @@
var lastError;
var model = new Backbone.Model();
model.validate = function(attrs) {
if (attrs.admin != this.get('admin')) return "Can't change admin status.";
if (attrs.admin !== this.get('admin')) return "Can't change admin status.";
};
model.on('invalid', function(model, error) {
model.on('invalid', function(m, error) {
lastError = error;
});
var result = model.set({a: 100});
@@ -793,7 +828,7 @@
model.validate = function(attrs) {
if (attrs.admin) return "Can't change admin status.";
};
model.on('invalid', function(model, error) {
model.on('invalid', function(m, error) {
boundError = true;
});
var result = model.set({a: 100}, {validate: true});
@@ -848,14 +883,14 @@
QUnit.test("Nested change events don't clobber previous attributes", function(assert) {
assert.expect(4);
new Backbone.Model()
.on('change:state', function(model, newState) {
assert.equal(model.previous('state'), undefined);
.on('change:state', function(m, newState) {
assert.equal(m.previous('state'), undefined);
assert.equal(newState, 'hello');
// Fire a nested change event.
model.set({other: 'whatever'});
m.set({other: 'whatever'});
})
.on('change:state', function(model, newState) {
assert.equal(model.previous('state'), undefined);
.on('change:state', function(m, newState) {
assert.equal(m.previous('state'), undefined);
assert.equal(newState, 'hello');
})
.set({state: 'hello'});
@@ -989,8 +1024,8 @@
QUnit.test('`previous` for falsey keys', function(assert) {
assert.expect(2);
var model = new Backbone.Model({0: true, '': true});
model.set({0: false, '': false}, {silent: true});
var model = new Backbone.Model({'0': true, '': true});
model.set({'0': false, '': false}, {silent: true});
assert.equal(model.previous(0), true);
assert.equal(model.previous(''), true);
});
@@ -1021,7 +1056,7 @@
QUnit.test('#1030 - `save` with `wait` results in correct attributes if success is called during sync', function(assert) {
assert.expect(2);
var model = new Backbone.Model({x: 1, y: 2});
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success();
};
model.on('change:x', function() { assert.ok(true); });
@@ -1038,7 +1073,7 @@
QUnit.test('save turns on parse flag', function(assert) {
var Model = Backbone.Model.extend({
sync: function(method, model, options) { assert.ok(options.parse); }
sync: function(method, m, options) { assert.ok(options.parse); }
});
new Model().save();
});
@@ -1142,7 +1177,7 @@
model.set({y: 1}, {silent: true});
model.set({y: 2});
});
model.on('change:y', function(model, val) {
model.on('change:y', function(m, val) {
assert.equal(val, 2);
});
model.set({x: true});
@@ -1152,7 +1187,7 @@
assert.expect(1);
var changes = [];
var model = new Backbone.Model();
model.on('change:b', function(model, val) { changes.push(val); });
model.on('change:b', function(m, val) { changes.push(val); });
model.on('change', function() {
model.set({b: 1});
});
@@ -1202,11 +1237,11 @@
assert.expect(3);
var model = new Backbone.Model();
var opts = {
success: function( model, resp, options ) {
success: function( m, resp, options ) {
assert.ok(options);
}
};
model.sync = function(method, model, options) {
model.sync = function(method, m, options) {
options.success();
};
model.save({id: 1}, opts);
@@ -1217,7 +1252,7 @@
QUnit.test("#1412 - Trigger 'sync' event.", function(assert) {
assert.expect(3);
var model = new Backbone.Model({id: 1});
model.sync = function(method, model, options) { options.success(); };
model.sync = function(method, m, options) { options.success(); };
model.on('sync', function(){ assert.ok(true); });
model.fetch();
model.save();
@@ -1248,7 +1283,7 @@
assert.expect(1);
var Model = Backbone.Model.extend({
url: '/test/',
sync: function(method, model, options){ options.success(); },
sync: function(method, m, options){ options.success(); },
validate: function(){ return 'invalid'; }
});
var model = new Model({id: 1});
@@ -1271,7 +1306,7 @@
var done = assert.async();
assert.expect(0);
var Model = Backbone.Model.extend({
sync: function(method, model, options) {
sync: function(method, m, options) {
setTimeout(function(){
options.success();
done();
@@ -1301,7 +1336,7 @@
model.set({b: 2}, {silent: true});
model.unset('c', {silent: true});
});
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
model.on('change:a change:b change:c', function(m, val) { changes.push(val); });
model.set({a: 'a', b: 1, c: 'item'});
assert.deepEqual(changes, ['a', 1, 'item']);
assert.deepEqual(model.attributes, {a: 'c', b: 2});
@@ -1319,7 +1354,7 @@
assert.expect(2);
var changes = [];
var model = new Backbone.Model();
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
model.on('change:a change:b change:c', function(m, val) { changes.push(val); });
model.on('change', function() {
model.set({a: 'c'}, {silent: true});
});
@@ -1410,4 +1445,4 @@
assert.equal(model.id, 3);
});
})();
})(QUnit);

View File

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

View File

@@ -1,11 +1,11 @@
(function() {
(function(QUnit) {
var router = null;
var location = null;
var lastRoute = null;
var lastArgs = [];
var onRoute = function(router, route, args) {
var onRoute = function(routerParam, route, args) {
lastRoute = route;
lastArgs = args;
};
@@ -28,7 +28,8 @@
'fragment',
'pathname',
'protocol'
));
));
// In IE, anchor.pathname does not contain a leading slash though
// window.location.pathname does.
if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname;
@@ -42,7 +43,7 @@
QUnit.module('Backbone.Router', {
setup: function() {
beforeEach: function() {
location = new Location('http://example.com');
Backbone.history = _.extend(new Backbone.History, {location: location});
router = new Router({testing: 101});
@@ -53,7 +54,7 @@
Backbone.history.on('route', onRoute);
},
teardown: function() {
afterEach: function() {
Backbone.history.stop();
Backbone.history.off('route', onRoute);
}
@@ -95,6 +96,10 @@
'*anything': 'anything'
},
preinitialize: function(options) {
this.testpreinit = 'foo';
},
initialize: function(options) {
this.testing = options.testing;
this.route('implicit', 'implicit');
@@ -121,20 +126,20 @@
this.charType = 'escaped';
},
contacts: function(){
contacts: function() {
this.contact = 'index';
},
newContact: function(){
newContact: function() {
this.contact = 'new';
},
loadContact: function(){
loadContact: function() {
this.contact = 'load';
},
optionalItem: function(arg){
this.arg = arg != void 0 ? arg : null;
optionalItem: function(arg) {
this.arg = arg !== void 0 ? arg : null;
},
splat: function(args) {
@@ -181,6 +186,11 @@
assert.equal(router.testing, 101);
});
QUnit.test('preinitialize', function(assert) {
assert.expect(1);
assert.equal(router.testpreinit, 'foo');
});
QUnit.test('routes (simple)', function(assert) {
assert.expect(4);
location.replace('http://example.com#search/news');
@@ -234,10 +244,11 @@
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);
// 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);
assert.equal(router.contact, 'index');
Backbone.history.navigate('contacts/new', options);
@@ -249,7 +260,7 @@
QUnit.test('loadUrl is not called for identical routes.', function(assert) {
assert.expect(0);
Backbone.history.loadUrl = function(){ assert.ok(false); };
Backbone.history.loadUrl = function() { assert.ok(false); };
location.replace('http://example.com#route');
Backbone.history.navigate('route');
Backbone.history.navigate('/route');
@@ -345,16 +356,16 @@
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);
router.on('route:noCallback', function(){ assert.ok(true); });
router.on('route:noCallback', function() { assert.ok(true); });
location.replace('http://example.com#noCallback');
Backbone.history.checkUrl();
});
QUnit.test('No events are triggered if #execute returns false.', function(assert) {
assert.expect(1);
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
foo: function() {
@@ -369,9 +380,9 @@
});
var router = new Router;
var myRouter = new MyRouter;
router.on('route route:foo', function() {
myRouter.on('route route:foo', function() {
assert.ok(false);
});
@@ -536,8 +547,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
pushState: function() {},
replaceState: function() {}
}
});
Backbone.history.start({root: 'root'});
@@ -551,8 +562,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(state, title, url){
pushState: function() {},
replaceState: function(state, title, url) {
assert.strictEqual(url, '/root/x/y');
}
}
@@ -570,8 +581,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
pushState: function() {},
replaceState: function() {}
}
});
Backbone.history.start({root: ''});
@@ -625,8 +636,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(state, title, url){
pushState: function() {},
replaceState: function(state, title, url) {
assert.strictEqual(url, '/root/x/y?a=b');
}
}
@@ -639,14 +650,14 @@
QUnit.test('#1746 - Router allows empty route.', function(assert) {
assert.expect(1);
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {'': 'empty'},
empty: function(){},
route: function(route){
empty: function() {},
route: function(route) {
assert.strictEqual(route, '');
}
});
new Router;
new MyRouter;
});
QUnit.test('#1794 - Trailing space in fragments.', function(assert) {
@@ -655,7 +666,8 @@
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;
assert.strictEqual(history.getFragment('/fragment '), 'fragment');
});
@@ -670,7 +682,7 @@
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);
router.on('route', function(name, args) {
assert.strictEqual(name, 'routeEvent');
@@ -698,8 +710,8 @@
}
});
var router = new RouterExtended();
assert.deepEqual({home: 'root', index: 'index.html', show: 'show', search: 'search'}, router.routes);
var myRouter = new RouterExtended();
assert.deepEqual({home: 'root', index: 'index.html', show: 'show', search: 'search'}, myRouter.routes);
});
QUnit.test('#2538 - hashChange to pushState only if both requested.', function(assert) {
@@ -709,8 +721,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){ assert.ok(false); }
pushState: function() {},
replaceState: function() { assert.ok(false); }
}
});
Backbone.history.start({
@@ -726,17 +738,17 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
pushState: function() {},
replaceState: function() {}
}
});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
hash: function() { assert.ok(false); }
}
});
var router = new Router;
var myRouter = new MyRouter;
location.replace('http://example.com/');
Backbone.history.start({
@@ -753,7 +765,7 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url){
pushState: function(state, title, url) {
assert.strictEqual(url, '/root');
}
}
@@ -785,7 +797,7 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url){
pushState: function(state, title, url) {
assert.strictEqual(url, '/root?x=1');
}
}
@@ -807,12 +819,12 @@
}
});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
path: function() { assert.ok(true); }
}
});
var router = new Router;
var myRouter = new MyRouter;
location.replace('http://example.com/');
Backbone.history.start({pushState: true, hashChange: false});
@@ -821,14 +833,14 @@
QUnit.test('Do not decode the search params.', function(assert) {
assert.expect(1);
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
path: function(params){
path: function(params) {
assert.strictEqual(params, 'x=y%3Fz');
}
}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.navigate('path?x=y%3Fz', true);
});
@@ -837,14 +849,14 @@
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({pushState: true});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
path: function(params) {
assert.strictEqual(params, 'x=y');
}
}
});
var router = new Router;
var myRouter = new MyRouter;
location.replace('http://example.com/path?x=y#hash');
Backbone.history.checkUrl();
});
@@ -854,14 +866,14 @@
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({pushState: true});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
path: function(params) {
assert.strictEqual(params, 'x=y');
}
}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.navigate('path?x=y#hash', true);
});
@@ -870,14 +882,14 @@
location.replace('http://example.com/myyjä');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
myyjä: function() {
assert.ok(true);
}
}
});
new Router;
new MyRouter;
Backbone.history.start({pushState: true});
});
@@ -887,14 +899,14 @@
location.pathname = '/myyj%C3%A4/foo%20%25%3F%2f%40%25%20bar';
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
'myyjä/:query': function(query) {
assert.strictEqual(query, 'foo %?/@% bar');
}
}
});
new Router;
new MyRouter;
Backbone.history.start({pushState: true});
});
@@ -903,14 +915,14 @@
location.replace('http://example.com/stuff%0Anonsense?param=foo%0Abar');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
'stuff\nnonsense': function() {
assert.ok(true);
}
}
});
new Router;
new MyRouter;
Backbone.history.start({pushState: true});
});
@@ -919,16 +931,16 @@
location.replace('http://example.com#foo/123/bar?x=y');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {'foo/:id/bar': 'foo'},
foo: function(){},
foo: function() {},
execute: function(callback, args, name) {
assert.strictEqual(callback, this.foo);
assert.deepEqual(args, ['123', 'x=y']);
assert.strictEqual(name, 'foo');
}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.start();
});
@@ -953,8 +965,8 @@
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){ assert.ok(false); },
replaceState: function(){ assert.ok(false); }
pushState: function() { assert.ok(false); },
replaceState: function() { assert.ok(false); }
}
});
Backbone.history.start({pushState: true});
@@ -967,8 +979,8 @@
Backbone.history.stop();
location.replace('http://example.com#login?a=value&backUrl=https%3A%2F%2Fwww.msn.com%2Fidp%2Fidpdemo%3Fspid%3Dspdemo%26target%3Db');
Backbone.history = _.extend(new Backbone.History, {location: location});
var router = new Backbone.Router;
router.route('login', function(params) {
var myRouter = new Backbone.Router;
myRouter.route('login', function(params) {
assert.strictEqual(params, 'a=value&backUrl=https%3A%2F%2Fwww.msn.com%2Fidp%2Fidpdemo%3Fspid%3Dspdemo%26target%3Db');
});
Backbone.history.start();
@@ -991,35 +1003,35 @@
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);
location.replace('http://example.com/foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
foo: function(){
foo: function() {
assert.ok(false, 'should not match unless root matches');
}
}
});
var router = new Router;
var myRouter = new MyRouter;
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);
location.replace('http://example.com/xxxx/foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
var MyRouter = Backbone.Router.extend({
routes: {
foo: function(){
foo: function() {
assert.ok(false, 'should not match unless root matches');
}
}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.start({root: 'root', pushState: true});
});
@@ -1028,10 +1040,10 @@
location.replace('http://example.com/x+y.z/foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
routes: {foo: function(){ assert.ok(true); }}
var MyRouter = Backbone.Router.extend({
routes: {foo: function() { assert.ok(true); }}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.start({root: 'x+y.z', pushState: true});
});
@@ -1040,10 +1052,10 @@
location.replace('http://example.com/®ooτ/foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
routes: {foo: function(){ assert.ok(true); }}
var MyRouter = Backbone.Router.extend({
routes: {foo: function() { assert.ok(true); }}
});
var router = new Router;
var myRouter = new MyRouter;
Backbone.history.start({root: '®ooτ', pushState: true});
});
@@ -1052,11 +1064,18 @@
location.replace('http://example.com/®ooτ');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
var Router = Backbone.Router.extend({
routes: {'': function(){ assert.ok(true); }}
var MyRouter = Backbone.Router.extend({
routes: {'': function() { assert.ok(true); }}
});
var router = new Router;
var myRouter = new MyRouter;
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 ajax = Backbone.ajax;
@@ -14,7 +14,7 @@
var env = QUnit.config.current.testEnvironment;
// We never want to actually call these during tests.
history.pushState = history.replaceState = function(){};
history.pushState = history.replaceState = function() {};
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
@@ -42,4 +42,4 @@
history.replaceState = replaceState;
});
})();
})(QUnit);

View File

@@ -1,4 +1,4 @@
(function() {
(function(QUnit) {
var Library = Backbone.Collection.extend({
url: function() { return '/library'; }
@@ -142,7 +142,7 @@
QUnit.test('urlError', function(assert) {
assert.expect(2);
var model = new Backbone.Model();
assert.throws(function() {
assert.raises(function() {
model.fetch();
});
model.fetch({url: '/one/two'});
@@ -158,7 +158,7 @@
QUnit.test('Backbone.ajax', function(assert) {
assert.expect(1);
Backbone.ajax = function(settings){
Backbone.ajax = function(settings) {
assert.strictEqual(settings.url, '/test');
};
var model = new Backbone.Model();
@@ -228,7 +228,7 @@
assert.expect(2);
var model = new Backbone.Model;
model.url = '/test';
model.on('error', function(model, xhr, options) {
model.on('error', function(m, xhr, options) {
assert.strictEqual(options.textStatus, 'textStatus');
assert.strictEqual(options.errorThrown, 'errorThrown');
});
@@ -236,4 +236,4 @@
this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
});
})();
})(QUnit);

View File

@@ -1,19 +1,24 @@
(function() {
(function(QUnit) {
var view;
QUnit.module('Backbone.View', {
beforeEach: function(assert) {
beforeEach: function() {
$('#qunit-fixture').append(
'<div id="testElement"><h1>Test</h1></div>'
);
);
view = new Backbone.View({
id: 'test-view',
className: 'test-view',
other: 'non-special-option'
});
},
afterEach: function() {
$('#testElement').remove();
$('#test-view').remove();
}
});
@@ -27,9 +32,9 @@
QUnit.test('$', function(assert) {
assert.expect(2);
var view = new Backbone.View;
view.setElement('<p><a><b>test</b></a></p>');
var result = view.$('a b');
var myView = new Backbone.View;
myView.setElement('<p><a><b>test</b></a></p>');
var result = myView.$('a b');
assert.strictEqual(result[0].innerHTML, 'test');
assert.ok(result.length === +result.length);
@@ -37,12 +42,12 @@
QUnit.test('$el', function(assert) {
assert.expect(3);
var view = new Backbone.View;
view.setElement('<p><a><b>test</b></a></p>');
assert.strictEqual(view.el.nodeType, 1);
var myView = new Backbone.View;
myView.setElement('<p><a><b>test</b></a></p>');
assert.strictEqual(myView.el.nodeType, 1);
assert.ok(view.$el instanceof Backbone.$);
assert.strictEqual(view.$el[0], view.el);
assert.ok(myView.$el instanceof Backbone.$);
assert.strictEqual(myView.$el[0], myView.el);
});
QUnit.test('initialize', function(assert) {
@@ -56,55 +61,77 @@
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) {
assert.expect(1);
var view = new Backbone.View;
assert.equal(view.render(), view, '#render returns the view instance');
var myView = new Backbone.View;
assert.equal(myView.render(), myView, '#render returns the view instance');
});
QUnit.test('delegateEvents', function(assert) {
assert.expect(6);
var counter1 = 0, counter2 = 0;
var view = new Backbone.View({el: '#testElement'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var myView = new Backbone.View({el: '#testElement'});
myView.increment = function() { counter1++; };
myView.$el.on('click', function() { counter2++; });
var events = {'click h1': 'increment'};
view.delegateEvents(events);
view.$('h1').trigger('click');
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 1);
view.$('h1').trigger('click');
myView.$('h1').trigger('click');
assert.equal(counter1, 2);
assert.equal(counter2, 2);
view.delegateEvents(events);
view.$('h1').trigger('click');
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 3);
assert.equal(counter2, 3);
});
QUnit.test('delegate', function(assert) {
assert.expect(3);
var view = new Backbone.View({el: '#testElement'});
view.delegate('click', 'h1', function() {
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', 'h1', function() {
assert.ok(true);
});
view.delegate('click', function() {
myView.delegate('click', function() {
assert.ok(true);
});
view.$('h1').trigger('click');
myView.$('h1').trigger('click');
assert.equal(view.delegate(), view, '#delegate returns the view instance');
assert.equal(myView.delegate(), myView, '#delegate returns the view instance');
});
QUnit.test('delegateEvents allows functions for callbacks', function(assert) {
assert.expect(3);
var view = new Backbone.View({el: '<p></p>'});
view.counter = 0;
var myView = new Backbone.View({el: '<p></p>'});
myView.counter = 0;
var events = {
click: function() {
@@ -112,97 +139,96 @@
}
};
view.delegateEvents(events);
view.$el.trigger('click');
assert.equal(view.counter, 1);
myView.delegateEvents(events);
myView.$el.trigger('click');
assert.equal(myView.counter, 1);
view.$el.trigger('click');
assert.equal(view.counter, 2);
myView.$el.trigger('click');
assert.equal(myView.counter, 2);
view.delegateEvents(events);
view.$el.trigger('click');
assert.equal(view.counter, 3);
myView.delegateEvents(events);
myView.$el.trigger('click');
assert.equal(myView.counter, 3);
});
QUnit.test('delegateEvents ignore undefined methods', function(assert) {
assert.expect(0);
var view = new Backbone.View({el: '<p></p>'});
view.delegateEvents({'click': 'undefinedMethod'});
view.$el.trigger('click');
var myView = new Backbone.View({el: '<p></p>'});
myView.delegateEvents({click: 'undefinedMethod'});
myView.$el.trigger('click');
});
QUnit.test('undelegateEvents', function(assert) {
assert.expect(7);
var counter1 = 0, counter2 = 0;
var view = new Backbone.View({el: '#testElement'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var myView = new Backbone.View({el: '#testElement'});
myView.increment = function() { counter1++; };
myView.$el.on('click', function() { counter2++; });
var events = {'click h1': 'increment'};
view.delegateEvents(events);
view.$('h1').trigger('click');
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 1);
view.undelegateEvents();
view.$('h1').trigger('click');
myView.undelegateEvents();
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 2);
view.delegateEvents(events);
view.$('h1').trigger('click');
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 2);
assert.equal(counter2, 3);
assert.equal(view.undelegateEvents(), view, '#undelegateEvents returns the view instance');
assert.equal(myView.undelegateEvents(), myView, '#undelegateEvents returns the view instance');
});
QUnit.test('undelegate', function(assert) {
assert.expect(1);
view = new Backbone.View({el: '#testElement'});
view.delegate('click', function() { assert.ok(false); });
view.delegate('click', 'h1', function() { assert.ok(false); });
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(false); });
myView.delegate('click', 'h1', function() { assert.ok(false); });
view.undelegate('click');
myView.undelegate('click');
view.$('h1').trigger('click');
view.$el.trigger('click');
myView.$('h1').trigger('click');
myView.$el.trigger('click');
assert.equal(view.undelegate(), view, '#undelegate returns the view instance');
assert.equal(myView.undelegate(), myView, '#undelegate returns the view instance');
});
QUnit.test('undelegate with passed handler', function(assert) {
assert.expect(1);
view = new Backbone.View({el: '#testElement'});
var myView = new Backbone.View({el: '#testElement'});
var listener = function() { assert.ok(false); };
view.delegate('click', listener);
view.delegate('click', function() { assert.ok(true); });
view.undelegate('click', listener);
view.$el.trigger('click');
myView.delegate('click', listener);
myView.delegate('click', function() { assert.ok(true); });
myView.undelegate('click', listener);
myView.$el.trigger('click');
});
QUnit.test('undelegate with selector', function(assert) {
assert.expect(2);
view = new Backbone.View({el: '#testElement'});
view.delegate('click', function() { assert.ok(true); });
view.delegate('click', 'h1', function() { assert.ok(false); });
view.undelegate('click', 'h1');
view.$('h1').trigger('click');
view.$el.trigger('click');
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(true); });
myView.delegate('click', 'h1', function() { assert.ok(false); });
myView.undelegate('click', 'h1');
myView.$('h1').trigger('click');
myView.$el.trigger('click');
});
QUnit.test('undelegate with handler and selector', function(assert) {
assert.expect(2);
view = new Backbone.View({el: '#testElement'});
view.delegate('click', function() { assert.ok(true); });
var handler = function(){ assert.ok(false); };
view.delegate('click', 'h1', handler);
view.undelegate('click', 'h1', handler);
view.$('h1').trigger('click');
view.$el.trigger('click');
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(true); });
var handler = function() { assert.ok(false); };
myView.delegate('click', 'h1', handler);
myView.undelegate('click', 'h1', handler);
myView.$('h1').trigger('click');
myView.$el.trigger('click');
});
QUnit.test('tagName can be provided as a string', function(assert) {
@@ -302,11 +328,11 @@
}
});
var view = new View;
assert.strictEqual(view.el.className, 'backboneClass');
assert.strictEqual(view.el.id, 'backboneId');
assert.strictEqual(view.$el.attr('class'), 'backboneClass');
assert.strictEqual(view.$el.attr('id'), 'backboneId');
var myView = new View;
assert.strictEqual(myView.el.className, 'backboneClass');
assert.strictEqual(myView.el.id, 'backboneId');
assert.strictEqual(myView.$el.attr('class'), 'backboneClass');
assert.strictEqual(myView.$el.attr('id'), 'backboneId');
});
QUnit.test('multiple views per element', function(assert) {
@@ -345,7 +371,7 @@
}
});
var view = new View;
var myView = new View;
$('body').trigger('fake$event').trigger('fake$event');
$('body').off('fake$event');
@@ -356,11 +382,11 @@
assert.expect(2);
var $el = $('body');
var view = new Backbone.View({el: $el});
assert.ok(view.$el === $el);
var myView = new Backbone.View({el: $el});
assert.ok(myView.$el === $el);
view.setElement($el = $($el));
assert.ok(view.$el === $el);
myView.setElement($el = $($el));
assert.ok(myView.$el === $el);
});
QUnit.test('#986 - Undelegate before changing element.', function(assert) {
@@ -371,13 +397,13 @@
var View = Backbone.View.extend({
events: {
click: function(e) {
assert.ok(view.el === e.target);
assert.ok(myView.el === e.target);
}
}
});
var view = new View({el: button1});
view.setElement(button2);
var myView = new View({el: button1});
myView.setElement(button2);
button1.trigger('click');
button2.trigger('click');
@@ -400,19 +426,19 @@
assert.expect(0);
var View = Backbone.View.extend({
initialize: function() {
this.listenTo(this.model, 'all x', function(){ assert.ok(false); });
this.listenTo(this.collection, 'all x', function(){ assert.ok(false); });
this.listenTo(this.model, 'all x', function() { assert.ok(false); });
this.listenTo(this.collection, 'all x', function() { assert.ok(false); });
}
});
var view = new View({
var myView = new View({
model: new Backbone.Model,
collection: new Backbone.Collection
});
view.stopListening();
view.model.trigger('x');
view.collection.trigger('x');
myView.stopListening();
myView.model.trigger('x');
myView.collection.trigger('x');
});
QUnit.test('Provide function for el.', function(assert) {
@@ -423,9 +449,9 @@
}
});
var view = new View;
assert.ok(view.$el.is('p'));
assert.ok(view.$el.has('a'));
var myView = new View;
assert.ok(myView.$el.is('p'));
assert.ok(myView.$el.has('a'));
});
QUnit.test('events passed in options', function(assert) {
@@ -439,52 +465,52 @@
}
});
var view = new View({
var myView = new View({
events: {
'click h1': 'increment'
}
});
view.$('h1').trigger('click').trigger('click');
myView.$('h1').trigger('click').trigger('click');
assert.equal(counter, 2);
});
QUnit.test('remove', function(assert) {
assert.expect(2);
var view = new Backbone.View;
var myView = new Backbone.View;
document.body.appendChild(view.el);
view.delegate('click', function() { assert.ok(false); });
view.listenTo(view, 'all x', function() { assert.ok(false); });
myView.delegate('click', function() { assert.ok(false); });
myView.listenTo(myView, 'all x', function() { assert.ok(false); });
assert.equal(view.remove(), view, '#remove returns the view instance');
view.$el.trigger('click');
view.trigger('x');
assert.equal(myView.remove(), myView, '#remove returns the view instance');
myView.$el.trigger('click');
myView.trigger('x');
// In IE8 and below, parentNode still exists but is not document.body.
assert.notEqual(view.el.parentNode, document.body);
assert.notEqual(myView.el.parentNode, document.body);
});
QUnit.test('setElement', function(assert) {
assert.expect(3);
var view = new Backbone.View({
var myView = new Backbone.View({
events: {
click: function() { assert.ok(false); }
}
});
view.events = {
myView.events = {
click: function() { assert.ok(true); }
};
var oldEl = view.el;
var $oldEl = view.$el;
var oldEl = myView.el;
var $oldEl = myView.$el;
view.setElement(document.createElement('div'));
myView.setElement(document.createElement('div'));
$oldEl.click();
view.$el.click();
myView.$el.click();
assert.notEqual(oldEl, view.el);
assert.notEqual($oldEl, view.$el);
assert.notEqual(oldEl, myView.el);
assert.notEqual($oldEl, myView.$el);
});
})();
})(QUnit);

View File

@@ -1,22 +0,0 @@
Copyright 2010-2015 Mathias Bynens <http://mathiasbynens.be/>
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
Modified by John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative
Copyright (c) 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative
Reporters & Editors
Permission is hereby granted, free of charge, to any person

View File

@@ -15,6 +15,10 @@
result = _.map([[1, 2, 3], [1, 2, 3]], _.first);
assert.deepEqual(result, [1, 1], 'works well with _.map');
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) {
@@ -66,6 +70,10 @@
result = _.map([[1, 2, 3], [1, 2, 3]], _.last);
assert.deepEqual(result, [3, 3], 'works well with _.map');
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) {
@@ -143,33 +151,23 @@
QUnit.test('uniq', function(assert) {
var list = [1, 2, 1, 3, 1, 4];
assert.deepEqual(_.uniq(list), [1, 2, 3, 4], 'can find the unique values of an unsorted array');
list = [1, 1, 1, 2, 2, 3];
assert.deepEqual(_.uniq(list, true), [1, 2, 3], 'can find the unique values of a sorted array faster');
list = [{name: 'moe'}, {name: 'curly'}, {name: 'larry'}, {name: 'curly'}];
var iterator = function(value) { return value.name; };
assert.deepEqual(_.map(_.uniq(list, false, iterator), iterator), ['moe', 'curly', 'larry'], 'can find the unique values of an array using a custom iterator');
list = [{name: 'Moe'}, {name: 'Curly'}, {name: 'Larry'}, {name: 'Curly'}];
var expected = [{name: 'Moe'}, {name: 'Curly'}, {name: 'Larry'}];
var iterator = function(stooge) { return stooge.name; };
assert.deepEqual(_.uniq(list, false, iterator), expected, 'uses the result of `iterator` for uniqueness comparisons (unsorted case)');
assert.deepEqual(_.uniq(list, iterator), expected, '`sorted` argument defaults to false when omitted');
assert.deepEqual(_.uniq(list, 'name'), expected, 'when `iterator` is a string, uses that key for comparisons (unsorted case)');
assert.deepEqual(_.map(_.uniq(list, iterator), iterator), ['moe', 'curly', 'larry'], 'can find the unique values of an array using a custom iterator without specifying whether array is sorted');
iterator = function(value) { return value + 1; };
list = [1, 2, 2, 3, 4, 4];
assert.deepEqual(_.uniq(list, true, iterator), [1, 2, 3, 4], 'iterator works with sorted array');
var kittens = [
{kitten: 'Celery', cuteness: 8},
{kitten: 'Juniper', cuteness: 10},
{kitten: 'Spottis', cuteness: 10}
];
var expected = [
{kitten: 'Celery', cuteness: 8},
{kitten: 'Juniper', cuteness: 10}
];
assert.deepEqual(_.uniq(kittens, true, 'cuteness'), expected, 'string iterator works with sorted array');
list = [{score: 8}, {score: 10}, {score: 10}];
expected = [{score: 8}, {score: 10}];
iterator = function(item) { return item.score; };
assert.deepEqual(_.uniq(list, true, iterator), expected, 'uses the result of `iterator` for uniqueness comparisons (sorted case)');
assert.deepEqual(_.uniq(list, true, 'score'), expected, 'when `iterator` is a string, uses that key for comparisons (sorted case)');
assert.deepEqual(_.uniq([{0: 1}, {0: 1}, {0: 1}, {0: 2}], 0), [{0: 1}, {0: 2}], 'can use falsey pluck like iterator');
var result = (function(){ return _.uniq(arguments); }(1, 2, 1, 3, 1, 4));
assert.deepEqual(result, [1, 2, 3, 4], 'works on an arguments object');
@@ -177,19 +175,17 @@
var a = {}, b = {}, c = {};
assert.deepEqual(_.uniq([a, b, a, b, c]), [a, b, c], 'works on values that can be tested for equivalency but not ordered');
assert.deepEqual(_.uniq(null), []);
assert.deepEqual(_.uniq(null), [], 'returns an empty array when `array` is not iterable');
var context = {};
list = [3];
_.uniq(list, function(value, index, array) {
assert.strictEqual(this, context);
assert.strictEqual(value, 3);
assert.strictEqual(index, 0);
assert.strictEqual(array, list);
assert.strictEqual(this, context, 'executes its iterator in the given context');
assert.strictEqual(value, 3, 'passes its iterator the value');
assert.strictEqual(index, 0, 'passes its iterator the index');
assert.strictEqual(array, list, 'passes its iterator the entire array');
}, context);
assert.deepEqual(_.uniq([{a: 1, b: 1}, {a: 1, b: 2}, {a: 1, b: 3}, {a: 2, b: 1}], 'a'), [{a: 1, b: 1}, {a: 2, b: 1}], 'can use pluck like iterator');
assert.deepEqual(_.uniq([{0: 1, b: 1}, {0: 1, b: 2}, {0: 1, b: 3}, {0: 2, b: 1}], 0), [{0: 1, b: 1}, {0: 2, b: 1}], 'can use falsey pluck like iterator');
});
QUnit.test('unique', function(assert) {
@@ -198,44 +194,54 @@
QUnit.test('intersection', function(assert) {
var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho'];
assert.deepEqual(_.intersection(stooges, leaders), ['moe'], 'can take the set intersection of two arrays');
assert.deepEqual(_.intersection(stooges, leaders), ['moe'], 'can find the set intersection of two arrays');
assert.deepEqual(_(stooges).intersection(leaders), ['moe'], 'can perform an OO-style intersection');
var result = (function(){ return _.intersection(arguments, leaders); }('moe', 'curly', 'larry'));
assert.deepEqual(result, ['moe'], 'works on an arguments object');
var theSixStooges = ['moe', 'moe', 'curly', 'curly', 'larry', 'larry'];
assert.deepEqual(_.intersection(theSixStooges, leaders), ['moe'], 'returns a duplicate-free array');
result = _.intersection([2, 4, 3, 1], [1, 2, 3]);
assert.deepEqual(result, [2, 3, 1], 'preserves order of first array');
assert.deepEqual(result, [2, 3, 1], 'preserves the order of the first array');
result = _.intersection(null, [1, 2, 3]);
assert.equal(Object.prototype.toString.call(result), '[object Array]', 'returns an empty array when passed null as first argument');
assert.equal(result.length, 0, 'returns an empty array when passed null as first argument');
assert.deepEqual(result, [], 'returns an empty array when passed null as the first argument');
result = _.intersection([1, 2, 3], null);
assert.equal(Object.prototype.toString.call(result), '[object Array]', 'returns an empty array when passed null as argument beyond the first');
assert.equal(result.length, 0, 'returns an empty array when passed null as argument beyond the first');
assert.deepEqual(result, [], 'returns an empty array when passed null as an argument beyond the first');
});
QUnit.test('union', function(assert) {
var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]);
assert.deepEqual(result, [1, 2, 3, 30, 40], 'takes the union of a list of arrays');
assert.deepEqual(result, [1, 2, 3, 30, 40], 'can find the union of a list of arrays');
result = _([1, 2, 3]).union([2, 30, 1], [1, 40]);
assert.deepEqual(result, [1, 2, 3, 30, 40], 'can perform an OO-style union');
result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]);
assert.deepEqual(result, [1, 2, 3, 30, 40, [1]], 'takes the union of a list of nested arrays');
assert.deepEqual(result, [1, 2, 3, 30, 40, [1]], 'can find the union of a list of nested arrays');
var args = null;
(function(){ args = arguments; }(1, 2, 3));
result = _.union(args, [2, 30, 1], [1, 40]);
assert.deepEqual(result, [1, 2, 3, 30, 40], 'takes the union of a list of arrays');
result = _.union([10, 20], [1, 30, 10], [0, 40]);
assert.deepEqual(result, [10, 20, 1, 30, 0, 40], 'orders values by their first encounter');
result = _.union([1, 2, 3], 4);
assert.deepEqual(result, [1, 2, 3], 'restrict the union to arrays only');
result = (function(){ return _.union(arguments, [2, 30, 1], [1, 40]); }(1, 2, 3));
assert.deepEqual(result, [1, 2, 3, 30, 40], 'works on an arguments object');
assert.deepEqual(_.union([1, 2, 3], 4), [1, 2, 3], 'restricts the union to arrays only');
});
QUnit.test('difference', function(assert) {
var result = _.difference([1, 2, 3], [2, 30, 40]);
assert.deepEqual(result, [1, 3], 'takes the difference of two arrays');
assert.deepEqual(result, [1, 3], 'can find the difference of two arrays');
result = _([1, 2, 3]).difference([2, 30, 40]);
assert.deepEqual(result, [1, 3], 'can perform an OO-style difference');
result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]);
assert.deepEqual(result, [3, 4], 'takes the difference of three arrays');
assert.deepEqual(result, [3, 4], 'can find the difference of three arrays');
result = _.difference([8, 9, 3, 1], [3, 8]);
assert.deepEqual(result, [9, 1], 'preserves the order of the first array');
result = (function(){ return _.difference(arguments, [2, 30, 40]); }(1, 2, 3));
assert.deepEqual(result, [1, 3], 'works on an arguments object');
result = _.difference([1, 2, 3], 1);
assert.deepEqual(result, [1, 2, 3], 'restrict the difference to arrays only');

View File

@@ -188,7 +188,7 @@
var prod = _.reduce([1, 2, 3, 4], function(memo, num){ return memo * num; });
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), _, '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');
@@ -212,7 +212,7 @@
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.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, 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}];
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.ok(!_.find(list, {c: 1}), 'undefined when not found');
assert.ok(!_.find([], {c: 1}), 'undefined when searching empty list');
assert.notOk(_.find(list, {c: 1}), 'undefined when not found');
assert.notOk(_.find([], {c: 1}), 'undefined when searching empty list');
var result = _.find([1, 2, 3], function(num){ return num * 2 === 4; });
assert.equal(result, 2, 'found the first "2" and broke the loop');
@@ -348,25 +348,25 @@
QUnit.test('every', function(assert) {
assert.ok(_.every([], _.identity), 'the empty set');
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, 11, 28], function(num){ return num % 2 === 0; }), 'an odd number');
assert.ok(_.every([1], _.identity) === true, 'cast to boolean - true');
assert.ok(_.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([0, 11, 28], function(num){ return num % 2 === 0; }), 'an odd number');
assert.strictEqual(_.every([1], _.identity), true, 'cast to boolean - true');
assert.strictEqual(_.every([0], _.identity), false, 'cast to boolean - false');
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}];
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');
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, '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}, _.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', '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) {
@@ -374,29 +374,29 @@
});
QUnit.test('some', function(assert) {
assert.ok(!_.some([]), 'the empty set');
assert.ok(!_.some([false, false, false]), 'all false values');
assert.notOk(_.some([]), 'the empty set');
assert.notOk(_.some([false, false, false]), 'all false values');
assert.ok(_.some([false, false, true]), 'one true value');
assert.ok(_.some([null, 0, 'yes', false]), 'a string');
assert.ok(!_.some([null, 0, '', false]), 'falsy values');
assert.ok(!_.some([1, 11, 29], function(num){ return num % 2 === 0; }), 'all odd numbers');
assert.notOk(_.some([null, 0, '', false]), 'falsy values');
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], _.identity) === true, 'cast to boolean - true');
assert.ok(_.some([0], _.identity) === false, 'cast to boolean - false');
assert.strictEqual(_.some([1], _.identity), true, 'cast to boolean - true');
assert.strictEqual(_.some([0], _.identity), false, 'cast to boolean - false');
assert.ok(_.some([false, false, true]));
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');
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, '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}, _.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(['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) {
@@ -408,11 +408,11 @@
assert.strictEqual(_.includes(val, 'hasOwnProperty'), false);
});
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.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');
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(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; });
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(_.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(3, _.max(['test', 1, 2, 3]), 'Finds correct max in array starting with NaN');
assert.equal(_.max([1, 2, 3, 'test']), 3, 'Finds correct max in array starting with num and containing a 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(3, _.max([null, 1, 2, 3]), 'Finds correct max in array starting with a `null`');
assert.equal(_.max([1, 2, 3, null]), 3, 'Finds correct max in array starting with num and containing 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(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 num and containing 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(3, _.max([false, 1, 2, 3]), 'Finds correct max in array starting with a false');
assert.equal(_.max([1, 2, 3, false]), 3, 'Finds correct max in array starting with num and containing 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(0, _.max([-3, -2, -1, 0]), 'Finds correct max in array containing negative numbers');
assert.equal(_.max([0, 1, 2, 3, 4]), 4, 'Finds correct max in array containing a zero');
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 b = {x: -Infinity};
@@ -590,35 +590,35 @@
});
QUnit.test('min', function(assert) {
assert.equal(Infinity, _.min(null), 'can handle null/undefined');
assert.equal(Infinity, _.min(void 0), 'can handle null/undefined');
assert.equal(Infinity, _.min(null, _.identity), 'can handle null/undefined');
assert.equal(_.min(null), Infinity, 'can handle null/undefined');
assert.equal(_.min(void 0), Infinity, '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; });
assert.equal(neg, 3, 'can perform a computation-based min');
assert.equal(Infinity, _.min({}), '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 object');
assert.equal(_.min([]), Infinity, 'Minimum value of an empty array');
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 then = new Date(0);
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(1, _.min(['test', 1, 2, 3]), 'Finds correct min in array starting with NaN');
assert.equal(_.min([1, 2, 3, 'test']), 1, 'Finds correct min in array starting with num and containing a 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(1, _.min([null, 1, 2, 3]), 'Finds correct min in array starting with a `null`');
assert.equal(_.min([1, 2, 3, null]), 1, 'Finds correct min in array starting with num and containing 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(-3, _.min([-3, -2, -1, 0]), 'Finds correct min in array containing negative numbers');
assert.equal(_.min([0, 1, 2, 3, 4]), 0, 'Finds correct min in array containing a zero');
assert.equal(_.min([-3, -2, -1, 0]), -3, 'Finds correct min in array containing negative numbers');
var a = {x: Infinity};
var b = {x: Infinity};
@@ -692,7 +692,7 @@
assert.deepEqual(grouped['5'], ['three', 'seven', 'eight']);
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) {
return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
@@ -701,7 +701,7 @@
assert.equal(grouped.hasOwnProperty.length, 2);
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];
grouped = _.groupBy(array);
@@ -747,7 +747,7 @@
assert.equal(grouped['5'], 3);
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) {
return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
@@ -756,7 +756,7 @@
assert.equal(grouped.hasOwnProperty, 2);
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];
grouped = _.countBy(array);
@@ -797,10 +797,10 @@
});
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');
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');
var numbers = _.toArray({one: 1, two: 2, three: 3});
@@ -882,7 +882,7 @@
assert.deepEqual(_.map(elementChildren, 'id'), ['id1', 'id2']);
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));
function compareNode(node) {

View File

@@ -35,7 +35,7 @@
QUnit.test('isEqual', function(assert) {
assert.ok(!_.isEqual(iNumber, 101));
assert.notOk(_.isEqual(iNumber, 101));
assert.ok(_.isEqual(iNumber, 100));
// Objects from another frame.
@@ -46,13 +46,13 @@
});
QUnit.test('isEmpty', function(assert) {
assert.ok(!_([iNumber]).isEmpty(), '[1] is not empty');
assert.ok(!_.isEmpty(iArray), '[] is empty');
assert.notOk(_([iNumber]).isEmpty(), '[1] is not empty');
assert.notOk(_.isEmpty(iArray), '[] is empty');
assert.ok(_.isEmpty(iObject), '{} is empty');
});
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(iElement), 'even from another frame');
});
@@ -113,12 +113,12 @@
if (typeof ActiveXObject != 'undefined') {
QUnit.test('IE host objects', function(assert) {
var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
assert.ok(!_.isNumber(xml));
assert.ok(!_.isBoolean(xml));
assert.ok(!_.isNaN(xml));
assert.ok(!_.isFunction(xml));
assert.ok(!_.isNull(xml));
assert.ok(!_.isUndefined(xml));
assert.notOk(_.isNumber(xml));
assert.notOk(_.isBoolean(xml));
assert.notOk(_.isNaN(xml));
assert.notOk(_.isFunction(xml));
assert.notOk(_.isNull(xml));
assert.notOk(_.isUndefined(xml));
});
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 delayed = false;
_.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);
});
@@ -475,9 +475,9 @@
});
QUnit.test('debounce asap', function(assert) {
assert.expect(4);
assert.expect(6);
var done = assert.async();
var a, b;
var a, b, c;
var counter = 0;
var incr = function(){ return ++counter; };
var debouncedIncr = _.debounce(incr, 64, true);
@@ -489,7 +489,13 @@
_.delay(debouncedIncr, 16);
_.delay(debouncedIncr, 32);
_.delay(debouncedIncr, 48);
_.delay(function(){ assert.equal(counter, 1, 'incr was debounced'); done(); }, 128);
_.delay(function(){
assert.equal(counter, 1, 'incr was debounced');
c = debouncedIncr();
assert.equal(c, 2);
assert.equal(counter, 2, 'incr was called again');
done();
}, 128);
});
QUnit.test('debounce asap cancel', function(assert) {
@@ -688,6 +694,43 @@
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) {

View File

@@ -123,7 +123,7 @@
subObj.c = 'd';
assert.deepEqual(_.extend({}, subObj), {a: 'b', c: 'd'}, 'extend copies all properties from source');
_.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 {
result = {};
@@ -205,7 +205,7 @@
return this[key] === 3 && this === instance;
}, 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) {
assert.equal(obj, data, 'passes same object as third parameter of iteratee');
});
@@ -309,7 +309,7 @@
Child.prototype.foo = 'foo';
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) {
@@ -326,10 +326,10 @@
assert.ok(_.isEqual(null, null), '`null` is equal to `null`');
assert.ok(_.isEqual(), '`undefined` is equal to `undefined`');
assert.ok(!_.isEqual(0, -0), '`0` is not equal to `-0`');
assert.ok(!_.isEqual(-0, 0), 'Commutative equality is implemented for `0` and `-0`');
assert.ok(!_.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(0, -0), '`0` is not equal to `-0`');
assert.notOk(_.isEqual(-0, 0), 'Commutative equality is implemented for `0` and `-0`');
assert.notOk(_.isEqual(null, void 0), '`null` is not equal to `undefined`');
assert.notOk(_.isEqual(void 0, null), 'Commutative equality is implemented for `null` and `undefined`');
// String object and primitive comparisons.
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('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.ok(!_.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('Curly', 'Larry'), 'String primitives with different values are not equal');
assert.notOk(_.isEqual(new String('Curly'), new String('Larry')), 'String objects with different primitive values 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.
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(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(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(new Number(0), -0), '`new Number(0)` and `-0` are not equal');
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.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(75), new Number(63)), 'Number objects with different primitive values 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`.
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(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.ok(!_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`');
assert.notOk(_.isEqual(61, NaN), 'A number primitive is not equal to `NaN`');
assert.notOk(_.isEqual(new Number(79), NaN), 'A number object is not equal to `NaN`');
assert.notOk(_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`');
// Boolean object and primitive comparisons.
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(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), 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.
assert.ok(!_.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.ok(!_.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.ok(!_.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.ok(!_.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.ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal');
assert.notOk(_.isEqual(new Boolean(false), true), '`new Boolean(false)` is not equal to `true`');
assert.notOk(_.isEqual('75', 75), 'String and number primitives 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.notOk(_.isEqual(75, '75'), 'Commutative equality is implemented for like string and number values');
assert.notOk(_.isEqual(0, ''), 'Number and string primitives with like values are not equal');
assert.notOk(_.isEqual(1, true), 'Number and boolean primitives 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.notOk(_.isEqual(false, new String('')), 'Boolean primitives and string objects with like values are not equal');
assert.notOk(_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal');
// 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, 11, 13)), 'Date objects referencing different times are not equal');
assert.ok(!_.isEqual(new Date(2009, 11, 13), {
assert.notOk(_.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, 11, 13), {
getTime: function(){
return 12606876e5;
}
}), '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.
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.
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(/(?:)/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.ok(!_.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(/(?:)/g, /(?:)/gi), 'RegExps with equivalent patterns and different flags are not equal');
assert.notOk(_.isEqual(/Moe/gim, /Curly/gim), 'RegExps with different patterns and equivalent flags are not equal');
assert.notOk(_.isEqual(/(?:)/gi, /(?:)/g), 'Commutative equality is implemented for RegExps');
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.
assert.ok(_.isEqual({}, {}), 'Empty object literals are equal');
assert.ok(_.isEqual([], []), 'Empty array literals 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.ok(!_.isEqual([], {length: 0}), 'Commutative equality is implemented for array-like objects');
assert.notOk(_.isEqual({length: 0}, []), 'Array-like objects and arrays are not equal.');
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.ok(!_.isEqual([], {}), 'Commutative equality is implemented for objects and arrays');
assert.notOk(_.isEqual({}, []), 'Object literals and array literals are not equal');
assert.notOk(_.isEqual([], {}), 'Commutative equality is implemented for objects and arrays');
// Arrays with primitive and object values.
assert.ok(_.isEqual([1, 'Larry', true], [1, 'Larry', true]), 'Arrays containing identical primitives are equal');
@@ -424,14 +424,14 @@
// Array elements and properties.
assert.ok(_.isEqual(a, b), 'Arrays containing equivalent elements and different non-numeric properties are equal');
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');
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.
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 = [];
sparse[1] = 5;
@@ -440,11 +440,11 @@
// 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/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.ok(!_.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.ok(!_.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({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, c: 55}), 'Objects of identical sizes with different property names are not equal');
assert.notOk(_.isEqual({a: 1, b: 2}, {a: 1}), 'Objects of different sizes are not equal');
assert.notOk(_.isEqual({a: 1}, {a: 1, b: 2}), 'Commutative equality is implemented for objects');
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 = {
@@ -479,9 +479,9 @@
// Instances.
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.ok(!_.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(new First, new Second), 'Objects with different constructors and identical own properties are not equal');
assert.notOk(_.isEqual({value: 1}, new First), 'Object instances and objects sharing equivalent properties are not equal');
assert.notOk(_.isEqual({value: 2}, new Second), 'The prototype chain of objects should not be examined');
// Circular Arrays.
(a = []).push(a);
@@ -492,13 +492,13 @@
assert.ok(_.isEqual(a, b), 'Arrays containing circular references and equivalent properties are equal');
a.push('Shemp');
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.
a = ['everything is checked but', 'this', 'is not'];
a[1] = a;
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.
a = {abc: null};
@@ -511,13 +511,13 @@
assert.ok(_.isEqual(a, b), 'Objects containing circular references and equivalent properties are equal');
a.def = new Number(75);
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.
a = {everything: 'is checked', but: 'this', is: 'not'};
a.but = a;
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.
a = [{abc: null}];
@@ -530,7 +530,7 @@
assert.ok(_.isEqual(a, b), 'Cyclic structures containing equivalent properties are equal');
a[0].def = new String('Larry');
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.
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');
// 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();
b = _({x: 1, y: 2}).chain();
@@ -565,18 +565,26 @@
assert.equal(_.isEqual({a: 0}, {a: -0}), false);
assert.equal(_.isEqual([NaN], [NaN]), true);
assert.equal(_.isEqual({a: NaN}, {a: NaN}), true);
if (typeof Symbol !== 'undefined') {
var symbol = Symbol('x');
assert.strictEqual(_.isEqual(symbol, symbol), true, 'A symbol is equal to itself');
assert.strictEqual(_.isEqual(symbol, Object(symbol)), true, 'Even when wrapped in Object()');
assert.strictEqual(_.isEqual(symbol, null), false, 'Different types are not equal');
}
});
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({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(new RegExp('')), 'objects with prototype properties are empty');
assert.ok(_.isEmpty(null), 'null is empty');
assert.ok(_.isEmpty(), 'undefined 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};
delete obj.one;
@@ -584,27 +592,27 @@
var args = function(){ return arguments; };
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
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') {
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');
});
}
QUnit.test('isArguments', function(assert) {
var args = (function(){ return arguments; }(1, 2, 3));
assert.ok(!_.isArguments('string'), 'a string is not an arguments object');
assert.ok(!_.isArguments(_.isArguments), 'a function is not an arguments object');
assert.notOk(_.isArguments('string'), 'a string 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(_.toArray(args)), 'but not when it\'s converted into an array');
assert.ok(!_.isArguments([1, 2, 3]), 'and not vanilla arrays.');
assert.notOk(_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array');
assert.notOk(_.isArguments([1, 2, 3]), 'and not vanilla arrays.');
});
QUnit.test('isObject', function(assert) {
@@ -614,24 +622,24 @@
assert.ok(_.isObject(testElement), 'and DOM element');
}
assert.ok(_.isObject(function() {}), 'and functions');
assert.ok(!_.isObject(null), 'but not null');
assert.ok(!_.isObject(void 0), 'and not undefined');
assert.ok(!_.isObject('string'), 'and not string');
assert.ok(!_.isObject(12), 'and not number');
assert.ok(!_.isObject(true), 'and not boolean');
assert.notOk(_.isObject(null), 'but not null');
assert.notOk(_.isObject(void 0), 'and not undefined');
assert.notOk(_.isObject('string'), 'and not string');
assert.notOk(_.isObject(12), 'and not number');
assert.notOk(_.isObject(true), 'and not boolean');
assert.ok(_.isObject(new String('string')), 'but new String()');
});
QUnit.test('isArray', function(assert) {
assert.ok(!_.isArray(void 0), 'undefined vars are not arrays');
assert.ok(!_.isArray(arguments), 'the arguments object is not an array');
assert.notOk(_.isArray(void 0), 'undefined vars are not arrays');
assert.notOk(_.isArray(arguments), 'the arguments object is not an array');
assert.ok(_.isArray([1, 2, 3]), 'but arrays are');
});
QUnit.test('isString', function(assert) {
var obj = new String('I am a string object');
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.strictEqual(_.isString('I am a string literal'), true, 'string literals are');
@@ -639,43 +647,148 @@
assert.strictEqual(_.isString(1), false);
});
QUnit.test('isSymbol', function(assert) {
assert.notOk(_.isSymbol(0), 'numbers are not symbols');
assert.notOk(_.isSymbol(''), 'strings are not symbols');
assert.notOk(_.isSymbol(_.isSymbol), 'functions are not symbols');
if (typeof Symbol === 'function') {
assert.ok(_.isSymbol(Symbol()), 'symbols are symbols');
assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols');
assert.ok(_.isSymbol(Object(Symbol())), 'boxed symbols are symbols');
}
});
QUnit.test('isNumber', function(assert) {
assert.ok(!_.isNumber('string'), 'a string is not a number');
assert.ok(!_.isNumber(arguments), 'the arguments object is not a number');
assert.ok(!_.isNumber(void 0), 'undefined is not a number');
assert.notOk(_.isNumber('string'), 'a string is not a number');
assert.notOk(_.isNumber(arguments), 'the arguments object 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(NaN), 'NaN *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) {
assert.ok(!_.isBoolean(2), 'a number is not a boolean');
assert.ok(!_.isBoolean('string'), 'a string is not a boolean');
assert.ok(!_.isBoolean('false'), 'the string "false" is not a boolean');
assert.ok(!_.isBoolean('true'), 'the string "true" is not a boolean');
assert.ok(!_.isBoolean(arguments), 'the arguments object is not a boolean');
assert.ok(!_.isBoolean(void 0), 'undefined is not a boolean');
assert.ok(!_.isBoolean(NaN), 'NaN is not a boolean');
assert.ok(!_.isBoolean(null), 'null is not a boolean');
assert.notOk(_.isBoolean(2), 'a number is not a boolean');
assert.notOk(_.isBoolean('string'), 'a string is not a boolean');
assert.notOk(_.isBoolean('false'), 'the string "false" is not a boolean');
assert.notOk(_.isBoolean('true'), 'the string "true" is not a boolean');
assert.notOk(_.isBoolean(arguments), 'the arguments object is not a boolean');
assert.notOk(_.isBoolean(void 0), 'undefined is not a boolean');
assert.notOk(_.isBoolean(NaN), 'NaN is not a boolean');
assert.notOk(_.isBoolean(null), 'null is not a boolean');
assert.ok(_.isBoolean(true), 'but true is');
assert.ok(_.isBoolean(false), 'and so is false');
});
QUnit.test('isMap', function(assert) {
assert.notOk(_.isMap('string'), 'a string is not a map');
assert.notOk(_.isMap(2), 'a number is not a map');
assert.notOk(_.isMap({}), 'an object is not a map');
assert.notOk(_.isMap(false), 'a boolean is not a map');
assert.notOk(_.isMap(void 0), 'undefined is not a map');
assert.notOk(_.isMap([1, 2, 3]), 'an array is not a map');
if (typeof Set === 'function') {
assert.notOk(_.isMap(new Set()), 'a set is not a map');
}
if (typeof WeakSet === 'function') {
assert.notOk(_.isMap(new WeakSet()), 'a weakset is not a map');
}
if (typeof WeakMap === 'function') {
assert.notOk(_.isMap(new WeakMap()), 'a weakmap is not a map');
}
if (typeof Map === 'function') {
var keyString = 'a string';
var obj = new Map();
obj.set(keyString, 'value');
assert.ok(_.isMap(obj), 'but a map is');
}
});
QUnit.test('isWeakMap', function(assert) {
assert.notOk(_.isWeakMap('string'), 'a string is not a weakmap');
assert.notOk(_.isWeakMap(2), 'a number is not a weakmap');
assert.notOk(_.isWeakMap({}), 'an object is not a weakmap');
assert.notOk(_.isWeakMap(false), 'a boolean is not a weakmap');
assert.notOk(_.isWeakMap(void 0), 'undefined is not a weakmap');
assert.notOk(_.isWeakMap([1, 2, 3]), 'an array is not a weakmap');
if (typeof Set === 'function') {
assert.notOk(_.isWeakMap(new Set()), 'a set is not a weakmap');
}
if (typeof WeakSet === 'function') {
assert.notOk(_.isWeakMap(new WeakSet()), 'a weakset is not a weakmap');
}
if (typeof Map === 'function') {
assert.notOk(_.isWeakMap(new Map()), 'a map is not a weakmap');
}
if (typeof WeakMap === 'function') {
var keyObj = {}, obj = new WeakMap();
obj.set(keyObj, 'value');
assert.ok(_.isWeakMap(obj), 'but a weakmap is');
}
});
QUnit.test('isSet', function(assert) {
assert.notOk(_.isSet('string'), 'a string is not a set');
assert.notOk(_.isSet(2), 'a number is not a set');
assert.notOk(_.isSet({}), 'an object is not a set');
assert.notOk(_.isSet(false), 'a boolean is not a set');
assert.notOk(_.isSet(void 0), 'undefined is not a set');
assert.notOk(_.isSet([1, 2, 3]), 'an array is not a set');
if (typeof Map === 'function') {
assert.notOk(_.isSet(new Map()), 'a map is not a set');
}
if (typeof WeakMap === 'function') {
assert.notOk(_.isSet(new WeakMap()), 'a weakmap is not a set');
}
if (typeof WeakSet === 'function') {
assert.notOk(_.isSet(new WeakSet()), 'a weakset is not a set');
}
if (typeof Set === 'function') {
var obj = new Set();
obj.add(1).add('string').add(false).add({});
assert.ok(_.isSet(obj), 'but a set is');
}
});
QUnit.test('isWeakSet', function(assert) {
assert.notOk(_.isWeakSet('string'), 'a string is not a weakset');
assert.notOk(_.isWeakSet(2), 'a number is not a weakset');
assert.notOk(_.isWeakSet({}), 'an object is not a weakset');
assert.notOk(_.isWeakSet(false), 'a boolean is not a weakset');
assert.notOk(_.isWeakSet(void 0), 'undefined is not a weakset');
assert.notOk(_.isWeakSet([1, 2, 3]), 'an array is not a weakset');
if (typeof Map === 'function') {
assert.notOk(_.isWeakSet(new Map()), 'a map is not a weakset');
}
if (typeof WeakMap === 'function') {
assert.notOk(_.isWeakSet(new WeakMap()), 'a weakmap is not a weakset');
}
if (typeof Set === 'function') {
assert.notOk(_.isWeakSet(new Set()), 'a set is not a weakset');
}
if (typeof WeakSet === 'function') {
var obj = new WeakSet();
obj.add({x: 1}, {y: 'string'}).add({y: 'string'}).add({z: [1, 2, 3]});
assert.ok(_.isWeakSet(obj), 'but a weakset is');
}
});
QUnit.test('isFunction', function(assert) {
assert.ok(!_.isFunction(void 0), 'undefined vars are not functions');
assert.ok(!_.isFunction([1, 2, 3]), 'arrays are not functions');
assert.ok(!_.isFunction('moe'), 'strings are not functions');
assert.notOk(_.isFunction(void 0), 'undefined vars are not functions');
assert.notOk(_.isFunction([1, 2, 3]), 'arrays are not functions');
assert.notOk(_.isFunction('moe'), 'strings are not functions');
assert.ok(_.isFunction(_.isFunction), 'but functions are');
assert.ok(_.isFunction(function(){}), 'even anonymous ones');
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;
if (nodelist) {
assert.ok(!_.isFunction(nodelist));
assert.notOk(_.isFunction(nodelist));
}
});
@@ -693,60 +806,68 @@
}
QUnit.test('isDate', function(assert) {
assert.ok(!_.isDate(100), 'numbers are not dates');
assert.ok(!_.isDate({}), 'objects are not dates');
assert.notOk(_.isDate(100), 'numbers are not dates');
assert.notOk(_.isDate({}), 'objects are not dates');
assert.ok(_.isDate(new Date()), 'but dates are');
});
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');
});
QUnit.test('isFinite', function(assert) {
assert.ok(!_.isFinite(void 0), 'undefined is not finite');
assert.ok(!_.isFinite(null), 'null is not finite');
assert.ok(!_.isFinite(NaN), 'NaN is not finite');
assert.ok(!_.isFinite(Infinity), 'Infinity is not finite');
assert.ok(!_.isFinite(-Infinity), '-Infinity is not finite');
assert.notOk(_.isFinite(void 0), 'undefined is not finite');
assert.notOk(_.isFinite(null), 'null is not finite');
assert.notOk(_.isFinite(NaN), 'NaN is not finite');
assert.notOk(_.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('1a'), 'Non numeric strings are not numbers');
assert.ok(!_.isFinite(''), 'Empty strings are not numbers');
assert.notOk(_.isFinite('1a'), 'Non numeric strings are not numbers');
assert.notOk(_.isFinite(''), 'Empty strings are not numbers');
var obj = new Number(5);
assert.ok(_.isFinite(obj), 'Number instances can be finite');
assert.ok(_.isFinite(0), '0 is finite');
assert.ok(_.isFinite(123), 'Ints are finite');
assert.ok(_.isFinite(-12.44), 'Floats are finite');
if (typeof Symbol === 'function') {
assert.notOk(_.isFinite(Symbol()), 'symbols are not numbers');
assert.notOk(_.isFinite(Symbol('description')), 'described symbols are not numbers');
assert.notOk(_.isFinite(Object(Symbol())), 'boxed symbols are not numbers');
}
});
QUnit.test('isNaN', function(assert) {
assert.ok(!_.isNaN(void 0), 'undefined is not NaN');
assert.ok(!_.isNaN(null), 'null is not NaN');
assert.ok(!_.isNaN(0), '0 is not NaN');
assert.ok(!_.isNaN(new Number(0)), 'wrapped 0 is not NaN');
assert.notOk(_.isNaN(void 0), 'undefined is not NaN');
assert.notOk(_.isNaN(null), 'null is not NaN');
assert.notOk(_.isNaN(0), '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(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) {
assert.ok(!_.isNull(void 0), 'undefined is not null');
assert.ok(!_.isNull(NaN), 'NaN is not null');
assert.notOk(_.isNull(void 0), 'undefined is not null');
assert.notOk(_.isNull(NaN), 'NaN is not null');
assert.ok(_.isNull(null), 'but null is');
});
QUnit.test('isUndefined', function(assert) {
assert.ok(!_.isUndefined(1), 'numbers are defined');
assert.ok(!_.isUndefined(null), 'null is defined');
assert.ok(!_.isUndefined(false), 'false is defined');
assert.ok(!_.isUndefined(NaN), 'NaN is defined');
assert.notOk(_.isUndefined(1), 'numbers are defined');
assert.notOk(_.isUndefined(null), 'null is defined');
assert.notOk(_.isUndefined(false), 'false is defined');
assert.notOk(_.isUndefined(NaN), 'NaN is defined');
assert.ok(_.isUndefined(), 'nothing is undefined');
assert.ok(_.isUndefined(void 0), 'undefined is undefined');
});
QUnit.test('isError', function(assert) {
assert.ok(!_.isError(1), 'numbers are not Errors');
assert.ok(!_.isError(null), 'null is not an Error');
assert.ok(!_.isError(Error), 'functions are not Errors');
assert.notOk(_.isError(1), 'numbers are not Errors');
assert.notOk(_.isError(null), 'null is not an Error');
assert.notOk(_.isError(Error), 'functions are not Errors');
assert.ok(_.isError(new Error()), 'Errors are Errors');
assert.ok(_.isError(new EvalError()), 'EvalErrors are Errors');
assert.ok(_.isError(new RangeError()), 'RangeErrors are Errors');
@@ -775,13 +896,13 @@
QUnit.test('has', function(assert) {
var obj = {foo: 'bar', func: function(){}};
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.');
obj.hasOwnProperty = null;
assert.ok(_.has(obj, 'foo'), 'has() works even when the hasOwnProperty method is deleted.');
var child = {};
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(void 0, 'foo'), false, 'has() returns false for undefined');
});
@@ -840,8 +961,8 @@
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.ok(_.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({hair: false})), curly, 'returns a predicate that can be used by finding functions.');
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(null)), [null, void 0], 'null matches null');

View File

@@ -52,8 +52,8 @@
QUnit.test('#750 - Return _ instance.', function(assert) {
assert.expect(2);
var instance = _([]);
assert.ok(_(instance) === instance);
assert.ok(new _(instance) === instance);
assert.strictEqual(_(instance), instance);
assert.strictEqual(new _(instance), instance);
});
QUnit.test('identity', function(assert) {
@@ -137,11 +137,12 @@
});
QUnit.test('mixin', function(assert) {
_.mixin({
var ret = _.mixin({
myReverse: function(string) {
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(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper');
});
@@ -188,7 +189,7 @@
var str = 'some string & another string & yet another';
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;');
});
@@ -370,9 +371,9 @@
});
QUnit.test('#547 - _.templateSettings is unchanged by custom settings.', function(assert) {
assert.ok(!_.templateSettings.variable);
assert.notOk(_.templateSettings.variable);
_.template('', {}, {variable: 'x'});
assert.ok(!_.templateSettings.variable);
assert.notOk(_.templateSettings.variable);
});
QUnit.test('#556 - undefined template variables.', function(assert) {
@@ -397,11 +398,11 @@
assert.expect(2);
var count = 0;
var template = _.template('<%= f() %>');
template({f: function(){ assert.ok(!count++); }});
template({f: function(){ assert.notOk(count++); }});
var countEscaped = 0;
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) {

View File

@@ -1,6 +1,6 @@
// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// (c) 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function() {
@@ -20,6 +20,7 @@
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype;
var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
// Create quick reference variables for speed access to core prototypes.
var push = ArrayProto.push,
@@ -83,18 +84,23 @@
};
};
var builtinIteratee;
// An internal function to generate callbacks that can be applied to each
// element in a collection, returning the desired result — either `identity`,
// an arbitrary callback, a property matcher, or a property accessor.
var cb = function(value, context, argCount) {
if (_.iteratee !== builtinIteratee) return _.iteratee(value, context);
if (value == null) return _.identity;
if (_.isFunction(value)) return optimizeCb(value, context, argCount);
if (_.isObject(value)) return _.matcher(value);
return _.property(value);
};
// An external wrapper for the internal callback generator
_.iteratee = function(value, context) {
// External wrapper for our callback generator. Users may customize
// `_.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);
};
@@ -218,12 +224,8 @@
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, predicate, context) {
var key;
if (isArrayLike(obj)) {
key = _.findIndex(obj, predicate, context);
} else {
key = _.findKey(obj, predicate, context);
}
var keyFinder = isArrayLike(obj) ? _.findIndex : _.findKey;
var key = keyFinder(obj, predicate, context);
if (key !== void 0 && key !== -1) return obj[key];
};
@@ -465,7 +467,7 @@
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.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];
return _.initial(array, array.length - n);
};
@@ -480,7 +482,7 @@
// Get the last element of an array. Passing **n** will return the last N
// values in the array.
_.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];
return _.rest(array, Math.max(0, array.length - n));
};
@@ -494,7 +496,7 @@
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
return _.filter(array, Boolean);
};
// Internal implementation of a recursive `flatten` function.
@@ -504,7 +506,7 @@
for (var i = 0, length = getLength(input); i < length; i++) {
var value = input[i];
if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
// Flatten current level of array or arguments object
// Flatten current level of array or arguments object.
if (shallow) {
var j = 0, len = value.length;
while (j < len) output[idx++] = value[j++];
@@ -592,7 +594,7 @@
});
// Complement of _.zip. Unzip accepts an array of arrays and groups
// each array's elements on shared indices
// each array's elements on shared indices.
_.unzip = function(array) {
var length = array && _.max(array, getLength).length || 0;
var result = Array(length);
@@ -622,7 +624,7 @@
return result;
};
// Generator function to create the findIndex and findLastIndex functions
// Generator function to create the findIndex and findLastIndex functions.
var createPredicateIndexFinder = function(dir) {
return function(array, predicate, context) {
predicate = cb(predicate, context);
@@ -635,7 +637,7 @@
};
};
// Returns the first index on an array-like that passes a predicate test
// Returns the first index on an array-like that passes a predicate test.
_.findIndex = createPredicateIndexFinder(1);
_.findLastIndex = createPredicateIndexFinder(-1);
@@ -652,7 +654,7 @@
return low;
};
// Generator function to create the indexOf and lastIndexOf functions
// Generator function to create the indexOf and lastIndexOf functions.
var createIndexFinder = function(dir, predicateFind, sortedIndex) {
return function(array, item, idx) {
var i = 0, length = getLength(array);
@@ -707,7 +709,7 @@
};
// Split an **array** into several arrays containing **count** or less elements
// of initial array
// of initial array.
_.chunk = function(array, count) {
if (count == null || count < 1) return [];
@@ -723,7 +725,7 @@
// ------------------
// Determines whether to execute a function as a constructor
// or a normal function with the provided arguments
// or a normal function with the provided arguments.
var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
var self = baseCreate(sourceFunc.prototype);
@@ -859,12 +861,12 @@
};
var debounced = restArgs(function(args) {
var callNow = immediate && !timeout;
if (timeout) clearTimeout(timeout);
if (callNow) {
if (immediate) {
var callNow = !timeout;
timeout = setTimeout(later, wait);
result = func.apply(this, args);
} else if (!immediate) {
if (callNow) result = func.apply(this, args);
} else {
timeout = _.delay(later, wait, this, args);
}
@@ -959,7 +961,7 @@
};
// Retrieve the names of an object's own properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
// Delegates to **ECMAScript 5**'s native `Object.keys`.
_.keys = function(obj) {
if (!_.isObject(obj)) return [];
if (nativeKeys) return nativeKeys(obj);
@@ -991,8 +993,8 @@
return values;
};
// Returns the results of applying the iteratee to each element of the object
// In contrast to _.map it returns an object
// Returns the results of applying the iteratee to each element of the object.
// In contrast to _.map it returns an object.
_.mapObject = function(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var keys = _.keys(obj),
@@ -1027,7 +1029,7 @@
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
// Aliased as `methods`.
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
@@ -1058,11 +1060,11 @@
// Extend a given object with all the properties in passed-in object(s).
_.extend = createAssigner(_.allKeys);
// Assigns a given object with all the own properties in the passed-in object(s)
// Assigns a given object with all the own properties in the passed-in object(s).
// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
_.extendOwn = _.assign = createAssigner(_.keys);
// Returns the first key on an object that passes a predicate test
// Returns the first key on an object that passes a predicate test.
_.findKey = function(obj, predicate, context) {
predicate = cb(predicate, context);
var keys = _.keys(obj), key;
@@ -1097,7 +1099,7 @@
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) {
var iteratee = keys[0], context;
if (_.isFunction(iteratee)) {
@@ -1185,7 +1187,7 @@
return '' + a === '' + b;
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive.
// Object(NaN) is equivalent to NaN
// Object(NaN) is equivalent to NaN.
if (+a !== +a) return +b !== +b;
// An `egal` comparison is performed for other numeric values.
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
@@ -1195,6 +1197,8 @@
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a === +b;
case '[object Symbol]':
return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
}
var areArrays = className === '[object Array]';
@@ -1285,8 +1289,8 @@
return type === 'function' || type === 'object' && !!obj;
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet.
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) === '[object ' + name + ']';
};
@@ -1311,7 +1315,7 @@
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
return !_.isSymbol(obj) && isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`?
@@ -1404,7 +1408,7 @@
return new Date().getTime();
};
// List of HTML entities for escaping.
// List of HTML entities for escaping.
var escapeMap = {
'&': '&amp;',
'<': '&lt;',
@@ -1420,7 +1424,7 @@
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped
// Regexes for identifying a key that needs to be escaped.
var source = '(?:' + _.keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
@@ -1569,6 +1573,7 @@
return chainResult(this, func.apply(_, args));
};
});
return _;
};
// Add all of the Underscore functions to the wrapper object.
@@ -1603,7 +1608,7 @@
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
_.prototype.toString = function() {
return '' + this._wrapped;
return String(this._wrapped);
};
// AMD registration happens at the end for compatibility with AMD loaders