mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
435 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afcd5bc1e8 | ||
|
|
6a2cc1dfcf | ||
|
|
a67a085cc0 | ||
|
|
c7c70a7da5 | ||
|
|
aa18212085 | ||
|
|
a79c5c434c | ||
|
|
bd518dd906 | ||
|
|
49683ffd5d | ||
|
|
5308be3ba6 | ||
|
|
b5c59317ea | ||
|
|
0b28b7f7b6 | ||
|
|
97d4a2fe19 | ||
|
|
2da024c3b4 | ||
|
|
540148d2c0 | ||
|
|
2f79053d7b | ||
|
|
5aaf898a8f | ||
|
|
bcd0610069 | ||
|
|
2f900b62fe | ||
|
|
e0029485ab | ||
|
|
86a852fe76 | ||
|
|
74b09d6272 | ||
|
|
08110bdcf3 | ||
|
|
0541ec89cc | ||
|
|
588bf3e20d | ||
|
|
3f585df05c | ||
|
|
04ebca6c86 | ||
|
|
cefddab1ca | ||
|
|
a6b960be00 | ||
|
|
657f8bf71e | ||
|
|
619ac69746 | ||
|
|
23b2a33e75 | ||
|
|
23286d6428 | ||
|
|
898b378f06 | ||
|
|
29eb5713f5 | ||
|
|
5df1777477 | ||
|
|
ad38dc0115 | ||
|
|
0e9d44eedb | ||
|
|
e51a424513 | ||
|
|
abb54cc49a | ||
|
|
3ebb38d389 | ||
|
|
ed4b3a2ddb | ||
|
|
91c9cb1ea3 | ||
|
|
9971765d0c | ||
|
|
e5f840745b | ||
|
|
1011cfdf4c | ||
|
|
2cf08be625 | ||
|
|
8b441a506b | ||
|
|
f90d0aec23 | ||
|
|
e2555a43ad | ||
|
|
15e1557b2a | ||
|
|
5b4dc54465 | ||
|
|
37cd5dc97a | ||
|
|
a965836cf3 | ||
|
|
ff4949b8c2 | ||
|
|
4f68e93a43 | ||
|
|
142cee066d | ||
|
|
e2ae5b857c | ||
|
|
f8c7064d45 | ||
|
|
becd982749 | ||
|
|
dce7fccbb6 | ||
|
|
8bc17fe659 | ||
|
|
4df32723c2 | ||
|
|
abde9319fd | ||
|
|
488e62bd79 | ||
|
|
8fdf0ed9fa | ||
|
|
6b1d83c968 | ||
|
|
c68170b336 | ||
|
|
750067f42d | ||
|
|
c541e4ccdc | ||
|
|
e7221b96ec | ||
|
|
d5ef31929a | ||
|
|
7606ea3e25 | ||
|
|
fe7da41956 | ||
|
|
3ae8f23bff | ||
|
|
6248f8a658 | ||
|
|
f4ca396a79 | ||
|
|
afab656cfe | ||
|
|
a7e0428889 | ||
|
|
238e763aa1 | ||
|
|
aa1d7d870d | ||
|
|
c77650a17b | ||
|
|
6cb1f71adf | ||
|
|
4c55ea7068 | ||
|
|
7f2ee90c9f | ||
|
|
2130eacf41 | ||
|
|
daf1f1b10b | ||
|
|
c33df3147f | ||
|
|
151e316263 | ||
|
|
8eccdd098a | ||
|
|
508d46a7a4 | ||
|
|
3b199c30e0 | ||
|
|
377e2d87c8 | ||
|
|
c3740e0847 | ||
|
|
78854835aa | ||
|
|
4cae8fb22f | ||
|
|
3b96b91991 | ||
|
|
136d5253e7 | ||
|
|
580cd4cd1b | ||
|
|
f822dd8d70 | ||
|
|
1e939919c0 | ||
|
|
c4075c18cb | ||
|
|
d9c5082727 | ||
|
|
6bdb8a2f75 | ||
|
|
715aae679d | ||
|
|
6018350ac1 | ||
|
|
4851183757 | ||
|
|
ab960bdc96 | ||
|
|
4ea8c2ec24 | ||
|
|
4ba0f8b612 | ||
|
|
51c562256b | ||
|
|
b8dfb7cc14 | ||
|
|
92a6575137 | ||
|
|
aff1928482 | ||
|
|
0d361bc7b6 | ||
|
|
1859802d05 | ||
|
|
50860fded2 | ||
|
|
79dc90dfcb | ||
|
|
04a66a01e2 | ||
|
|
fe14140c69 | ||
|
|
a9d3ca8737 | ||
|
|
224a256f69 | ||
|
|
da0fad328a | ||
|
|
363fef0efc | ||
|
|
6e4cdc0c5e | ||
|
|
f73b35bb49 | ||
|
|
c1f805f497 | ||
|
|
678eb000b7 | ||
|
|
7f24cab7dd | ||
|
|
54f05aa5cb | ||
|
|
47a6d538f5 | ||
|
|
803c05dc68 | ||
|
|
77c128fc20 | ||
|
|
75690245aa | ||
|
|
e9562a6ce3 | ||
|
|
d985dbffb8 | ||
|
|
fa73d46885 | ||
|
|
b2ea6b1cd2 | ||
|
|
3a330e0cb7 | ||
|
|
462bc9bf3b | ||
|
|
40e096b6d5 | ||
|
|
8464b184b7 | ||
|
|
c3b3c71b0a | ||
|
|
76c2e0accb | ||
|
|
b36f21cbaf | ||
|
|
e23c874272 | ||
|
|
424d9fc34e | ||
|
|
30d305da0f | ||
|
|
7c006f7445 | ||
|
|
102d9e34d7 | ||
|
|
e8c87cfc45 | ||
|
|
bcd2c35604 | ||
|
|
413a38cdf2 | ||
|
|
bf5d0867a6 | ||
|
|
00705afc19 | ||
|
|
270ca7166a | ||
|
|
3ab99065ad | ||
|
|
1b1bb79b05 | ||
|
|
6ad829fa90 | ||
|
|
f5ea579db3 | ||
|
|
8e631dfcd4 | ||
|
|
03e23ecc19 | ||
|
|
a0a3a6af91 | ||
|
|
c2616dd4f3 | ||
|
|
76c1ed2fd4 | ||
|
|
527b167bc5 | ||
|
|
bcd13b270d | ||
|
|
536f09b68c | ||
|
|
01148a1df8 | ||
|
|
534296bba4 | ||
|
|
e908519fc3 | ||
|
|
61acdd0c29 | ||
|
|
bacaaaef8a | ||
|
|
b107653a0f | ||
|
|
8620733457 | ||
|
|
0274d3dd2d | ||
|
|
f659da740d | ||
|
|
0b31164008 | ||
|
|
f6827f482d | ||
|
|
5dce119b9f | ||
|
|
67a3fb99ef | ||
|
|
f03b3edca4 | ||
|
|
a6019d5316 | ||
|
|
ae4e45d8f9 | ||
|
|
08a3f533b7 | ||
|
|
65b148a3b2 | ||
|
|
4092747dde | ||
|
|
bb059c0f64 | ||
|
|
e5e8f35c06 | ||
|
|
a023f92049 | ||
|
|
58e484f389 | ||
|
|
aa5e1b2fe0 | ||
|
|
e2941dda3b | ||
|
|
64a9975488 | ||
|
|
8b74809f1c | ||
|
|
0bdc73195f | ||
|
|
73ce6066f8 | ||
|
|
8a51574acf | ||
|
|
e02db41f99 | ||
|
|
b79b715383 | ||
|
|
aafd66da62 | ||
|
|
f888dfe4f8 | ||
|
|
b89854766a | ||
|
|
23ae2c537d | ||
|
|
d10b44bdef | ||
|
|
303502efa7 | ||
|
|
3390d9309b | ||
|
|
99fb4c8ff7 | ||
|
|
b506174410 | ||
|
|
2538a56577 | ||
|
|
bbd59f800b | ||
|
|
7c92111067 | ||
|
|
96ebd44509 | ||
|
|
645acd4275 | ||
|
|
402ca89c50 | ||
|
|
3e2b0bb763 | ||
|
|
f3957ac416 | ||
|
|
571e752a42 | ||
|
|
ca2fd5c64a | ||
|
|
53cac4eef4 | ||
|
|
6dc03831d8 | ||
|
|
6543d3277e | ||
|
|
1bdda20e49 | ||
|
|
b679e9cc22 | ||
|
|
43a520c971 | ||
|
|
64d92ddf32 | ||
|
|
dad1fccdb4 | ||
|
|
6d19563a9f | ||
|
|
8be26ac755 | ||
|
|
d7bdf0ae25 | ||
|
|
4b80666a30 | ||
|
|
ecb3c108d1 | ||
|
|
8db488b943 | ||
|
|
a8abced07a | ||
|
|
f7a6cddc9e | ||
|
|
f3e0cbe5bf | ||
|
|
0acb2847bf | ||
|
|
3c324a716d | ||
|
|
76ab9cd539 | ||
|
|
929a996987 | ||
|
|
164bc71328 | ||
|
|
9d11b48ce5 | ||
|
|
b8a3a42278 | ||
|
|
351e44a127 | ||
|
|
f983ff2b7c | ||
|
|
bb7c959479 | ||
|
|
2f281c68b0 | ||
|
|
c89637e4db | ||
|
|
ad3236a859 | ||
|
|
98969648e9 | ||
|
|
3e03cbf2b8 | ||
|
|
3b302b822c | ||
|
|
fa8c607742 | ||
|
|
4c77d8807c | ||
|
|
357ce4663f | ||
|
|
b247502116 | ||
|
|
5f2a03076d | ||
|
|
9260bd2f57 | ||
|
|
41a8d2272e | ||
|
|
7ffe700d66 | ||
|
|
49ac4a5b52 | ||
|
|
59e45d99f2 | ||
|
|
bda6d56c60 | ||
|
|
89829331f0 | ||
|
|
3c2795b816 | ||
|
|
17f7069d07 | ||
|
|
ba52c744ae | ||
|
|
e7bbcfa72b | ||
|
|
a2fe303463 | ||
|
|
e2096c0ef1 | ||
|
|
d0f23b67ac | ||
|
|
46ffbc1d90 | ||
|
|
d8b5183b1d | ||
|
|
4c4b29cdef | ||
|
|
b6a426a10d | ||
|
|
d1d86811bc | ||
|
|
2fd70c8eca | ||
|
|
3e80dffd48 | ||
|
|
7cc1328bf1 | ||
|
|
ffcb38f74d | ||
|
|
37f168d466 | ||
|
|
b9c61eea60 | ||
|
|
1e8ac50ab5 | ||
|
|
56b7d339a6 | ||
|
|
0350d4904f | ||
|
|
5baad4df10 | ||
|
|
aaef6f6737 | ||
|
|
2a3296111d | ||
|
|
3a375c0ae1 | ||
|
|
31500cd6e4 | ||
|
|
b4e815c04b | ||
|
|
27644a7bd5 | ||
|
|
e52ed26c7a | ||
|
|
0369bf7afe | ||
|
|
16413cc32a | ||
|
|
753e47de13 | ||
|
|
b87bd5250b | ||
|
|
a61f41a79a | ||
|
|
53dba0a211 | ||
|
|
86e8437514 | ||
|
|
2d83592273 | ||
|
|
2baf7a3e9e | ||
|
|
677c01b753 | ||
|
|
43bcecf52f | ||
|
|
e31e1306c8 | ||
|
|
135cb0ad88 | ||
|
|
3411cce1d2 | ||
|
|
4f3ef2e8d8 | ||
|
|
a822979881 | ||
|
|
8429c1db36 | ||
|
|
d007878935 | ||
|
|
b3810c2afa | ||
|
|
d931d6e8e8 | ||
|
|
d460c42230 | ||
|
|
39931f9eaa | ||
|
|
477fdb2cf2 | ||
|
|
f5b2031211 | ||
|
|
b37e973463 | ||
|
|
2ab6da5b51 | ||
|
|
5fe15a160d | ||
|
|
8f8b29368e | ||
|
|
5e38259044 | ||
|
|
30c32908a3 | ||
|
|
3b125166d5 | ||
|
|
fdd7a5b8d2 | ||
|
|
62a88ce256 | ||
|
|
04348ab176 | ||
|
|
47abf76e88 | ||
|
|
cb7612aef6 | ||
|
|
b0980a90fc | ||
|
|
7479d282bc | ||
|
|
23c0bc0e7a | ||
|
|
5219385eb2 | ||
|
|
6cb3460fce | ||
|
|
f3a8e55e70 | ||
|
|
9d445ec238 | ||
|
|
ac53cc7d69 | ||
|
|
c068eedcf3 | ||
|
|
a6ff1ea9d5 | ||
|
|
41133cf40f | ||
|
|
42b48b3d86 | ||
|
|
a0b928dfbb | ||
|
|
3c5b828d7e | ||
|
|
bac4291086 | ||
|
|
868fd1253b | ||
|
|
c5c0ff77b6 | ||
|
|
54abb96a85 | ||
|
|
c5dac98e1d | ||
|
|
999022d647 | ||
|
|
85255da560 | ||
|
|
c8285a41bc | ||
|
|
ee1c64fafe | ||
|
|
73df84c0b4 | ||
|
|
be6a50b0ed | ||
|
|
401016d260 | ||
|
|
b856263af6 | ||
|
|
085dc1aa01 | ||
|
|
563059c4b9 | ||
|
|
168322fda5 | ||
|
|
f5e7671fbc | ||
|
|
d80077ed94 | ||
|
|
3b4cbc70e7 | ||
|
|
36927bff8b | ||
|
|
dcded33f58 | ||
|
|
fe5c7a7f3b | ||
|
|
aa60e55db4 | ||
|
|
7baf2267a0 | ||
|
|
c6854fa8fc | ||
|
|
454219fbfe | ||
|
|
379b7a057c | ||
|
|
34ca4f3efa | ||
|
|
11052f4d87 | ||
|
|
401c0f053c | ||
|
|
6c54ae2ae5 | ||
|
|
70379910f7 | ||
|
|
41e6991d2e | ||
|
|
3b990b7916 | ||
|
|
dc4671dd0d | ||
|
|
b2504adb30 | ||
|
|
e45db2e507 | ||
|
|
e52c421c1d | ||
|
|
0aa7a62dc3 | ||
|
|
b6bdb23ffd | ||
|
|
003c11c36b | ||
|
|
c5d4bb8dcb | ||
|
|
fc1a360212 | ||
|
|
4ecd69e4fa | ||
|
|
b2f69ea36a | ||
|
|
71f49dda0f | ||
|
|
c64a3bd3df | ||
|
|
0cd28f982d | ||
|
|
400b5c09d7 | ||
|
|
69cac05575 | ||
|
|
20befcdf84 | ||
|
|
ef2c4bf5e1 | ||
|
|
8c97051909 | ||
|
|
c500b2cc16 | ||
|
|
26ea38dcf4 | ||
|
|
2b05673125 | ||
|
|
8bc7e006db | ||
|
|
8501b0c2ef | ||
|
|
6d28724e48 | ||
|
|
71039740c3 | ||
|
|
6434747ef6 | ||
|
|
68190b8546 | ||
|
|
395a81058b | ||
|
|
82e681a191 | ||
|
|
1392d37ca2 | ||
|
|
627bfe6bfa | ||
|
|
f2c49500ee | ||
|
|
bc4262f901 | ||
|
|
44950212a0 | ||
|
|
9e467f872e | ||
|
|
db4bbc9b47 | ||
|
|
77cc37ba49 | ||
|
|
65654f8f9e | ||
|
|
efcf51c7bf | ||
|
|
59124c4cfe | ||
|
|
aacfefc752 | ||
|
|
648722f1a6 | ||
|
|
c2208f82dc | ||
|
|
40e9c66ca6 | ||
|
|
dc687c1d85 | ||
|
|
e6152a97e8 | ||
|
|
4d0c15b49e | ||
|
|
ca9e6fa087 | ||
|
|
10f64ee9c4 | ||
|
|
4c881b2726 | ||
|
|
41ad5e901f | ||
|
|
bf54267f0b | ||
|
|
f4a6e9ede9 | ||
|
|
7167d7e09f | ||
|
|
d461c87979 | ||
|
|
0e24641cb8 | ||
|
|
1a1e462f80 | ||
|
|
2900cfd288 |
29
.commitlintrc.js
Normal file
29
.commitlintrc.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@commitlint/config-conventional', // scoped packages are not prefixed
|
||||
],
|
||||
rules: {
|
||||
'type-enum': [
|
||||
2,
|
||||
'always',
|
||||
[
|
||||
'build',
|
||||
'chore',
|
||||
'ci',
|
||||
'docs',
|
||||
'feat',
|
||||
'fix',
|
||||
'perf',
|
||||
'proposal',
|
||||
'refactor',
|
||||
'release',
|
||||
'revert',
|
||||
'style',
|
||||
'test',
|
||||
'wip',
|
||||
],
|
||||
],
|
||||
},
|
||||
};
|
||||
5
.eslintignore
Normal file
5
.eslintignore
Normal file
@@ -0,0 +1,5 @@
|
||||
coverage/
|
||||
coverage-merged/
|
||||
dist/
|
||||
node_modules/
|
||||
types/
|
||||
99
.eslintrc
Normal file
99
.eslintrc
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"extends": ["airbnb-base", "prettier"],
|
||||
"root": true,
|
||||
"env": {
|
||||
"amd": true,
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"jest": true,
|
||||
"node": true
|
||||
},
|
||||
"globals": {
|
||||
"BigInt": "readonly",
|
||||
"BigInt64Array": "readonly",
|
||||
"BigUint64Array": "readonly",
|
||||
"globalThis": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
// Overridden
|
||||
"camelcase": ["error", { "properties": "never", "allow": [ "W[0-9]+_"] }],
|
||||
"import/extensions": "off",
|
||||
"no-eval": "off",
|
||||
"no-self-compare": "off",
|
||||
"one-var": ["error", "never"],
|
||||
// @TODO: Fix the following rules progressively.
|
||||
"arrow-body-style": "warn",
|
||||
"prefer-arrow-callback": "warn",
|
||||
"prefer-object-spread": "off",
|
||||
"max-classes-per-file": "off",
|
||||
"dot-notation": "off",
|
||||
"object-shorthand": "off",
|
||||
"no-param-reassign": "off",
|
||||
"no-cond-assign": "off",
|
||||
"prefer-destructuring": "off",
|
||||
"func-names": "off",
|
||||
"no-nested-ternary": "off",
|
||||
"no-plusplus": "off",
|
||||
"strict": "off",
|
||||
"no-restricted-syntax": "off",
|
||||
"import/no-mutable-exports": "off",
|
||||
"guard-for-in": "off",
|
||||
"import/prefer-default-export": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"prefer-spread": "off",
|
||||
"no-lonely-if": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-continue": "off",
|
||||
"no-shadow": "off",
|
||||
// Rules up for discussion.
|
||||
"no-multi-assign": "off",
|
||||
"new-cap": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.ts"],
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"extends": [
|
||||
"airbnb-typescript/base",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "after-used",
|
||||
"ignoreRestSiblings": true,
|
||||
"argsIgnorePattern": "^_" // For tsc compatibility.
|
||||
}
|
||||
],
|
||||
"comma-dangle": "off",
|
||||
"implicit-arrow-linebreak": "off", // Conflicts with prettier.
|
||||
"import/extensions": "off",
|
||||
"import/prefer-default-export": "off",
|
||||
"operator-linebreak": "off",
|
||||
"object-curly-newline": "off",
|
||||
"prefer-rest-params": "off", // We need to use params.
|
||||
"prettier/prettier": "error",
|
||||
"@typescript-eslint/no-shadow": "warn",
|
||||
"@typescript-eslint/no-use-before-define": ["warn", { "functions": false }],
|
||||
"import/no-cycle": "warn",
|
||||
"no-bitwise": "off",
|
||||
"no-unsafe-finally": "warn",
|
||||
"no-param-reassign": "off",
|
||||
"no-shadow": "warn"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +1,2 @@
|
||||
* text=auto
|
||||
*.lockb binary diff=lockb
|
||||
|
||||
35
.github/CONTRIBUTING.md
vendored
35
.github/CONTRIBUTING.md
vendored
@@ -1,7 +1,13 @@
|
||||
# :construction: Notice :construction:
|
||||
|
||||
Pardon the mess. The `master` branch is in flux while we work on Lodash v5. This
|
||||
means things like npm scripts, which we encourage using for contributions, may
|
||||
not be working. Thank you for your patience.
|
||||
|
||||
# Contributing to Lodash
|
||||
|
||||
Contributions are always welcome. Before contributing please read the
|
||||
[code of conduct](https://js.foundation/conduct/) &
|
||||
[code of conduct](https://code-of-conduct.openjsf.org) &
|
||||
[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,
|
||||
@@ -19,21 +25,19 @@ Before submitting a request, please search for similar ones in the
|
||||
|
||||
## Pull Requests
|
||||
|
||||
For additions or bug fixes you should only need to modify `lodash.js`. Include
|
||||
updated unit tests in the `test` directory as part of your pull request. Don’t
|
||||
worry about regenerating the `dist/` or `doc/` files.
|
||||
For additions or bug fixes, please modify the relevant files. Include
|
||||
updated unit tests in the `test` directory as part of your pull request.
|
||||
Unit test files should be named `[filename].test.js`.
|
||||
|
||||
Before running the unit tests you’ll need to install, `npm i`,
|
||||
[development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
|
||||
Run unit tests from the command-line via `npm test`, or open `test/index.html` &
|
||||
`test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) &
|
||||
[Underscore](http://underscorejs.org/) test suites are included as well.
|
||||
Run unit tests from the command-line via `npm test`.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Lodash is a member of the [JS Foundation](https://js.foundation/).
|
||||
Lodash is a member of the [JS Foundation](https://openjsf.org/).
|
||||
As such, we request that all contributors sign the JS Foundation
|
||||
[contributor license agreement (CLA)](https://js.foundation/CLA/).
|
||||
[contributor license agreement (CLA)](https://cla.js.foundation/lodash/lodash).
|
||||
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post,
|
||||
[“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
@@ -61,18 +65,7 @@ established in the code.
|
||||
[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):
|
||||
Guidelines are enforced using [ESLint](https://www.npmjs.com/package/eslint):
|
||||
```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`.
|
||||
|
||||
24
.github/lock.yml
vendored
Normal file
24
.github/lock.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 365
|
||||
|
||||
# Skip issues and pull requests created before a given timestamp. Timestamp must
|
||||
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
|
||||
skipCreatedBefore: false
|
||||
|
||||
# Issues and pull requests with these labels will not be locked. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- votes needed
|
||||
|
||||
# Label to add before locking, such as `outdated`. Set to `false` to disable
|
||||
lockLabel: false
|
||||
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: >
|
||||
This thread has been automatically locked since there has not been
|
||||
any recent activity after it was closed. Please open a new issue for
|
||||
related bugs.
|
||||
|
||||
# Assign `resolved` as the reason for locking. Set to `false` to disable
|
||||
setLockReason: true
|
||||
16
.github/workflows/tests.yml
vendored
Normal file
16
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: 1.0.2
|
||||
- run: bun install
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,4 +1,8 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
doc/*.html
|
||||
node_modules
|
||||
*.log*
|
||||
dist/
|
||||
node_modules/
|
||||
*.code-workspace
|
||||
*.lockb
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
4
.husky/commit-msg
Executable file
4
.husky/commit-msg
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
bun run commitlint --edit "$1"
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
bun run lint-staged
|
||||
97
.jscsrc
97
.jscsrc
@@ -1,97 +0,0 @@
|
||||
{
|
||||
"maxErrors": "2000",
|
||||
"maximumLineLength": {
|
||||
"value": 180,
|
||||
"allExcept": ["comments", "functionSignature", "regex"]
|
||||
},
|
||||
"requireCurlyBraces": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"=",
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!==",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<="
|
||||
],
|
||||
"requireSpaceAfterKeywords": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"switch",
|
||||
"return",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
|
||||
"&=", "|=", "^=",
|
||||
|
||||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
|
||||
"|", "^", "&&", "||", "===", "==", ">=",
|
||||
"<=", "<", ">", "!=", "!=="
|
||||
],
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"requireDotNotation": { "allExcept": ["keywords"] },
|
||||
"requireEarlyReturn": true,
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"requireSemicolons": true,
|
||||
"requireSpaceAfterBinaryOperators": true,
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireSpacesInForStatement": true,
|
||||
|
||||
"validateIndentation": 2,
|
||||
"validateParameterSeparator": ", ",
|
||||
"validateQuoteMarks": { "mark": "'", "escape": true },
|
||||
|
||||
"disallowSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowKeywords": ["with"],
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowMultipleLineBreaks": true,
|
||||
"disallowNewlineBeforeBlockStatements": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||
"disallowSpacesInCallExpression": true,
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowUnusedVariables": true,
|
||||
|
||||
"jsDoc": {
|
||||
"checkRedundantAccess": true,
|
||||
"checkTypes": true,
|
||||
"requireNewlineAfterDescription": true,
|
||||
"requireParamDescription": true,
|
||||
"requireParamTypes": true,
|
||||
"requireReturnTypes": true
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
delete global['__core-js_shared__'];
|
||||
|
||||
const _ = require('./lodash.js');
|
||||
const globals = require('lodash-doc-globals');
|
||||
|
||||
module.exports = {
|
||||
'babel': false,
|
||||
'globals': _.assign({ '_': _ }, globals)
|
||||
};
|
||||
5
.prettierignore
Normal file
5
.prettierignore
Normal file
@@ -0,0 +1,5 @@
|
||||
coverage/
|
||||
coverage-merged/
|
||||
dist/
|
||||
node_modules/
|
||||
types/
|
||||
6
.prettierrc
Normal file
6
.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"useTabs": false,
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true
|
||||
}
|
||||
134
.travis.yml
134
.travis.yml
@@ -1,134 +0,0 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- 7
|
||||
|
||||
addons:
|
||||
jwt:
|
||||
secure: OYhRpW+8A0Iik+9GmHwa45ZwXeBXw/6zh6I+1w2H9g/LqPRp+Nhq3f4FSpvrrfno8lO8W4h+7s6+JOzF8C8NxNda5UUygKjF9pUphgiQdqls3YZMJlC9zXVl7gQXAHi3nG1s8vWSpwpzYD9fqczE1FX9n0+R63qX3eB6C/LbPeI=
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- ~/.npm
|
||||
- ~/.yarn-cache
|
||||
- travis_phantomjs
|
||||
|
||||
env:
|
||||
global:
|
||||
- BIN=node ISTANBUL=false OPTION=""
|
||||
- SAUCE_LABS=false SAUCE_USERNAME=lodash
|
||||
|
||||
matrix:
|
||||
-
|
||||
- BIN=phantomjs
|
||||
- ISTANBUL=true
|
||||
- SAUCE_LABS=true
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- node_js: 6
|
||||
env:
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
before_install:
|
||||
# Upgrade PhantomJS.
|
||||
- |
|
||||
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
|
||||
wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
|
||||
tar -xvf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs
|
||||
fi
|
||||
phantomjs -v
|
||||
|
||||
# Use exact Node version.
|
||||
- nvm use $TRAVIS_NODE_VERSION
|
||||
|
||||
# Setup package managers.
|
||||
- npm set loglevel error
|
||||
- npm set progress false
|
||||
- npm i -g yarn@0.16.1
|
||||
- yarn -V
|
||||
|
||||
# Remove code skipped on the coverage run.
|
||||
- |
|
||||
PATTERN[0]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
|
||||
PATTERN[1]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
|
||||
PATTERN[2]="|\bcase\s+(?:dataView|promise|set|map|weakMap)CtorString:.+|g"
|
||||
PATTERN[3]="|\s*if\s*\(cache\.size\b[\s\S]+?\}|"
|
||||
PATTERN[4]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
|
||||
PATTERN[5]="|\s*define\([\s\S]+?\);|"
|
||||
PATTERN[6]="|\s*root\._\s*=\s*_;|"
|
||||
|
||||
if [ $ISTANBUL = true ]; then
|
||||
set -e
|
||||
for PTRN in ${PATTERN[@]}; do
|
||||
node ./test/remove.js $PTRN ./lodash.js
|
||||
done
|
||||
fi
|
||||
|
||||
install:
|
||||
# Install packages.
|
||||
- yarn
|
||||
|
||||
# Use lodash-cli from GitHub.
|
||||
- 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 --production; cd ../../
|
||||
|
||||
script:
|
||||
# Detect code coverage.
|
||||
- |
|
||||
if [ $ISTANBUL = true ]; then
|
||||
istanbul cover -x "**/vendor/**" --report lcovonly ./test/test.js -- ./lodash.js
|
||||
if [ $TRAVIS_SECURE_ENV_VARS = true ]; then
|
||||
cat ./coverage/lcov.info | coveralls
|
||||
cat ./coverage/coverage.json | codecov
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test in Node.js and PhantomJS.
|
||||
- |
|
||||
if [ $ISTANBUL = false ]; then
|
||||
node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js
|
||||
node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./
|
||||
node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js
|
||||
if [ $SAUCE_LABS = false ]; then
|
||||
cd ./test
|
||||
$BIN $OPTION ./test.js ../lodash.js
|
||||
if [ $TRAVIS_SECURE_ENV_VARS = true ]; then
|
||||
$BIN $OPTION ./test.js ../dist/lodash.min.js
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test in Sauce Labs.
|
||||
- |
|
||||
if [ $SAUCE_LABS = true ]; then
|
||||
node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js
|
||||
npm run build
|
||||
$BIN ./test/saucelabs.js name="lodash tests" runner="test/index.html?build=../dist/lodash.js&noglobals=true" tags=development
|
||||
$BIN ./test/saucelabs.js name="lodash tests" runner="test/index.html?build=../dist/lodash.min.js&noglobals=true" tags=production
|
||||
$BIN ./test/saucelabs.js name="lodash-fp tests" runner="test/fp.html?noglobals=true" tags=development
|
||||
$BIN ./test/saucelabs.js name="underscore tests" runner="test/underscore.html?build=../dist/lodash.js" tags=development,underscore
|
||||
$BIN ./test/saucelabs.js name="underscore tests" runner="test/underscore.html?build=../dist/lodash.min.js" tags=production,underscore
|
||||
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.js" tags=development,backbone
|
||||
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.min.js" tags=production,backbone
|
||||
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.core.js" tags=development,backbone
|
||||
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.core.min.js" tags=production,backbone
|
||||
fi
|
||||
2
LICENSE
2
LICENSE
@@ -1,3 +1,5 @@
|
||||
The MIT License
|
||||
|
||||
Copyright JS Foundation and other contributors <https://js.foundation/>
|
||||
|
||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||
|
||||
32
README.md
32
README.md
@@ -1,30 +1,26 @@
|
||||
# lodash v4.17.4
|
||||
# lodash
|
||||
|
||||
[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://js.foundation/conduct/) |
|
||||
[Twitter](https://twitter.com/bestiejs) |
|
||||
[Chat](https://gitter.im/lodash/lodash)
|
||||
[Code of Conduct](https://code-of-conduct.openjsf.org)
|
||||
|
||||
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):
|
||||
```shell
|
||||
$ npm run build
|
||||
$ bun run build
|
||||
$ lodash -o ./dist/lodash.js
|
||||
$ lodash core -o ./dist/lodash.core.js
|
||||
```
|
||||
|
||||
## Download
|
||||
|
||||
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.17.4/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.17.4/dist/lodash.core.min.js))
|
||||
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.17.4/dist/lodash.js) ([~24 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.17.4/dist/lodash.min.js))
|
||||
* [CDN copies](https://www.jsdelivr.com/projects/lodash)
|
||||
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/core.min.js))
|
||||
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/lodash.js) ([~24 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/lodash.min.js))
|
||||
* [CDN copies](https://www.jsdelivr.com/projects/lodash) [](https://www.jsdelivr.com/package/npm/lodash)
|
||||
|
||||
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.17.4/LICENSE) & supports modern environments.<br>
|
||||
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/LICENSE) & supports modern environments.<br>
|
||||
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one that’s right for you.
|
||||
|
||||
## Installation
|
||||
@@ -34,13 +30,12 @@ In a browser:
|
||||
<script src="lodash.js"></script>
|
||||
```
|
||||
|
||||
Using npm:
|
||||
Using bun:
|
||||
```shell
|
||||
$ npm i -g npm
|
||||
$ npm i --save lodash
|
||||
$ bun i lodash
|
||||
```
|
||||
|
||||
In Node.js:
|
||||
In [Bun](https://bun.sh):
|
||||
```js
|
||||
// Load the full build.
|
||||
var _ = require('lodash');
|
||||
@@ -58,8 +53,7 @@ var at = require('lodash/at');
|
||||
var curryN = require('lodash/fp/curryN');
|
||||
```
|
||||
|
||||
**Note:**<br>
|
||||
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.
|
||||
Looking for Lodash modules written in ES6 or smaller bundle sizes? Check out [lodash-es](https://www.npmjs.com/package/lodash-es).
|
||||
|
||||
## Why Lodash?
|
||||
|
||||
@@ -74,7 +68,5 @@ numbers, objects, strings, etc. Lodash’s modular methods are great for:
|
||||
|
||||
Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
|
||||
|
||||
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
|
||||
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/search?q=keywords: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)
|
||||
|
||||
35
SECURITY.md
Normal file
35
SECURITY.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported versions
|
||||
|
||||
The following table describes the versions of this project that are currently
|
||||
supported with security updates:
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 4.x | :white_check_mark: |
|
||||
| 3.x | :x: |
|
||||
| 2.x | :x: |
|
||||
| 1.x | :x: |
|
||||
|
||||
## Responsible disclosure security policy
|
||||
|
||||
A responsible disclosure policy helps protect users of the project from publicly
|
||||
disclosed security vulnerabilities without a fix by employing a process where
|
||||
vulnerabilities are first triaged in a private manner, and only publicly disclosed
|
||||
after a reasonable time period that allows patching the vulnerability and provides
|
||||
an upgrade path for users.
|
||||
|
||||
We kindly ask you to refrain from malicious acts that put our users, the project,
|
||||
or any of the project’s team members at risk.
|
||||
|
||||
## Reporting a security issue
|
||||
|
||||
We consider the security of Lodash a top priority. But no matter how much effort
|
||||
we put into security, there can still be vulnerabilities present.
|
||||
|
||||
If you discover a security vulnerability, please report the security issue
|
||||
directly to the Lodash maintainers through the Security tab of the Lodash
|
||||
repository.
|
||||
|
||||
Your efforts to responsibly disclose your findings are sincerely appreciated.
|
||||
2
bunfig.toml
Normal file
2
bunfig.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[install.lockfile]
|
||||
print = "yarn"
|
||||
3836
dist/lodash.core.js
vendored
3836
dist/lodash.core.js
vendored
File diff suppressed because it is too large
Load Diff
29
dist/lodash.core.min.js
vendored
29
dist/lodash.core.min.js
vendored
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* Build: `lodash core -o ./dist/lodash.core.js`
|
||||
*/
|
||||
;(function(){function n(n){return K(n)&&pn.call(n,"callee")&&!bn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?nn:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");
|
||||
return setTimeout(function(){n.apply(nn,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===nn?i===i:r(i,c)))var c=i,f=o}return f}function l(n,t){var r=[];return mn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function p(n,r,e,u,o){var i=-1,c=n.length;for(e||(e=D),o||(o=[]);++i<c;){var f=n[i];0<r&&e(f)?1<r?p(f,r-1,e,u,o):t(o,f):u||(o[o.length]=f)}return o}function s(n,t){return n&&On(n,t,In);
|
||||
}function h(n,t){return l(t,function(t){return V(n[t])})}function v(n,t){return n>t}function y(n,t,r,e,u){return n===t||(null==n||null==t||!K(n)&&!K(t)?n!==n&&t!==t:b(n,t,r,e,y,u))}function b(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){
|
||||
return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=M(+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 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.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=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?Y:(typeof n=="object"?d:r)(n)}function _(n,t){return n<t}function j(n,t){var r=-1,e=U(n)?Array(n.length):[];return mn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function d(n){var t=_n(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],3)))return false}return true}}function m(n,t){return n=Object(n),G(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function O(n){return xn(q(n,void 0,Y),n+"");
|
||||
}function x(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 A(n){return x(n,0,n.length)}function E(n,t){var r;return mn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function w(n,r){return G(r,function(n,r){return r.func.apply(r.thisArg,t([n],r.args))},n)}function k(n,t,r,e){var u=!r;r||(r={});for(var o=-1,i=t.length;++o<i;){var c=t[o],f=e?e(r[c],n[c],c,r,n):nn;if(f===nn&&(f=n[c]),u)r[c]=f;else{var a=r,l=a[c];
|
||||
pn.call(a,c)&&M(l,f)&&(f!==nn||c in a)||(a[c]=f)}}return r}function N(n){return O(function(t,r){var e=-1,u=r.length,o=1<u?r[u-1]:nn,o=3<n.length&&typeof o=="function"?(u--,o):nn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function F(n){return function(){var t=arguments,r=dn(n.prototype),t=n.apply(r,t);return H(t)?t:r}}function S(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==on&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];
|
||||
return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=F(n);return e}function T(n,t,r,e){return n===nn||M(n,ln[r])&&!pn.call(e,r)?t:n}function B(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return false;for(var c=-1,f=true,a=2&r?[]:nn;++c<i;){var l=n[c],p=t[c];if(void 0!==nn){f=false;break}if(a){if(!E(t,function(n,t){if(!z(a,t)&&(l===n||u(l,n,r,e,o)))return a.push(t)})){f=false;break}}else if(l!==p&&!u(l,p,r,e,o)){f=false;break}}return f}function R(n,t,r,e,u,o){
|
||||
var i=1&r,c=In(n),f=c.length,a=In(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:pn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==nn||s!==h&&!u(s,h,r,e,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(t){return Nn(t)||n(t)}function I(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);
|
||||
return t}function q(n,t,r){return t=jn(t===nn?n.length-1:t,0),function(){for(var e=arguments,u=-1,o=jn(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];for(u=-1,o=Array(t+1);++u<t;)o[u]=e[u];return o[t]=r(i),n.apply(this,o)}}function $(n){return(null==n?0:n.length)?p(n,1):[]}function P(n){return n&&n.length?n[0]:nn}function z(n,t,r){var e=null==n?0:n.length;r=typeof r=="number"?0>r?jn(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 C(n,t){return mn(n,g(t));
|
||||
}function G(n,t,r){return e(n,g(t),r,3>arguments.length,mn)}function J(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=nn),r}}function M(n,t){return n===t||n!==n&&t!==t}function U(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t),t&&!V(n)}function V(n){return!!H(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n);
|
||||
}function H(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function K(n){return null!=n&&typeof n=="object"}function L(n){return typeof n=="number"||K(n)&&"[object Number]"==hn.call(n)}function Q(n){return typeof n=="string"||!Nn(n)&&K(n)&&"[object String]"==hn.call(n)}function W(n){return typeof n=="string"?n:null==n?"":n+""}function X(n){return null==n?[]:u(n,In(n))}function Y(n){return n}function Z(n,r,e){var u=In(r),o=h(r,u);null!=e||H(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,In(r)));
|
||||
var i=!(H(e)&&"chain"in e&&!e.chain),c=V(n);return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var nn,tn=1/0,rn=/[&<>"']/g,en=RegExp(rn.source),un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){
|
||||
return function(t){return null==n?nn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,yn=Object.create,bn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return H(t)?yn?yn(t):(n.prototype=t,t=new n,n.prototype=nn,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;
|
||||
var mn=function(n,t){return function(r,e){if(null==r)return r;if(!U(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}}(s),On=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}}(),xn=Y,An=function(n){return function(t,r,e){var u=Object(t);if(!U(t)){var o=g(r);t=In(t),r=function(n){return o(u[n],n,u)}}return r=n(t,r,e),-1<r?u[o?t[r]:r]:nn}}(function(n,t,r){var e=null==n?0:n.length;
|
||||
if(!e)return-1;r=null==r?0:Fn(r),0>r&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++r<e;)if(t(n[r],r,n)){n=r;break n}n=-1}return n}),En=O(function(n,t,r){return S(n,t,r)}),wn=O(function(n,t){return c(n,1,t)}),kn=O(function(n,t,r){return c(n,Sn(t)||0,r)}),Nn=Array.isArray,Fn=Number,Sn=Number,Tn=N(function(n,t){k(t,_n(t),n)}),Bn=N(function(n,t){k(t,I(t),n)}),Rn=N(function(n,t,r,e){k(t,qn(t),n,e)}),Dn=O(function(n){return n.push(nn,T),Rn.apply(nn,n)}),In=_n,qn=I,$n=function(n){return xn(q(n,nn,$),n+"");
|
||||
}(function(n,t){return null==n?{}:m(n,t)});o.assignIn=Bn,o.before=J,o.bind=En,o.chain=function(n){return n=o(n),n.__chain__=true,n},o.compact=function(n){return l(n,Boolean)},o.concat=function(){var n=arguments.length;if(!n)return[];for(var r=Array(n-1),e=arguments[0];n--;)r[n-1]=arguments[n];return t(Nn(e)?A(e):[e],p(r,1))},o.create=function(n,t){var r=dn(n);return null==t?r:Tn(r,t)},o.defaults=Dn,o.defer=wn,o.delay=kn,o.filter=function(n,t){return l(n,g(t))},o.flatten=$,o.flattenDeep=function(n){
|
||||
return(null==n?0:n.length)?p(n,tn):[]},o.iteratee=g,o.keys=In,o.map=function(n,t){return j(n,g(t))},o.matches=function(n){return d(Tn({},n))},o.mixin=Z,o.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},o.once=function(n){return J(2,n)},o.pick=$n,o.slice=function(n,t,r){var e=null==n?0:n.length;return r=r===nn?e:+r,e?x(n,null==t?0:+t,r):[]},o.sortBy=function(n,t){var e=0;return t=g(t),j(j(n,function(n,r,u){return{
|
||||
value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==nn,o=null===r,i=r===r,c=e!==nn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r<e||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),r("value"))},o.tap=function(n,t){return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return U(n)?n.length?A(n):[]:X(n)},o.values=X,o.extend=Bn,Z(o,o),o.clone=function(n){return H(n)?Nn(n)?A(n):k(n,_n(n)):n;
|
||||
},o.escape=function(n){return(n=W(n))&&en.test(n)?n.replace(rn,fn):n},o.every=function(n,t,r){return t=r?nn:t,f(n,g(t))},o.find=An,o.forEach=C,o.has=function(n,t){return null!=n&&pn.call(n,t)},o.head=P,o.identity=Y,o.indexOf=z,o.isArguments=n,o.isArray=Nn,o.isBoolean=function(n){return true===n||false===n||K(n)&&"[object Boolean]"==hn.call(n)},o.isDate=function(n){return K(n)&&"[object Date]"==hn.call(n)},o.isEmpty=function(t){return U(t)&&(Nn(t)||Q(t)||V(t.splice)||n(t))?!t.length:!_n(t).length},o.isEqual=function(n,t){
|
||||
return y(n,t)},o.isFinite=function(n){return typeof n=="number"&&gn(n)},o.isFunction=V,o.isNaN=function(n){return L(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=L,o.isObject=H,o.isRegExp=function(n){return K(n)&&"[object RegExp]"==hn.call(n)},o.isString=Q,o.isUndefined=function(n){return n===nn},o.last=function(n){var t=null==n?0:n.length;return t?n[t-1]:nn},o.max=function(n){return n&&n.length?a(n,Y,v):nn},o.min=function(n){return n&&n.length?a(n,Y,_):nn},o.noConflict=function(){return on._===this&&(on._=vn),
|
||||
this},o.noop=function(){},o.reduce=G,o.result=function(n,t,r){return t=null==n?nn:n[t],t===nn&&(t=r),V(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=U(n)?n:_n(n),n.length)},o.some=function(n,t,r){return t=r?nn:t,E(n,g(t))},o.uniqueId=function(n){var t=++sn;return W(n)+t},o.each=C,o.first=P,Z(o,function(){var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.4",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
|
||||
var t=(/^(?:replace|split)$/.test(n)?String.prototype:an)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Nn(u)?u:[],n)}return this[r](function(r){return t.apply(Nn(r)?r:[],n)})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o,
|
||||
define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this);
|
||||
1040
dist/lodash.fp.js
vendored
1040
dist/lodash.fp.js
vendored
File diff suppressed because it is too large
Load Diff
21
dist/lodash.fp.min.js
vendored
21
dist/lodash.fp.min.js
vendored
@@ -1,21 +0,0 @@
|
||||
(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()})(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&"function"==typeof _.runInContext&&(_=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(){for(var r=arguments.length,n=r-1,i=Array(r);r--;)i[r]=arguments[r];var a=i[e],o=i.slice(0,e);return a&&d.apply(o,a),
|
||||
e!=n&&d.apply(o,i.slice(e+1)),t.apply(this,o)}}function l(t,e){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n),i}}}function u(t,e,r,d){function c(t,e){if(B.cap){var r=p.iterateeRearg[t];if(r)return x(e,r);var n=!b&&p.iterateeAry[t];if(n)return W(e,n)}return e}function h(t,e,r){return E||B.curry&&r>1?z(e,r):e}function g(t,e,r){if(B.fixed&&(F||!p.skipFixed[t])){var n=p.methodSpread[t],i=n&&n.start;return void 0===i?w(e,r):s(e,i);
|
||||
}return e}function y(t,e,r){return B.rearg&&r>1&&(j||!p.skipRearg[t])?_(e,p.methodRearg[t]||p.aryRearg[r]):e}function m(t,e){e=V(e);for(var r=-1,n=e.length,i=n-1,a=D(Object(t)),o=a;null!=o&&++r<n;){var s=e[r],l=o[s];null!=l&&(o[e[r]]=D(r==i?l:Object(l))),o=o[s]}return a}function v(t){return H.runInContext.convert(t)(void 0)}function A(t,e){var r=p.aliasToReal[t]||t,n=p.remap[r]||r,i=d;return function(t){return u(b?L:S,r,b?L[n]:e,M(M({},i),t))}}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){var r,n=p.aliasToReal[t]||t,i=e,s=G[n];return s?i=s(e):B.immutable&&(p.mutate.array[n]?i=l(e,a):p.mutate.object[n]?i=l(e,o(e)):p.mutate.set[n]&&(i=l(e,m))),q(U,function(t){return q(p.aryMethod[t],function(e){if(n==e){var a=p.methodSpread[n];
|
||||
return r=a&&a.afterRearg?g(n,y(n,i,t),t):y(n,g(n,i,t),t),r=c(n,r),r=h(n,r,t),!1}}),!r}),r||(r=i),r==e&&(r=E?z(r,1):function(){return e.apply(this,arguments)}),r.convert=A(n,e),p.placeholder[n]&&(O=!0,r.placeholder=e.placeholder=C),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,C=b?r:f,L=b?r.runInContext():void 0,S=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,toInteger:t.toInteger,toPath:t.toPath},w=S.ary,M=S.assign,D=S.clone,z=S.curry,q=S.forEach,P=S.isArray,T=S.isFunction,K=S.keys,_=S.rearg,N=S.toInteger,V=S.toPath,U=K(p.aryMethod),G={castArray:function(t){return function(){var e=arguments[0];
|
||||
return P(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 q(K(e),function(t){T(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),q(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:N(e)+1;
|
||||
return z(t(e),r)}},rearg:function(t){return function(e,r){var n=r?r.length:0;return z(t(e,r),n)}},runInContext:function(e){return function(r){return u(t,e(r),d)}}};if(!k)return R(e,r);var H=r,J=[];return q(U,function(t){q(p.aryMethod[t],function(t){var e=H[p.remap[t]||t];e&&J.push([t,R(t,e)])})}),q(K(H),function(t){var e=H[t];if("function"==typeof e){for(var r=J.length;r--;)if(J[r][0]==t)return;e.convert=A(t,e),J.push([t,e])}}),q(J,function(t){H[t[0]]=t[1]}),H.convert=v,O&&(H.placeholder=C),q(K(H),function(t){
|
||||
q(p.realToAlias[t]||[],function(e){H[e]=H[t]})}),H}var p=r(2),f=r(3),d=Array.prototype.push;t.exports=u},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","rangeStep","rangeStepRight","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],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,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,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],rangeStep:[1,2,0],rangeStepRight:[1,2,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:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},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",rangeStep:"range",rangeStepRight:"rangeRight",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={}}])});
|
||||
17084
dist/lodash.js
vendored
17084
dist/lodash.js
vendored
File diff suppressed because it is too large
Load Diff
136
dist/lodash.min.js
vendored
136
dist/lodash.min.js
vendored
@@ -1,136 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* 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.length){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,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&false!==t(n[r],r,n););return n}function i(n,t){for(var r=null==n?0:n.length;r--&&false!==t(n[r],r,n););
|
||||
return n}function o(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function f(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function c(n,t){return!(null==n||!n.length)&&-1<d(n,t,0)}function a(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return true;return false}function l(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function s(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];
|
||||
return n}function h(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function p(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function _(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return true;return false}function v(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,false}),e}function g(n,t,r,e){var u=n.length;for(r+=e?1:-1;e?r--:++r<u;)if(t(n[r],r,n))return r;return-1}function d(n,t,r){if(t===t)n:{
|
||||
--r;for(var e=n.length;++r<e;)if(n[r]===t){n=r;break n}n=-1}else n=g(n,b,r);return n}function y(n,t,r,e){--r;for(var u=n.length;++r<u;)if(e(n[r],t))return r;return-1}function b(n){return n!==n}function x(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:P}function j(n){return function(t){return null==t?F:t[n]}}function w(n){return function(t){return null==n?F:n[t]}}function m(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=false,n):t(r,n,u,i)}),r}function A(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;
|
||||
return n}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==F&&(r=r===F?i:r+i)}return r}function E(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function O(n,t){return l(t,function(t){return[t,n[t]]})}function S(n){return function(t){return n(t)}}function I(n,t){return l(t,function(t){return n[t]})}function R(n,t){return n.has(t)}function z(n,t){for(var r=-1,e=n.length;++r<e&&-1<d(t,n[r],0););return r}function W(n,t){for(var r=n.length;r--&&-1<d(t,n[r],0););return r}function B(n){
|
||||
return"\\"+Tn[n]}function L(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function U(n,t){return function(r){return n(t(r))}}function C(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&"__lodash_placeholder__"!==o||(n[r]="__lodash_placeholder__",i[u++]=r)}return i}function D(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function T(n){if(Bn.test(n)){
|
||||
for(var t=zn.lastIndex=0;zn.test(n);)++t;n=t}else n=tt(n);return n}function $(n){return Bn.test(n)?n.match(zn)||[]:n.split("")}var F,N=1/0,P=NaN,Z=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],q=/\b__p\+='';/g,V=/\b(__p\+=)''\+/g,K=/(__e\(.*?\)|\b__t\))\+'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,J=RegExp(G.source),Y=RegExp(H.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/^\./,un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,on=/[\\^$.*+?()[\]{}|]/g,fn=RegExp(on.source),cn=/^\s+|\s+$/g,an=/^\s+/,ln=/\s+$/,sn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hn=/\{\n\/\* \[wrapped with (.+)\] \*/,pn=/,? & /,_n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vn=/\\(\\)?/g,gn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dn=/\w*$/,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,xn=/^\[object .+?Constructor\]$/,jn=/^0o[0-7]+$/i,wn=/^(?:0|[1-9]\d*)$/,mn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,kn=/['\n\r\u2028\u2029\\]/g,En="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",On="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+En,Sn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",In=RegExp("['\u2019]","g"),Rn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),zn=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+Sn+En,"g"),Wn=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*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)|\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)|\\d+",On].join("|"),"g"),Bn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Ln=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Un="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(" "),Cn={};
|
||||
Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true,Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object DataView]"]=Cn["[object Date]"]=Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object WeakMap]"]=false;
|
||||
var Dn={};Dn["[object Arguments]"]=Dn["[object Array]"]=Dn["[object ArrayBuffer]"]=Dn["[object DataView]"]=Dn["[object Boolean]"]=Dn["[object Date]"]=Dn["[object Float32Array]"]=Dn["[object Float64Array]"]=Dn["[object Int8Array]"]=Dn["[object Int16Array]"]=Dn["[object Int32Array]"]=Dn["[object Map]"]=Dn["[object Number]"]=Dn["[object Object]"]=Dn["[object RegExp]"]=Dn["[object Set]"]=Dn["[object String]"]=Dn["[object Symbol]"]=Dn["[object Uint8Array]"]=Dn["[object Uint8ClampedArray]"]=Dn["[object Uint16Array]"]=Dn["[object Uint32Array]"]=true,
|
||||
Dn["[object Error]"]=Dn["[object Function]"]=Dn["[object WeakMap]"]=false;var Mn,Tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$n=parseFloat,Fn=parseInt,Nn=typeof global=="object"&&global&&global.Object===Object&&global,Pn=typeof self=="object"&&self&&self.Object===Object&&self,Zn=Nn||Pn||Function("return this")(),qn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=qn&&typeof module=="object"&&module&&!module.nodeType&&module,Kn=Vn&&Vn.exports===qn,Gn=Kn&&Nn.process;
|
||||
n:{try{Mn=Gn&&Gn.binding&&Gn.binding("util");break n}catch(n){}Mn=void 0}var Hn=Mn&&Mn.isArrayBuffer,Jn=Mn&&Mn.isDate,Yn=Mn&&Mn.isMap,Qn=Mn&&Mn.isRegExp,Xn=Mn&&Mn.isSet,nt=Mn&&Mn.isTypedArray,tt=j("length"),rt=w({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I",
|
||||
"\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C",
|
||||
"\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i",
|
||||
"\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S",
|
||||
"\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe",
|
||||
"\u0149":"'n","\u017f":"s"}),et=w({"&":"&","<":"<",">":">",'"':""","'":"'"}),ut=w({"&":"&","<":"<",">":">",""":'"',"'":"'"}),it=function w(En){function On(n){if(xu(n)&&!af(n)&&!(n instanceof Mn)){if(n instanceof zn)return n;if(ci.call(n,"__wrapped__"))return Pe(n)}return new zn(n)}function Sn(){}function zn(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=F}function Mn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,
|
||||
this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Tn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Nn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Pn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function qn(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Pn;++t<r;)this.add(n[t])}function Vn(n){
|
||||
this.size=(this.__data__=new Nn(n)).size}function Gn(n,t){var r,e=af(n),u=!e&&cf(n),i=!e&&!u&&sf(n),o=!e&&!u&&!i&&gf(n),u=(e=e||u||i||o)?E(n.length,ri):[],f=u.length;for(r in n)!t&&!ci.call(n,r)||e&&("length"==r||i&&("offset"==r||"parent"==r)||o&&("buffer"==r||"byteLength"==r||"byteOffset"==r)||Re(r,f))||u.push(r);return u}function tt(n){var t=n.length;return t?n[cr(0,t-1)]:F}function ot(n,t){return Te(Mr(n),gt(t,0,n.length))}function ft(n){return Te(Mr(n))}function ct(n,t,r){(r===F||hu(n[t],r))&&(r!==F||t in n)||_t(n,t,r);
|
||||
}function at(n,t,r){var e=n[t];ci.call(n,t)&&hu(e,r)&&(r!==F||t in n)||_t(n,t,r)}function lt(n,t){for(var r=n.length;r--;)if(hu(n[r][0],t))return r;return-1}function st(n,t,r,e){return oo(n,function(n,u,i){t(e,n,r(n),i)}),e}function ht(n,t){return n&&Tr(t,Lu(t),n)}function pt(n,t){return n&&Tr(t,Uu(t),n)}function _t(n,t,r){"__proto__"==t&&Ei?Ei(n,t,{configurable:true,enumerable:true,value:r,writable:true}):n[t]=r}function vt(n,t){for(var r=-1,e=t.length,u=Hu(e),i=null==n;++r<e;)u[r]=i?F:Wu(n,t[r]);return u;
|
||||
}function gt(n,t,r){return n===n&&(r!==F&&(n=n<=r?n:r),t!==F&&(n=n>=t?n:t)),n}function dt(n,t,r,e,i,o){var f,c=1&t,a=2&t,l=4&t;if(r&&(f=i?r(n,e,i,o):r(n)),f!==F)return f;if(!bu(n))return n;if(e=af(n)){if(f=Ee(n),!c)return Mr(n,f)}else{var s=yo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(sf(n))return Wr(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Oe(n),!c)return a?Fr(n,pt(f,n)):$r(n,ht(f,n))}else{if(!Dn[s])return i?n:{};f=Se(n,s,dt,c)}}if(o||(o=new Vn),
|
||||
i=o.get(n))return i;o.set(n,f);var a=l?a?ye:de:a?Uu:Lu,p=e?F:a(n);return u(p||n,function(e,u){p&&(u=e,e=n[u]),at(f,u,dt(e,t,r,u,n,o))}),f}function yt(n){var t=Lu(n);return function(r){return bt(r,n,t)}}function bt(n,t,r){var e=r.length;if(null==n)return!e;for(n=ni(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===F&&!(u in n)||!i(o))return false}return true}function xt(n,t,r){if(typeof n!="function")throw new ei("Expected a function");return jo(function(){n.apply(F,r)},t)}function jt(n,t,r,e){var u=-1,i=c,o=true,f=n.length,s=[],h=t.length;
|
||||
if(!f)return s;r&&(t=l(t,S(r))),e?(i=a,o=false):200<=t.length&&(i=R,o=false,t=new qn(t));n:for(;++u<f;){var p=n[u],_=null==r?p:r(p),p=e||0!==p?p:0;if(o&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function wt(n,t){var r=true;return oo(n,function(n,e,u){return r=!!t(n,e,u)}),r}function mt(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===F?o===o&&!Au(o):r(o,f)))var f=o,c=i}return c}function At(n,t){var r=[];return oo(n,function(n,e,u){
|
||||
t(n,e,u)&&r.push(n)}),r}function kt(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Ie),u||(u=[]);++i<o;){var f=n[i];0<t&&r(f)?1<t?kt(f,t-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function Et(n,t){return n&&co(n,t,Lu)}function Ot(n,t){return n&&ao(n,t,Lu)}function St(n,t){return f(t,function(t){return gu(n[t])})}function It(n,t){t=Rr(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[$e(t[r++])];return r&&r==e?n:F}function Rt(n,t,r){return t=t(n),af(n)?t:s(t,r(n))}function zt(n){if(null==n)n=n===F?"[object Undefined]":"[object Null]";else if(ki&&ki in ni(n)){
|
||||
var t=ci.call(n,ki),r=n[ki];try{n[ki]=F;var e=true}catch(n){}var u=si.call(n);e&&(t?n[ki]=r:delete n[ki]),n=u}else n=si.call(n);return n}function Wt(n,t){return n>t}function Bt(n,t){return null!=n&&ci.call(n,t)}function Lt(n,t){return null!=n&&t in ni(n)}function Ut(n,t,r){for(var e=r?a:c,u=n[0].length,i=n.length,o=i,f=Hu(i),s=1/0,h=[];o--;){var p=n[o];o&&t&&(p=l(p,S(t))),s=Mi(p.length,s),f[o]=!r&&(t||120<=u&&120<=p.length)?new qn(o&&p):F}var p=n[0],_=-1,v=f[0];n:for(;++_<u&&h.length<s;){var g=p[_],d=t?t(g):g,g=r||0!==g?g:0;
|
||||
if(v?!R(v,d):!e(h,d,r)){for(o=i;--o;){var y=f[o];if(y?!R(y,d):!e(n[o],d,r))continue n}v&&v.push(d),h.push(g)}}return h}function Ct(n,t,r){var e={};return Et(n,function(n,u,i){t(e,r(n),u,i)}),e}function Dt(n,t,e){return t=Rr(t,n),n=2>t.length?n:It(n,vr(t,0,-1)),t=null==n?n:n[$e(Ge(t))],null==t?F:r(t,n,e)}function Mt(n){return xu(n)&&"[object Arguments]"==zt(n)}function Tt(n){return xu(n)&&"[object ArrayBuffer]"==zt(n)}function $t(n){return xu(n)&&"[object Date]"==zt(n)}function Ft(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!xu(n)&&!xu(t))t=n!==n&&t!==t;else n:{
|
||||
var i=af(n),o=af(t),f=i?"[object Array]":yo(n),c=o?"[object Array]":yo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&sf(n)){if(!sf(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Vn),t=i||gf(n)?_e(n,t,r,e,Ft,u):ve(n,t,f,r,e,Ft,u);else{if(!(1&r)&&(i=a&&ci.call(n,"__wrapped__"),f=o&&ci.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Vn),t=Ft(n,t,r,e,u);break n}if(c)t:if(u||(u=new Vn),
|
||||
i=1&r,f=de(n),o=f.length,c=de(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:ci.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++a<o;){var l=f[a],h=n[l],p=t[l];if(e)var _=i?e(p,h,l,t,n,u):e(h,p,l,n,t,u);if(_===F?h!==p&&!Ft(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(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)&&(c=false)),
|
||||
u.delete(n),u.delete(t),t=c}}else t=false;else t=false}}return t}function Nt(n){return xu(n)&&"[object Map]"==yo(n)}function Pt(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=ni(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return false}for(;++u<i;){var f=r[u],c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===F&&!(c in n))return false}else{if(f=new Vn,e)var s=e(a,l,c,n,t,f);if(s===F?!Ft(l,a,3,e,f):!s)return false}}return true}function Zt(n){return!(!bu(n)||li&&li in n)&&(gu(n)?_i:xn).test(Fe(n))}function qt(n){
|
||||
return xu(n)&&"[object RegExp]"==zt(n)}function Vt(n){return xu(n)&&"[object Set]"==yo(n)}function Kt(n){return xu(n)&&yu(n.length)&&!!Cn[zt(n)]}function Gt(n){return typeof n=="function"?n:null==n?Nu:typeof n=="object"?af(n)?Xt(n[0],n[1]):Qt(n):Vu(n)}function Ht(n){if(!Le(n))return Ci(n);var t,r=[];for(t in ni(n))ci.call(n,t)&&"constructor"!=t&&r.push(t);return r}function Jt(n,t){return n<t}function Yt(n,t){var r=-1,e=pu(n)?Hu(n.length):[];return oo(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Qt(n){
|
||||
var t=me(n);return 1==t.length&&t[0][2]?Ue(t[0][0],t[0][1]):function(r){return r===n||Pt(r,n,t)}}function Xt(n,t){return We(n)&&t===t&&!bu(t)?Ue($e(n),t):function(r){var e=Wu(r,n);return e===F&&e===t?Bu(r,n):Ft(t,e,3)}}function nr(n,t,r,e,u){n!==t&&co(t,function(i,o){if(bu(i)){u||(u=new Vn);var f=u,c=n[o],a=t[o],l=f.get(a);if(l)ct(n,o,l);else{var l=e?e(c,a,o+"",n,t,f):F,s=l===F;if(s){var h=af(a),p=!h&&sf(a),_=!h&&!p&&gf(a),l=a;h||p||_?af(c)?l=c:_u(c)?l=Mr(c):p?(s=false,l=Wr(a,true)):_?(s=false,l=Lr(a,true)):l=[]:wu(a)||cf(a)?(l=c,
|
||||
cf(c)?l=Ru(c):(!bu(c)||r&&gu(c))&&(l=Oe(a))):s=false}s&&(f.set(a,l),nr(l,a,r,e,f),f.delete(a)),ct(n,o,l)}}else f=e?e(n[o],i,o+"",n,t,u):F,f===F&&(f=i),ct(n,o,f)},Uu)}function tr(n,t){var r=n.length;if(r)return t+=0>t?r:0,Re(t,r)?n[t]:F}function rr(n,t,r){var e=-1;return t=l(t.length?t:[Nu],S(je())),n=Yt(n,function(n){return{a:l(t,function(t){return t(n)}),b:++e,c:n}}),A(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e<o;){var c=Ur(u[e],i[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);
|
||||
break n}}e=n.b-t.b}return e})}function er(n,t){return ur(n,t,function(t,r){return Bu(n,r)})}function ur(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=It(n,o);r(f,o)&&pr(i,Rr(o,n),f)}return i}function ir(n){return function(t){return It(t,n)}}function or(n,t,r,e){var u=e?y:d,i=-1,o=t.length,f=n;for(n===t&&(t=Mr(t)),r&&(f=l(n,S(r)));++i<o;)for(var c=0,a=t[i],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==n&&wi.call(f,c,1),wi.call(n,c,1);return n}function fr(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];
|
||||
if(r==e||u!==i){var i=u;Re(u)?wi.call(n,u,1):mr(n,u)}}}function cr(n,t){return n+zi(Fi()*(t-n+1))}function ar(n,t){var r="";if(!n||1>t||9007199254740991<t)return r;do t%2&&(r+=n),(t=zi(t/2))&&(n+=n);while(t);return r}function lr(n,t){return wo(Ce(n,t,Nu),n+"")}function sr(n){return tt(Du(n))}function hr(n,t){var r=Du(n);return Te(r,gt(t,0,r.length))}function pr(n,t,r,e){if(!bu(n))return n;t=Rr(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=$e(t[u]),a=r;if(u!=o){var l=f[c],a=e?e(l,c,f):F;
|
||||
a===F&&(a=bu(l)?l:Re(t[u+1])?[]:{})}at(f,c,a),f=f[c]}return n}function _r(n){return Te(Du(n))}function vr(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=Hu(u);++e<u;)r[e]=n[e+t];return r}function gr(n,t){var r;return oo(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function dr(n,t,r){var e=0,u=null==n?e:n.length;if(typeof t=="number"&&t===t&&2147483647>=u){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!Au(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return yr(n,t,Nu,r);
|
||||
}function yr(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!==t,f=null===t,c=Au(t),a=t===F;u<i;){var l=zi((u+i)/2),s=r(n[l]),h=s!==F,p=null===s,_=s===s,v=Au(s);(o?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?s<=t:s<t)?u=l+1:i=l}return Mi(i,4294967294)}function br(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!hu(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function xr(n){return typeof n=="number"?n:Au(n)?P:+n}function jr(n){if(typeof n=="string")return n;
|
||||
if(af(n))return l(n,jr)+"";if(Au(n))return uo?uo.call(n):"";var t=n+"";return"0"==t&&1/n==-N?"-0":t}function wr(n,t,r){var e=-1,u=c,i=n.length,o=true,f=[],l=f;if(r)o=false,u=a;else if(200<=i){if(u=t?null:po(n))return D(u);o=false,u=R,l=new qn}else l=t?[]:f;n:for(;++e<i;){var s=n[e],h=t?t(s):s,s=r||0!==s?s:0;if(o&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue n;t&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function mr(n,t){return t=Rr(t,n),n=2>t.length?n:It(n,vr(t,0,-1)),
|
||||
null==n||delete n[$e(Ge(t))]}function Ar(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?vr(n,e?0:i,e?i+1:u):vr(n,e?i+1:0,e?u:i)}function kr(n,t){var r=n;return r instanceof Mn&&(r=r.value()),h(t,function(n,t){return t.func.apply(t.thisArg,s([n],t.args))},r)}function Er(n,t,r){var e=n.length;if(2>e)return e?wr(n[0]):[];for(var u=-1,i=Hu(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=jt(i[u]||o,n[f],t,r));return wr(kt(i,1),t,r)}function Or(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;)r(o,n[e],e<i?t[e]:F);
|
||||
return o}function Sr(n){return _u(n)?n:[]}function Ir(n){return typeof n=="function"?n:Nu}function Rr(n,t){return af(n)?n:We(n,t)?[n]:mo(zu(n))}function zr(n,t,r){var e=n.length;return r=r===F?e:r,!t&&r>=e?n:vr(n,t,r)}function Wr(n,t){if(t)return n.slice();var r=n.length,r=yi?yi(r):new n.constructor(r);return n.copy(r),r}function Br(n){var t=new n.constructor(n.byteLength);return new di(t).set(new di(n)),t}function Lr(n,t){return new n.constructor(t?Br(n.buffer):n.buffer,n.byteOffset,n.length)}function Ur(n,t){
|
||||
if(n!==t){var r=n!==F,e=null===n,u=n===n,i=Au(n),o=t!==F,f=null===t,c=t===t,a=Au(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Cr(n,t,r,e){var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Di(i-o,0),l=Hu(c+a);for(e=!e;++f<c;)l[f]=t[f];for(;++u<o;)(e||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l}function Dr(n,t,r,e){var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Di(i-f,0),s=Hu(l+a);
|
||||
for(e=!e;++u<l;)s[u]=n[u];for(l=u;++c<a;)s[l+c]=t[c];for(;++o<f;)(e||u<i)&&(s[l+r[o]]=n[u++]);return s}function Mr(n,t){var r=-1,e=n.length;for(t||(t=Hu(e));++r<e;)t[r]=n[r];return t}function Tr(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):F;c===F&&(c=n[f]),u?_t(r,f,c):at(r,f,c)}return r}function $r(n,t){return Tr(n,vo(n),t)}function Fr(n,t){return Tr(n,go(n),t)}function Nr(n,t){return function(r,u){var i=af(r)?e:st,o=t?t():{};return i(r,n,je(u,2),o);
|
||||
}}function Pr(n){return lr(function(t,r){var e=-1,u=r.length,i=1<u?r[u-1]:F,o=2<u?r[2]:F,i=3<n.length&&typeof i=="function"?(u--,i):F;for(o&&ze(r[0],r[1],o)&&(i=3>u?F:i,u=1),t=ni(t);++e<u;)(o=r[e])&&n(t,o,e,i);return t})}function Zr(n,t){return function(r,e){if(null==r)return r;if(!pu(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=ni(r);(t?i--:++i<u)&&false!==e(o[i],i,o););return r}}function qr(n){return function(t,r,e){var u=-1,i=ni(t);e=e(t);for(var o=e.length;o--;){var f=e[n?o:++u];if(false===r(i[f],f,i))break;
|
||||
}return t}}function Vr(n,t,r){function e(){return(this&&this!==Zn&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=1&t,i=Hr(n);return e}function Kr(n){return function(t){t=zu(t);var r=Bn.test(t)?$(t):F,e=r?r[0]:t.charAt(0);return t=r?zr(r,1).join(""):t.slice(1),e[n]()+t}}function Gr(n){return function(t){return h($u(Tu(t).replace(In,"")),n,"")}}function Hr(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=io(n.prototype),t=n.apply(r,t);return bu(t)?t:r}}function Jr(n,t,e){function u(){for(var o=arguments.length,f=Hu(o),c=o,a=xe(u);c--;)f[c]=arguments[c];return c=3>o&&f[0]!==a&&f[o-1]!==a?[]:C(f,a),o-=c.length,o<e?fe(n,t,Xr,u.placeholder,F,f,c,F,F,e-o):r(this&&this!==Zn&&this instanceof u?i:n,this,f);
|
||||
}var i=Hr(n);return u}function Yr(n){return function(t,r,e){var u=ni(t);if(!pu(t)){var i=je(r,3);t=Lu(t),r=function(n){return i(u[n],n,u)}}return r=n(t,r,e),-1<r?u[i?t[r]:r]:F}}function Qr(n){return ge(function(t){var r=t.length,e=r,u=zn.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if(typeof i!="function")throw new ei("Expected a function");if(u&&!o&&"wrapper"==be(i))var o=new zn([],true)}for(e=o?e:r;++e<r;)var i=t[e],u=be(i),f="wrapper"==u?_o(i):F,o=f&&Be(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?o[be(f[0])].apply(o,f[3]):1==i.length&&Be(i)?o[u]():o.thru(i);
|
||||
return function(){var n=arguments,e=n[0];if(o&&1==n.length&&af(e))return o.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 Xr(n,t,r,e,u,i,o,f,c,a){function l(){for(var d=arguments.length,y=Hu(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=xe(l),b=y.length;for(x=0;b--;)y[b]===j&&++x}if(e&&(y=Cr(y,e,u,_)),i&&(y=Dr(y,i,o,_)),d-=x,_&&d<a)return j=C(y,j),fe(n,t,Xr,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[n]:n,d=y.length,f){x=y.length;for(var w=Mi(f.length,x),m=Mr(y);w--;){
|
||||
var A=f[w];y[w]=Re(A,x)?m[A]:F}}else v&&1<d&&y.reverse();return s&&c<d&&(y.length=c),this&&this!==Zn&&this instanceof l&&(b=g||Hr(b)),b.apply(j,y)}var s=128&t,h=1&t,p=2&t,_=24&t,v=512&t,g=p?F:Hr(n);return l}function ne(n,t){return function(r,e){return Ct(r,n,t(e))}}function te(n,t){return function(r,e){var u;if(r===F&&e===F)return t;if(r!==F&&(u=r),e!==F){if(u===F)return e;typeof r=="string"||typeof e=="string"?(r=jr(r),e=jr(e)):(r=xr(r),e=xr(e)),u=n(r,e)}return u}}function re(n){return ge(function(t){
|
||||
return t=l(t,S(je())),lr(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function ee(n,t){t=t===F?" ":jr(t);var r=t.length;return 2>r?r?ar(t,n):t:(r=ar(t,Ri(n/T(t))),Bn.test(t)?zr($(r),0,n).join(""):r.slice(0,n))}function ue(n,t,e,u){function i(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Hu(l+c),h=this&&this!==Zn&&this instanceof i?f:n;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++t];return r(h,o?e:this,s)}var o=1&t,f=Hr(n);return i}function ie(n){return function(t,r,e){
|
||||
e&&typeof e!="number"&&ze(t,r,e)&&(r=e=F),t=Eu(t),r===F?(r=t,t=0):r=Eu(r),e=e===F?t<r?1:-1:Eu(e);var u=-1;r=Di(Ri((r-t)/(e||1)),0);for(var i=Hu(r);r--;)i[n?r:++u]=t,t+=e;return i}}function oe(n){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=Iu(t),r=Iu(r)),n(t,r)}}function fe(n,t,r,e,u,i,o,f,c,a){var l=8&t,s=l?o:F;o=l?F:o;var h=l?i:F;return i=l?F:i,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),u=[n,t,u,h,s,i,o,f,c,a],r=r.apply(F,u),Be(n)&&xo(r,u),r.placeholder=e,De(r,n,t)}function ce(n){
|
||||
var t=Xu[n];return function(n,r){if(n=Iu(n),r=null==r?0:Mi(Ou(r),292)){var e=(zu(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(zu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function ae(n){return function(t){var r=yo(t);return"[object Map]"==r?L(t):"[object Set]"==r?M(t):O(t,n(t))}}function le(n,t,r,e,u,i,o,f){var c=2&t;if(!c&&typeof n!="function")throw new ei("Expected a function");var a=e?e.length:0;if(a||(t&=-97,e=u=F),o=o===F?o:Di(Ou(o),0),f=f===F?f:Ou(f),a-=u?u.length:0,64&t){
|
||||
var l=e,s=u;e=u=F}var h=c?F:_o(n);return i=[n,t,r,e,u,l,s,i,o,f],h&&(r=i[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&i[7].length<=h[8]||384==n&&h[7].length<=h[8]&&8==r,131>t||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Cr(e,r,h[4]):r,i[4]=e?C(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Dr(e,r,h[6]):r,i[6]=e?C(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Mi(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1],
|
||||
r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===F?c?0:n.length:Di(i[9]-a,0),!f&&24&t&&(t&=-25),De((h?lo:xo)(t&&1!=t?8==t||16==t?Jr(n,t,f):32!=t&&33!=t||u.length?Xr.apply(F,i):ue(n,t,r,e):Vr(n,t,r),i),n,t)}function se(n,t,r,e){return n===F||hu(n,ii[r])&&!ci.call(e,r)?t:n}function he(n,t,r,e,u,i){return bu(n)&&bu(t)&&(i.set(t,n),nr(n,t,F,he,i),i.delete(t)),n}function pe(n){return wu(n)?F:n}function _e(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t;var c=-1,a=true,l=2&r?new qn:F;
|
||||
for(i.set(n,t),i.set(t,n);++c<f;){var s=n[c],h=t[c];if(e)var p=o?e(h,s,c,t,n,i):e(s,h,c,n,t,i);if(p!==F){if(p)continue;a=false;break}if(l){if(!_(t,function(n,t){if(!R(l,t)&&(s===n||u(s,n,r,e,i)))return l.push(t)})){a=false;break}}else if(s!==h&&!u(s,h,r,e,i)){a=false;break}}return i.delete(n),i.delete(t),a}function ve(n,t,r,e,u,i,o){switch(r){case"[object DataView]":if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)break;n=n.buffer,t=t.buffer;case"[object ArrayBuffer]":if(n.byteLength!=t.byteLength||!i(new di(n),new di(t)))break;
|
||||
return true;case"[object Boolean]":case"[object Date]":case"[object Number]":return hu(+n,+t);case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object RegExp]":case"[object String]":return n==t+"";case"[object Map]":var f=L;case"[object Set]":if(f||(f=D),n.size!=t.size&&!(1&e))break;return(r=o.get(n))?r==t:(e|=2,o.set(n,t),t=_e(f(n),f(t),e,u,i,o),o.delete(n),t);case"[object Symbol]":if(eo)return eo.call(n)==eo.call(t)}return false}function ge(n){return wo(Ce(n,F,Ve),n+"")}function de(n){
|
||||
return Rt(n,Lu,vo)}function ye(n){return Rt(n,Uu,go)}function be(n){for(var t=n.name+"",r=Ji[t],e=ci.call(Ji,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function xe(n){return(ci.call(On,"placeholder")?On:n).placeholder}function je(){var n=On.iteratee||Pu,n=n===Pu?Gt:n;return arguments.length?n(arguments[0],arguments[1]):n}function we(n,t){var r=n.__data__,e=typeof t;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?r[typeof t=="string"?"string":"hash"]:r.map;
|
||||
}function me(n){for(var t=Lu(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,u===u&&!bu(u)]}return t}function Ae(n,t){var r=null==n?F:n[t];return Zt(r)?r:F}function ke(n,t,r){t=Rr(t,n);for(var e=-1,u=t.length,i=false;++e<u;){var o=$e(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&yu(u)&&Re(o,u)&&(af(n)||cf(n)))}function Ee(n){var t=n.length,r=n.constructor(t);return t&&"string"==typeof n[0]&&ci.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Oe(n){
|
||||
return typeof n.constructor!="function"||Le(n)?{}:io(bi(n))}function Se(r,e,u,i){var o=r.constructor;switch(e){case"[object ArrayBuffer]":return Br(r);case"[object Boolean]":case"[object Date]":return new o(+r);case"[object DataView]":return e=i?Br(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 Lr(r,i);case"[object Map]":return e=i?u(L(r),1):L(r),h(e,n,new r.constructor);case"[object Number]":case"[object String]":return new o(r);case"[object RegExp]":return e=new r.constructor(r.source,dn.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=i?u(D(r),1):D(r),h(e,t,new r.constructor);case"[object Symbol]":return eo?ni(eo.call(r)):{}}}function Ie(n){return af(n)||cf(n)||!!(mi&&n&&n[mi])}function Re(n,t){return t=null==t?9007199254740991:t,
|
||||
!!t&&(typeof n=="number"||wn.test(n))&&-1<n&&0==n%1&&n<t}function ze(n,t,r){if(!bu(r))return false;var e=typeof t;return!!("number"==e?pu(r)&&Re(t,r.length):"string"==e&&t in r)&&hu(r[t],n)}function We(n,t){if(af(n))return false;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!Au(n))||(rn.test(n)||!tn.test(n)||null!=t&&n in ni(t))}function Be(n){var t=be(n),r=On[t];return typeof r=="function"&&t in Mn.prototype&&(n===r||(t=_o(r),!!t&&n===t[0]))}function Le(n){var t=n&&n.constructor;
|
||||
return n===(typeof t=="function"&&t.prototype||ii)}function Ue(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==F||n in ni(r)))}}function Ce(n,t,e){return t=Di(t===F?n.length-1:t,0),function(){for(var u=arguments,i=-1,o=Di(u.length-t,0),f=Hu(o);++i<o;)f[i]=u[t+i];for(i=-1,o=Hu(t+1);++i<t;)o[i]=u[i];return o[t]=e(f),r(n,this,o)}}function De(n,t,r){var e=t+"";t=wo;var u,i=Ne;return u=(u=e.match(hn))?u[1].split(pn):[],r=i(u,r),(i=r.length)&&(u=i-1,r[u]=(1<i?"& ":"")+r[u],r=r.join(2<i?", ":" "),
|
||||
e=e.replace(sn,"{\n/* [wrapped with "+r+"] */\n")),t(n,e)}function Me(n){var t=0,r=0;return function(){var e=Ti(),u=16-(e-r);if(r=e,0<u){if(800<=++t)return arguments[0]}else t=0;return n.apply(F,arguments)}}function Te(n,t){var r=-1,e=n.length,u=e-1;for(t=t===F?e:t;++r<t;){var e=cr(r,u),i=n[e];n[e]=n[r],n[r]=i}return n.length=t,n}function $e(n){if(typeof n=="string"||Au(n))return n;var t=n+"";return"0"==t&&1/n==-N?"-0":t}function Fe(n){if(null!=n){try{return fi.call(n)}catch(n){}return n+""}return"";
|
||||
}function Ne(n,t){return u(Z,function(r){var e="_."+r[0];t&r[1]&&!c(n,e)&&n.push(e)}),n.sort()}function Pe(n){if(n instanceof Mn)return n.clone();var t=new zn(n.__wrapped__,n.__chain__);return t.__actions__=Mr(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Ze(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Ou(r),0>r&&(r=Di(e+r,0)),g(n,je(t,3),r)):-1}function qe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==F&&(u=Ou(r),u=0>r?Di(e+u,0):Mi(u,e-1)),
|
||||
g(n,je(t,3),u,true)}function Ve(n){return(null==n?0:n.length)?kt(n,1):[]}function Ke(n){return n&&n.length?n[0]:F}function Ge(n){var t=null==n?0:n.length;return t?n[t-1]:F}function He(n,t){return n&&n.length&&t&&t.length?or(n,t):n}function Je(n){return null==n?n:Ni.call(n)}function Ye(n){if(!n||!n.length)return[];var t=0;return n=f(n,function(n){if(_u(n))return t=Di(n.length,t),true}),E(t,function(t){return l(n,j(t))})}function Qe(n,t){if(!n||!n.length)return[];var e=Ye(n);return null==t?e:l(e,function(n){
|
||||
return r(t,F,n)})}function Xe(n){return n=On(n),n.__chain__=true,n}function nu(n,t){return t(n)}function tu(){return this}function ru(n,t){return(af(n)?u:oo)(n,je(t,3))}function eu(n,t){return(af(n)?i:fo)(n,je(t,3))}function uu(n,t){return(af(n)?l:Yt)(n,je(t,3))}function iu(n,t,r){return t=r?F:t,t=n&&null==t?n.length:t,le(n,128,F,F,F,F,t)}function ou(n,t){var r;if(typeof t!="function")throw new ei("Expected a function");return n=Ou(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=F),
|
||||
r}}function fu(n,t,r){return t=r?F:t,n=le(n,8,F,F,F,F,F,t),n.placeholder=fu.placeholder,n}function cu(n,t,r){return t=r?F:t,n=le(n,16,F,F,F,F,F,t),n.placeholder=cu.placeholder,n}function au(n,t,r){function e(t){var r=c,e=a;return c=a=F,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===F||r>=t||0>r||g&&n>=l}function i(){var n=Jo();if(u(n))return o(n);var r,e=jo;r=n-_,n=t-(n-p),r=g?Mi(n,l-r):n,h=e(i,r)}function o(n){return h=F,d&&c?e(n):(c=a=F,s)}function f(){var n=Jo(),r=u(n);if(c=arguments,
|
||||
a=this,p=n,r){if(h===F)return _=n=p,h=jo(i,t),v?e(n):s;if(g)return h=jo(i,t),e(p)}return h===F&&(h=jo(i,t)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ei("Expected a function");return t=Iu(t)||0,bu(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Di(Iu(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==F&&ho(h),_=0,c=p=a=h=F},f.flush=function(){return h===F?s:o(Jo())},f}function lu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e),
|
||||
r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ei("Expected a function");return r.cache=new(lu.Cache||Pn),r}function su(n){if(typeof n!="function")throw new ei("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function hu(n,t){return n===t||n!==n&&t!==t}function pu(n){return null!=n&&yu(n.length)&&!gu(n);
|
||||
}function _u(n){return xu(n)&&pu(n)}function vu(n){if(!xu(n))return false;var t=zt(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!wu(n)}function gu(n){return!!bu(n)&&(n=zt(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function du(n){return typeof n=="number"&&n==Ou(n)}function yu(n){return typeof n=="number"&&-1<n&&0==n%1&&9007199254740991>=n}function bu(n){var t=typeof n;return null!=n&&("object"==t||"function"==t);
|
||||
}function xu(n){return null!=n&&typeof n=="object"}function ju(n){return typeof n=="number"||xu(n)&&"[object Number]"==zt(n)}function wu(n){return!(!xu(n)||"[object Object]"!=zt(n))&&(n=bi(n),null===n||(n=ci.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&fi.call(n)==hi))}function mu(n){return typeof n=="string"||!af(n)&&xu(n)&&"[object String]"==zt(n)}function Au(n){return typeof n=="symbol"||xu(n)&&"[object Symbol]"==zt(n)}function ku(n){if(!n)return[];if(pu(n))return mu(n)?$(n):Mr(n);
|
||||
if(Ai&&n[Ai]){n=n[Ai]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=yo(n),("[object Map]"==t?L:"[object Set]"==t?D:Du)(n)}function Eu(n){return n?(n=Iu(n),n===N||n===-N?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Ou(n){n=Eu(n);var t=n%1;return n===n?t?n-t:n:0}function Su(n){return n?gt(Ou(n),0,4294967295):0}function Iu(n){if(typeof n=="number")return n;if(Au(n))return P;if(bu(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=bu(n)?n+"":n),typeof n!="string")return 0===n?n:+n;
|
||||
n=n.replace(cn,"");var t=bn.test(n);return t||jn.test(n)?Fn(n.slice(2),t?2:8):yn.test(n)?P:+n}function Ru(n){return Tr(n,Uu(n))}function zu(n){return null==n?"":jr(n)}function Wu(n,t,r){return n=null==n?F:It(n,t),n===F?r:n}function Bu(n,t){return null!=n&&ke(n,t,Lt)}function Lu(n){return pu(n)?Gn(n):Ht(n)}function Uu(n){if(pu(n))n=Gn(n,true);else if(bu(n)){var t,r=Le(n),e=[];for(t in n)("constructor"!=t||!r&&ci.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in ni(n))t.push(r);n=t}return n}function Cu(n,t){
|
||||
if(null==n)return{};var r=l(ye(n),function(n){return[n]});return t=je(t),ur(n,r,function(n,r){return t(n,r[0])})}function Du(n){return null==n?[]:I(n,Lu(n))}function Mu(n){return Nf(zu(n).toLowerCase())}function Tu(n){return(n=zu(n))&&n.replace(mn,rt).replace(Rn,"")}function $u(n,t,r){return n=zu(n),t=r?F:t,t===F?Ln.test(n)?n.match(Wn)||[]:n.match(_n)||[]:n.match(t)||[]}function Fu(n){return function(){return n}}function Nu(n){return n}function Pu(n){return Gt(typeof n=="function"?n:dt(n,1))}function Zu(n,t,r){
|
||||
var e=Lu(t),i=St(t,e);null!=r||bu(t)&&(i.length||!e.length)||(r=t,t=n,n=this,i=St(t,Lu(t)));var o=!(bu(r)&&"chain"in r&&!r.chain),f=gu(n);return u(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Mr(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,s([this.value()],arguments))})}),n}function qu(){}function Vu(n){return We(n)?j($e(n)):ir(n)}function Ku(){return[]}function Gu(){
|
||||
return false}En=null==En?Zn:it.defaults(Zn.Object(),En,it.pick(Zn,Un));var Hu=En.Array,Ju=En.Date,Yu=En.Error,Qu=En.Function,Xu=En.Math,ni=En.Object,ti=En.RegExp,ri=En.String,ei=En.TypeError,ui=Hu.prototype,ii=ni.prototype,oi=En["__core-js_shared__"],fi=Qu.prototype.toString,ci=ii.hasOwnProperty,ai=0,li=function(){var n=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),si=ii.toString,hi=fi.call(ni),pi=Zn._,_i=ti("^"+fi.call(ci).replace(on,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vi=Kn?En.Buffer:F,gi=En.Symbol,di=En.Uint8Array,yi=vi?vi.f:F,bi=U(ni.getPrototypeOf,ni),xi=ni.create,ji=ii.propertyIsEnumerable,wi=ui.splice,mi=gi?gi.isConcatSpreadable:F,Ai=gi?gi.iterator:F,ki=gi?gi.toStringTag:F,Ei=function(){
|
||||
try{var n=Ae(ni,"defineProperty");return n({},"",{}),n}catch(n){}}(),Oi=En.clearTimeout!==Zn.clearTimeout&&En.clearTimeout,Si=Ju&&Ju.now!==Zn.Date.now&&Ju.now,Ii=En.setTimeout!==Zn.setTimeout&&En.setTimeout,Ri=Xu.ceil,zi=Xu.floor,Wi=ni.getOwnPropertySymbols,Bi=vi?vi.isBuffer:F,Li=En.isFinite,Ui=ui.join,Ci=U(ni.keys,ni),Di=Xu.max,Mi=Xu.min,Ti=Ju.now,$i=En.parseInt,Fi=Xu.random,Ni=ui.reverse,Pi=Ae(En,"DataView"),Zi=Ae(En,"Map"),qi=Ae(En,"Promise"),Vi=Ae(En,"Set"),Ki=Ae(En,"WeakMap"),Gi=Ae(ni,"create"),Hi=Ki&&new Ki,Ji={},Yi=Fe(Pi),Qi=Fe(Zi),Xi=Fe(qi),no=Fe(Vi),to=Fe(Ki),ro=gi?gi.prototype:F,eo=ro?ro.valueOf:F,uo=ro?ro.toString:F,io=function(){
|
||||
function n(){}return function(t){return bu(t)?xi?xi(t):(n.prototype=t,t=new n,n.prototype=F,t):{}}}();On.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:On}},On.prototype=Sn.prototype,On.prototype.constructor=On,zn.prototype=io(Sn.prototype),zn.prototype.constructor=zn,Mn.prototype=io(Sn.prototype),Mn.prototype.constructor=Mn,Tn.prototype.clear=function(){this.__data__=Gi?Gi(null):{},this.size=0},Tn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n],
|
||||
this.size-=n?1:0,n},Tn.prototype.get=function(n){var t=this.__data__;return Gi?(n=t[n],"__lodash_hash_undefined__"===n?F:n):ci.call(t,n)?t[n]:F},Tn.prototype.has=function(n){var t=this.__data__;return Gi?t[n]!==F:ci.call(t,n)},Tn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Gi&&t===F?"__lodash_hash_undefined__":t,this},Nn.prototype.clear=function(){this.__data__=[],this.size=0},Nn.prototype.delete=function(n){var t=this.__data__;return n=lt(t,n),!(0>n)&&(n==t.length-1?t.pop():wi.call(t,n,1),
|
||||
--this.size,true)},Nn.prototype.get=function(n){var t=this.__data__;return n=lt(t,n),0>n?F:t[n][1]},Nn.prototype.has=function(n){return-1<lt(this.__data__,n)},Nn.prototype.set=function(n,t){var r=this.__data__,e=lt(r,n);return 0>e?(++this.size,r.push([n,t])):r[e][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Tn,map:new(Zi||Nn),string:new Tn}},Pn.prototype.delete=function(n){return n=we(this,n).delete(n),this.size-=n?1:0,n},Pn.prototype.get=function(n){return we(this,n).get(n);
|
||||
},Pn.prototype.has=function(n){return we(this,n).has(n)},Pn.prototype.set=function(n,t){var r=we(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},qn.prototype.add=qn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},qn.prototype.has=function(n){return this.__data__.has(n)},Vn.prototype.clear=function(){this.__data__=new Nn,this.size=0},Vn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Vn.prototype.get=function(n){
|
||||
return this.__data__.get(n)},Vn.prototype.has=function(n){return this.__data__.has(n)},Vn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Nn){var e=r.__data__;if(!Zi||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Pn(e)}return r.set(n,t),this.size=r.size,this};var oo=Zr(Et),fo=Zr(Ot,true),co=qr(),ao=qr(true),lo=Hi?function(n,t){return Hi.set(n,t),n}:Nu,so=Ei?function(n,t){return Ei(n,"toString",{configurable:true,enumerable:false,value:Fu(t),writable:true})}:Nu,ho=Oi||function(n){
|
||||
return Zn.clearTimeout(n)},po=Vi&&1/D(new Vi([,-0]))[1]==N?function(n){return new Vi(n)}:qu,_o=Hi?function(n){return Hi.get(n)}:qu,vo=Wi?function(n){return null==n?[]:(n=ni(n),f(Wi(n),function(t){return ji.call(n,t)}))}:Ku,go=Wi?function(n){for(var t=[];n;)s(t,vo(n)),n=bi(n);return t}:Ku,yo=zt;(Pi&&"[object DataView]"!=yo(new Pi(new ArrayBuffer(1)))||Zi&&"[object Map]"!=yo(new Zi)||qi&&"[object Promise]"!=yo(qi.resolve())||Vi&&"[object Set]"!=yo(new Vi)||Ki&&"[object WeakMap]"!=yo(new Ki))&&(yo=function(n){
|
||||
var t=zt(n);if(n=(n="[object Object]"==t?n.constructor:F)?Fe(n):"")switch(n){case Yi:return"[object DataView]";case Qi:return"[object Map]";case Xi:return"[object Promise]";case no:return"[object Set]";case to:return"[object WeakMap]"}return t});var bo=oi?gu:Gu,xo=Me(lo),jo=Ii||function(n,t){return Zn.setTimeout(n,t)},wo=Me(so),mo=function(n){n=lu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return en.test(n)&&t.push(""),n.replace(un,function(n,r,e,u){
|
||||
t.push(e?u.replace(vn,"$1"):r||n)}),t}),Ao=lr(function(n,t){return _u(n)?jt(n,kt(t,1,_u,true)):[]}),ko=lr(function(n,t){var r=Ge(t);return _u(r)&&(r=F),_u(n)?jt(n,kt(t,1,_u,true),je(r,2)):[]}),Eo=lr(function(n,t){var r=Ge(t);return _u(r)&&(r=F),_u(n)?jt(n,kt(t,1,_u,true),F,r):[]}),Oo=lr(function(n){var t=l(n,Sr);return t.length&&t[0]===n[0]?Ut(t):[]}),So=lr(function(n){var t=Ge(n),r=l(n,Sr);return t===Ge(r)?t=F:r.pop(),r.length&&r[0]===n[0]?Ut(r,je(t,2)):[]}),Io=lr(function(n){var t=Ge(n),r=l(n,Sr);return(t=typeof t=="function"?t:F)&&r.pop(),
|
||||
r.length&&r[0]===n[0]?Ut(r,F,t):[]}),Ro=lr(He),zo=ge(function(n,t){var r=null==n?0:n.length,e=vt(n,t);return fr(n,l(t,function(n){return Re(n,r)?+n:n}).sort(Ur)),e}),Wo=lr(function(n){return wr(kt(n,1,_u,true))}),Bo=lr(function(n){var t=Ge(n);return _u(t)&&(t=F),wr(kt(n,1,_u,true),je(t,2))}),Lo=lr(function(n){var t=Ge(n),t=typeof t=="function"?t:F;return wr(kt(n,1,_u,true),F,t)}),Uo=lr(function(n,t){return _u(n)?jt(n,t):[]}),Co=lr(function(n){return Er(f(n,_u))}),Do=lr(function(n){var t=Ge(n);return _u(t)&&(t=F),
|
||||
Er(f(n,_u),je(t,2))}),Mo=lr(function(n){var t=Ge(n),t=typeof t=="function"?t:F;return Er(f(n,_u),F,t)}),To=lr(Ye),$o=lr(function(n){var t=n.length,t=1<t?n[t-1]:F,t=typeof t=="function"?(n.pop(),t):F;return Qe(n,t)}),Fo=ge(function(n){function t(t){return vt(t,n)}var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return!(1<r||this.__actions__.length)&&u instanceof Mn&&Re(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:nu,args:[t],thisArg:F}),new zn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(F),
|
||||
n})):this.thru(t)}),No=Nr(function(n,t,r){ci.call(n,r)?++n[r]:_t(n,r,1)}),Po=Yr(Ze),Zo=Yr(qe),qo=Nr(function(n,t,r){ci.call(n,r)?n[r].push(t):_t(n,r,[t])}),Vo=lr(function(n,t,e){var u=-1,i=typeof t=="function",o=pu(n)?Hu(n.length):[];return oo(n,function(n){o[++u]=i?r(t,n,e):Dt(n,t,e)}),o}),Ko=Nr(function(n,t,r){_t(n,r,t)}),Go=Nr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Ho=lr(function(n,t){if(null==n)return[];var r=t.length;return 1<r&&ze(n,t[0],t[1])?t=[]:2<r&&ze(t[0],t[1],t[2])&&(t=[t[0]]),
|
||||
rr(n,kt(t,1),[])}),Jo=Si||function(){return Zn.Date.now()},Yo=lr(function(n,t,r){var e=1;if(r.length)var u=C(r,xe(Yo)),e=32|e;return le(n,e,t,r,u)}),Qo=lr(function(n,t,r){var e=3;if(r.length)var u=C(r,xe(Qo)),e=32|e;return le(t,e,n,r,u)}),Xo=lr(function(n,t){return xt(n,1,t)}),nf=lr(function(n,t,r){return xt(n,Iu(t)||0,r)});lu.Cache=Pn;var tf=lr(function(n,t){t=1==t.length&&af(t[0])?l(t[0],S(je())):l(kt(t,1),S(je()));var e=t.length;return lr(function(u){for(var i=-1,o=Mi(u.length,e);++i<o;)u[i]=t[i].call(this,u[i]);
|
||||
return r(n,this,u)})}),rf=lr(function(n,t){return le(n,32,F,t,C(t,xe(rf)))}),ef=lr(function(n,t){return le(n,64,F,t,C(t,xe(ef)))}),uf=ge(function(n,t){return le(n,256,F,F,F,t)}),of=oe(Wt),ff=oe(function(n,t){return n>=t}),cf=Mt(function(){return arguments}())?Mt:function(n){return xu(n)&&ci.call(n,"callee")&&!ji.call(n,"callee")},af=Hu.isArray,lf=Hn?S(Hn):Tt,sf=Bi||Gu,hf=Jn?S(Jn):$t,pf=Yn?S(Yn):Nt,_f=Qn?S(Qn):qt,vf=Xn?S(Xn):Vt,gf=nt?S(nt):Kt,df=oe(Jt),yf=oe(function(n,t){return n<=t}),bf=Pr(function(n,t){
|
||||
if(Le(t)||pu(t))Tr(t,Lu(t),n);else for(var r in t)ci.call(t,r)&&at(n,r,t[r])}),xf=Pr(function(n,t){Tr(t,Uu(t),n)}),jf=Pr(function(n,t,r,e){Tr(t,Uu(t),n,e)}),wf=Pr(function(n,t,r,e){Tr(t,Lu(t),n,e)}),mf=ge(vt),Af=lr(function(n){return n.push(F,se),r(jf,F,n)}),kf=lr(function(n){return n.push(F,he),r(Rf,F,n)}),Ef=ne(function(n,t,r){n[t]=r},Fu(Nu)),Of=ne(function(n,t,r){ci.call(n,t)?n[t].push(r):n[t]=[r]},je),Sf=lr(Dt),If=Pr(function(n,t,r){nr(n,t,r)}),Rf=Pr(function(n,t,r,e){nr(n,t,r,e)}),zf=ge(function(n,t){
|
||||
var r={};if(null==n)return r;var e=false;t=l(t,function(t){return t=Rr(t,n),e||(e=1<t.length),t}),Tr(n,ye(n),r),e&&(r=dt(r,7,pe));for(var u=t.length;u--;)mr(r,t[u]);return r}),Wf=ge(function(n,t){return null==n?{}:er(n,t)}),Bf=ae(Lu),Lf=ae(Uu),Uf=Gr(function(n,t,r){return t=t.toLowerCase(),n+(r?Mu(t):t)}),Cf=Gr(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Df=Gr(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Mf=Kr("toLowerCase"),Tf=Gr(function(n,t,r){return n+(r?"_":"")+t.toLowerCase();
|
||||
}),$f=Gr(function(n,t,r){return n+(r?" ":"")+Nf(t)}),Ff=Gr(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Nf=Kr("toUpperCase"),Pf=lr(function(n,t){try{return r(n,F,t)}catch(n){return vu(n)?n:new Yu(n)}}),Zf=ge(function(n,t){return u(t,function(t){t=$e(t),_t(n,t,Yo(n[t],n))}),n}),qf=Qr(),Vf=Qr(true),Kf=lr(function(n,t){return function(r){return Dt(r,n,t)}}),Gf=lr(function(n,t){return function(r){return Dt(n,r,t)}}),Hf=re(l),Jf=re(o),Yf=re(_),Qf=ie(),Xf=ie(true),nc=te(function(n,t){return n+t},0),tc=ce("ceil"),rc=te(function(n,t){
|
||||
return n/t},1),ec=ce("floor"),uc=te(function(n,t){return n*t},1),ic=ce("round"),oc=te(function(n,t){return n-t},0);return On.after=function(n,t){if(typeof t!="function")throw new ei("Expected a function");return n=Ou(n),function(){if(1>--n)return t.apply(this,arguments)}},On.ary=iu,On.assign=bf,On.assignIn=xf,On.assignInWith=jf,On.assignWith=wf,On.at=mf,On.before=ou,On.bind=Yo,On.bindAll=Zf,On.bindKey=Qo,On.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return af(n)?n:[n]},
|
||||
On.chain=Xe,On.chunk=function(n,t,r){if(t=(r?ze(n,t,r):t===F)?1:Di(Ou(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Hu(Ri(r/t));e<r;)i[u++]=vr(n,e,e+=t);return i},On.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},On.concat=function(){var n=arguments.length;if(!n)return[];for(var t=Hu(n-1),r=arguments[0];n--;)t[n-1]=arguments[n];return s(af(r)?Mr(r):[r],kt(t,1))},On.cond=function(n){var t=null==n?0:n.length,e=je();return n=t?l(n,function(n){
|
||||
if("function"!=typeof n[1])throw new ei("Expected a function");return[e(n[0]),n[1]]}):[],lr(function(e){for(var u=-1;++u<t;){var i=n[u];if(r(i[0],this,e))return r(i[1],this,e)}})},On.conforms=function(n){return yt(dt(n,1))},On.constant=Fu,On.countBy=No,On.create=function(n,t){var r=io(n);return null==t?r:ht(r,t)},On.curry=fu,On.curryRight=cu,On.debounce=au,On.defaults=Af,On.defaultsDeep=kf,On.defer=Xo,On.delay=nf,On.difference=Ao,On.differenceBy=ko,On.differenceWith=Eo,On.drop=function(n,t,r){var e=null==n?0:n.length;
|
||||
return e?(t=r||t===F?1:Ou(t),vr(n,0>t?0:t,e)):[]},On.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===F?1:Ou(t),t=e-t,vr(n,0,0>t?0:t)):[]},On.dropRightWhile=function(n,t){return n&&n.length?Ar(n,je(t,3),true,true):[]},On.dropWhile=function(n,t){return n&&n.length?Ar(n,je(t,3),true):[]},On.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&ze(n,t,r)&&(r=0,e=u),u=n.length,r=Ou(r),0>r&&(r=-r>u?0:u+r),e=e===F||e>u?u:Ou(e),0>e&&(e+=u),e=r>e?0:Su(e);r<e;)n[r++]=t;
|
||||
return n},On.filter=function(n,t){return(af(n)?f:At)(n,je(t,3))},On.flatMap=function(n,t){return kt(uu(n,t),1)},On.flatMapDeep=function(n,t){return kt(uu(n,t),N)},On.flatMapDepth=function(n,t,r){return r=r===F?1:Ou(r),kt(uu(n,t),r)},On.flatten=Ve,On.flattenDeep=function(n){return(null==n?0:n.length)?kt(n,N):[]},On.flattenDepth=function(n,t){return null!=n&&n.length?(t=t===F?1:Ou(t),kt(n,t)):[]},On.flip=function(n){return le(n,512)},On.flow=qf,On.flowRight=Vf,On.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){
|
||||
var u=n[t];e[u[0]]=u[1]}return e},On.functions=function(n){return null==n?[]:St(n,Lu(n))},On.functionsIn=function(n){return null==n?[]:St(n,Uu(n))},On.groupBy=qo,On.initial=function(n){return(null==n?0:n.length)?vr(n,0,-1):[]},On.intersection=Oo,On.intersectionBy=So,On.intersectionWith=Io,On.invert=Ef,On.invertBy=Of,On.invokeMap=Vo,On.iteratee=Pu,On.keyBy=Ko,On.keys=Lu,On.keysIn=Uu,On.map=uu,On.mapKeys=function(n,t){var r={};return t=je(t,3),Et(n,function(n,e,u){_t(r,t(n,e,u),n)}),r},On.mapValues=function(n,t){
|
||||
var r={};return t=je(t,3),Et(n,function(n,e,u){_t(r,e,t(n,e,u))}),r},On.matches=function(n){return Qt(dt(n,1))},On.matchesProperty=function(n,t){return Xt(n,dt(t,1))},On.memoize=lu,On.merge=If,On.mergeWith=Rf,On.method=Kf,On.methodOf=Gf,On.mixin=Zu,On.negate=su,On.nthArg=function(n){return n=Ou(n),lr(function(t){return tr(t,n)})},On.omit=zf,On.omitBy=function(n,t){return Cu(n,su(je(t)))},On.once=function(n){return ou(2,n)},On.orderBy=function(n,t,r,e){return null==n?[]:(af(t)||(t=null==t?[]:[t]),
|
||||
r=e?F:r,af(r)||(r=null==r?[]:[r]),rr(n,t,r))},On.over=Hf,On.overArgs=tf,On.overEvery=Jf,On.overSome=Yf,On.partial=rf,On.partialRight=ef,On.partition=Go,On.pick=Wf,On.pickBy=Cu,On.property=Vu,On.propertyOf=function(n){return function(t){return null==n?F:It(n,t)}},On.pull=Ro,On.pullAll=He,On.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?or(n,t,je(r,2)):n},On.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?or(n,t,F,r):n},On.pullAt=zo,On.range=Qf,On.rangeRight=Xf,On.rearg=uf,On.reject=function(n,t){
|
||||
return(af(n)?f:At)(n,su(je(t,3)))},On.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=je(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return fr(n,u),r},On.rest=function(n,t){if(typeof n!="function")throw new ei("Expected a function");return t=t===F?t:Ou(t),lr(n,t)},On.reverse=Je,On.sampleSize=function(n,t,r){return t=(r?ze(n,t,r):t===F)?1:Ou(t),(af(n)?ot:hr)(n,t)},On.set=function(n,t,r){return null==n?n:pr(n,t,r)},On.setWith=function(n,t,r,e){return e=typeof e=="function"?e:F,
|
||||
null==n?n:pr(n,t,r,e)},On.shuffle=function(n){return(af(n)?ft:_r)(n)},On.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&typeof r!="number"&&ze(n,t,r)?(t=0,r=e):(t=null==t?0:Ou(t),r=r===F?e:Ou(r)),vr(n,t,r)):[]},On.sortBy=Ho,On.sortedUniq=function(n){return n&&n.length?br(n):[]},On.sortedUniqBy=function(n,t){return n&&n.length?br(n,je(t,2)):[]},On.split=function(n,t,r){return r&&typeof r!="number"&&ze(n,t,r)&&(t=r=F),r=r===F?4294967295:r>>>0,r?(n=zu(n))&&(typeof t=="string"||null!=t&&!_f(t))&&(t=jr(t),
|
||||
!t&&Bn.test(n))?zr($(n),0,r):n.split(t,r):[]},On.spread=function(n,t){if(typeof n!="function")throw new ei("Expected a function");return t=null==t?0:Di(Ou(t),0),lr(function(e){var u=e[t];return e=zr(e,0,t),u&&s(e,u),r(n,this,e)})},On.tail=function(n){var t=null==n?0:n.length;return t?vr(n,1,t):[]},On.take=function(n,t,r){return n&&n.length?(t=r||t===F?1:Ou(t),vr(n,0,0>t?0:t)):[]},On.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===F?1:Ou(t),t=e-t,vr(n,0>t?0:t,e)):[]},On.takeRightWhile=function(n,t){
|
||||
return n&&n.length?Ar(n,je(t,3),false,true):[]},On.takeWhile=function(n,t){return n&&n.length?Ar(n,je(t,3)):[]},On.tap=function(n,t){return t(n),n},On.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ei("Expected a function");return bu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),au(n,t,{leading:e,maxWait:t,trailing:u})},On.thru=nu,On.toArray=ku,On.toPairs=Bf,On.toPairsIn=Lf,On.toPath=function(n){return af(n)?l(n,$e):Au(n)?[n]:Mr(mo(zu(n)))},On.toPlainObject=Ru,
|
||||
On.transform=function(n,t,r){var e=af(n),i=e||sf(n)||gf(n);if(t=je(t,4),null==r){var o=n&&n.constructor;r=i?e?new o:[]:bu(n)&&gu(o)?io(bi(n)):{}}return(i?u:Et)(n,function(n,e,u){return t(r,n,e,u)}),r},On.unary=function(n){return iu(n,1)},On.union=Wo,On.unionBy=Bo,On.unionWith=Lo,On.uniq=function(n){return n&&n.length?wr(n):[]},On.uniqBy=function(n,t){return n&&n.length?wr(n,je(t,2)):[]},On.uniqWith=function(n,t){return t=typeof t=="function"?t:F,n&&n.length?wr(n,F,t):[]},On.unset=function(n,t){return null==n||mr(n,t);
|
||||
},On.unzip=Ye,On.unzipWith=Qe,On.update=function(n,t,r){return null==n?n:pr(n,t,Ir(r)(It(n,t)),void 0)},On.updateWith=function(n,t,r,e){return e=typeof e=="function"?e:F,null!=n&&(n=pr(n,t,Ir(r)(It(n,t)),e)),n},On.values=Du,On.valuesIn=function(n){return null==n?[]:I(n,Uu(n))},On.without=Uo,On.words=$u,On.wrap=function(n,t){return rf(Ir(t),n)},On.xor=Co,On.xorBy=Do,On.xorWith=Mo,On.zip=To,On.zipObject=function(n,t){return Or(n||[],t||[],at)},On.zipObjectDeep=function(n,t){return Or(n||[],t||[],pr);
|
||||
},On.zipWith=$o,On.entries=Bf,On.entriesIn=Lf,On.extend=xf,On.extendWith=jf,Zu(On,On),On.add=nc,On.attempt=Pf,On.camelCase=Uf,On.capitalize=Mu,On.ceil=tc,On.clamp=function(n,t,r){return r===F&&(r=t,t=F),r!==F&&(r=Iu(r),r=r===r?r:0),t!==F&&(t=Iu(t),t=t===t?t:0),gt(Iu(n),t,r)},On.clone=function(n){return dt(n,4)},On.cloneDeep=function(n){return dt(n,5)},On.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:F,dt(n,5,t)},On.cloneWith=function(n,t){return t=typeof t=="function"?t:F,dt(n,4,t)},
|
||||
On.conformsTo=function(n,t){return null==t||bt(n,t,Lu(t))},On.deburr=Tu,On.defaultTo=function(n,t){return null==n||n!==n?t:n},On.divide=rc,On.endsWith=function(n,t,r){n=zu(n),t=jr(t);var e=n.length,e=r=r===F?e:gt(Ou(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},On.eq=hu,On.escape=function(n){return(n=zu(n))&&Y.test(n)?n.replace(H,et):n},On.escapeRegExp=function(n){return(n=zu(n))&&fn.test(n)?n.replace(on,"\\$&"):n},On.every=function(n,t,r){var e=af(n)?o:wt;return r&&ze(n,t,r)&&(t=F),e(n,je(t,3));
|
||||
},On.find=Po,On.findIndex=Ze,On.findKey=function(n,t){return v(n,je(t,3),Et)},On.findLast=Zo,On.findLastIndex=qe,On.findLastKey=function(n,t){return v(n,je(t,3),Ot)},On.floor=ec,On.forEach=ru,On.forEachRight=eu,On.forIn=function(n,t){return null==n?n:co(n,je(t,3),Uu)},On.forInRight=function(n,t){return null==n?n:ao(n,je(t,3),Uu)},On.forOwn=function(n,t){return n&&Et(n,je(t,3))},On.forOwnRight=function(n,t){return n&&Ot(n,je(t,3))},On.get=Wu,On.gt=of,On.gte=ff,On.has=function(n,t){return null!=n&&ke(n,t,Bt);
|
||||
},On.hasIn=Bu,On.head=Ke,On.identity=Nu,On.includes=function(n,t,r,e){return n=pu(n)?n:Du(n),r=r&&!e?Ou(r):0,e=n.length,0>r&&(r=Di(e+r,0)),mu(n)?r<=e&&-1<n.indexOf(t,r):!!e&&-1<d(n,t,r)},On.indexOf=function(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Ou(r),0>r&&(r=Di(e+r,0)),d(n,t,r)):-1},On.inRange=function(n,t,r){return t=Eu(t),r===F?(r=t,t=0):r=Eu(r),n=Iu(n),n>=Mi(t,r)&&n<Di(t,r)},On.invoke=Sf,On.isArguments=cf,On.isArray=af,On.isArrayBuffer=lf,On.isArrayLike=pu,On.isArrayLikeObject=_u,
|
||||
On.isBoolean=function(n){return true===n||false===n||xu(n)&&"[object Boolean]"==zt(n)},On.isBuffer=sf,On.isDate=hf,On.isElement=function(n){return xu(n)&&1===n.nodeType&&!wu(n)},On.isEmpty=function(n){if(null==n)return true;if(pu(n)&&(af(n)||typeof n=="string"||typeof n.splice=="function"||sf(n)||gf(n)||cf(n)))return!n.length;var t=yo(n);if("[object Map]"==t||"[object Set]"==t)return!n.size;if(Le(n))return!Ht(n).length;for(var r in n)if(ci.call(n,r))return false;return true},On.isEqual=function(n,t){return Ft(n,t);
|
||||
},On.isEqualWith=function(n,t,r){var e=(r=typeof r=="function"?r:F)?r(n,t):F;return e===F?Ft(n,t,F,r):!!e},On.isError=vu,On.isFinite=function(n){return typeof n=="number"&&Li(n)},On.isFunction=gu,On.isInteger=du,On.isLength=yu,On.isMap=pf,On.isMatch=function(n,t){return n===t||Pt(n,t,me(t))},On.isMatchWith=function(n,t,r){return r=typeof r=="function"?r:F,Pt(n,t,me(t),r)},On.isNaN=function(n){return ju(n)&&n!=+n},On.isNative=function(n){if(bo(n))throw new Yu("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");
|
||||
return Zt(n)},On.isNil=function(n){return null==n},On.isNull=function(n){return null===n},On.isNumber=ju,On.isObject=bu,On.isObjectLike=xu,On.isPlainObject=wu,On.isRegExp=_f,On.isSafeInteger=function(n){return du(n)&&-9007199254740991<=n&&9007199254740991>=n},On.isSet=vf,On.isString=mu,On.isSymbol=Au,On.isTypedArray=gf,On.isUndefined=function(n){return n===F},On.isWeakMap=function(n){return xu(n)&&"[object WeakMap]"==yo(n)},On.isWeakSet=function(n){return xu(n)&&"[object WeakSet]"==zt(n)},On.join=function(n,t){
|
||||
return null==n?"":Ui.call(n,t)},On.kebabCase=Cf,On.last=Ge,On.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==F&&(u=Ou(r),u=0>u?Di(e+u,0):Mi(u,e-1)),t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=g(n,b,u,true);return n},On.lowerCase=Df,On.lowerFirst=Mf,On.lt=df,On.lte=yf,On.max=function(n){return n&&n.length?mt(n,Nu,Wt):F},On.maxBy=function(n,t){return n&&n.length?mt(n,je(t,2),Wt):F},On.mean=function(n){return x(n,Nu)},On.meanBy=function(n,t){return x(n,je(t,2))},On.min=function(n){
|
||||
return n&&n.length?mt(n,Nu,Jt):F},On.minBy=function(n,t){return n&&n.length?mt(n,je(t,2),Jt):F},On.stubArray=Ku,On.stubFalse=Gu,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return true},On.multiply=uc,On.nth=function(n,t){return n&&n.length?tr(n,Ou(t)):F},On.noConflict=function(){return Zn._===this&&(Zn._=pi),this},On.noop=qu,On.now=Jo,On.pad=function(n,t,r){n=zu(n);var e=(t=Ou(t))?T(n):0;return!t||e>=t?n:(t=(t-e)/2,ee(zi(t),r)+n+ee(Ri(t),r))},On.padEnd=function(n,t,r){
|
||||
n=zu(n);var e=(t=Ou(t))?T(n):0;return t&&e<t?n+ee(t-e,r):n},On.padStart=function(n,t,r){n=zu(n);var e=(t=Ou(t))?T(n):0;return t&&e<t?ee(t-e,r)+n:n},On.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),$i(zu(n).replace(an,""),t||0)},On.random=function(n,t,r){if(r&&typeof r!="boolean"&&ze(n,t,r)&&(t=r=F),r===F&&(typeof t=="boolean"?(r=t,t=F):typeof n=="boolean"&&(r=n,n=F)),n===F&&t===F?(n=0,t=1):(n=Eu(n),t===F?(t=n,n=0):t=Eu(t)),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Fi(),Mi(n+r*(t-n+$n("1e-"+((r+"").length-1))),t)):cr(n,t);
|
||||
},On.reduce=function(n,t,r){var e=af(n)?h:m,u=3>arguments.length;return e(n,je(t,4),r,u,oo)},On.reduceRight=function(n,t,r){var e=af(n)?p:m,u=3>arguments.length;return e(n,je(t,4),r,u,fo)},On.repeat=function(n,t,r){return t=(r?ze(n,t,r):t===F)?1:Ou(t),ar(zu(n),t)},On.replace=function(){var n=arguments,t=zu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},On.result=function(n,t,r){t=Rr(t,n);var e=-1,u=t.length;for(u||(u=1,n=F);++e<u;){var i=null==n?F:n[$e(t[e])];i===F&&(e=u,i=r),n=gu(i)?i.call(n):i;
|
||||
}return n},On.round=ic,On.runInContext=w,On.sample=function(n){return(af(n)?tt:sr)(n)},On.size=function(n){if(null==n)return 0;if(pu(n))return mu(n)?T(n):n.length;var t=yo(n);return"[object Map]"==t||"[object Set]"==t?n.size:Ht(n).length},On.snakeCase=Tf,On.some=function(n,t,r){var e=af(n)?_:gr;return r&&ze(n,t,r)&&(t=F),e(n,je(t,3))},On.sortedIndex=function(n,t){return dr(n,t)},On.sortedIndexBy=function(n,t,r){return yr(n,t,je(r,2))},On.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){
|
||||
var e=dr(n,t);if(e<r&&hu(n[e],t))return e}return-1},On.sortedLastIndex=function(n,t){return dr(n,t,true)},On.sortedLastIndexBy=function(n,t,r){return yr(n,t,je(r,2),true)},On.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=dr(n,t,true)-1;if(hu(n[r],t))return r}return-1},On.startCase=$f,On.startsWith=function(n,t,r){return n=zu(n),r=null==r?0:gt(Ou(r),0,n.length),t=jr(t),n.slice(r,r+t.length)==t},On.subtract=oc,On.sum=function(n){return n&&n.length?k(n,Nu):0},On.sumBy=function(n,t){return n&&n.length?k(n,je(t,2)):0;
|
||||
},On.template=function(n,t,r){var e=On.templateSettings;r&&ze(n,t,r)&&(t=F),n=zu(n),t=jf({},t,e,se),r=jf({},t.imports,e.imports,se);var u,i,o=Lu(r),f=I(r,o),c=0;r=t.interpolate||An;var a="__p+='";r=ti((t.escape||An).source+"|"+r.source+"|"+(r===nn?gn:An).source+"|"+(t.evaluate||An).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,o,f,l){return e||(e=o),a+=n.slice(c,l).replace(kn,B),r&&(u=true,a+="'+__e("+r+")+'"),f&&(i=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=(i?a.replace(q,""):a).replace(V,"$1").replace(K,"$1;"),a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=Pf(function(){return Qu(o,l+"return "+a).apply(F,f)}),t.source=a,vu(t))throw t;return t},On.times=function(n,t){if(n=Ou(n),1>n||9007199254740991<n)return[];
|
||||
var r=4294967295,e=Mi(n,4294967295);for(t=je(t),n-=4294967295,e=E(e,t);++r<n;)t(r);return e},On.toFinite=Eu,On.toInteger=Ou,On.toLength=Su,On.toLower=function(n){return zu(n).toLowerCase()},On.toNumber=Iu,On.toSafeInteger=function(n){return n?gt(Ou(n),-9007199254740991,9007199254740991):0===n?n:0},On.toString=zu,On.toUpper=function(n){return zu(n).toUpperCase()},On.trim=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(cn,""):n&&(t=jr(t))?(n=$(n),r=$(t),t=z(n,r),r=W(n,r)+1,zr(n,t,r).join("")):n;
|
||||
},On.trimEnd=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(ln,""):n&&(t=jr(t))?(n=$(n),t=W(n,$(t))+1,zr(n,0,t).join("")):n},On.trimStart=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(an,""):n&&(t=jr(t))?(n=$(n),t=z(n,$(t)),zr(n,t).join("")):n},On.truncate=function(n,t){var r=30,e="...";if(bu(t))var u="separator"in t?t.separator:u,r="length"in t?Ou(t.length):r,e="omission"in t?jr(t.omission):e;n=zu(n);var i=n.length;if(Bn.test(n))var o=$(n),i=o.length;if(r>=i)return n;if(i=r-T(e),1>i)return e;
|
||||
if(r=o?zr(o,0,i).join(""):n.slice(0,i),u===F)return r+e;if(o&&(i+=r.length-i),_f(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=ti(u.source,zu(dn.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===F?i:c)}}else n.indexOf(jr(u),i)!=i&&(u=r.lastIndexOf(u),-1<u&&(r=r.slice(0,u)));return r+e},On.unescape=function(n){return(n=zu(n))&&J.test(n)?n.replace(G,ut):n},On.uniqueId=function(n){var t=++ai;return zu(n)+t},On.upperCase=Ff,On.upperFirst=Nf,On.each=ru,On.eachRight=eu,On.first=Ke,
|
||||
Zu(On,function(){var n={};return Et(On,function(t,r){ci.call(On.prototype,r)||(n[r]=t)}),n}(),{chain:false}),On.VERSION="4.17.4",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){On[n].placeholder=On}),u(["drop","take"],function(n,t){Mn.prototype[n]=function(r){r=r===F?1:Di(Ou(r),0);var e=this.__filtered__&&!t?new Mn(this):this.clone();return e.__filtered__?e.__takeCount__=Mi(r,e.__takeCount__):e.__views__.push({size:Mi(r,4294967295),type:n+(0>e.__dir__?"Right":"")}),e},Mn.prototype[n+"Right"]=function(t){
|
||||
return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Mn.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:je(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");Mn.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Mn.prototype[n]=function(){return this.__filtered__?new Mn(this):this[r](1);
|
||||
}}),Mn.prototype.compact=function(){return this.filter(Nu)},Mn.prototype.find=function(n){return this.filter(n).head()},Mn.prototype.findLast=function(n){return this.reverse().find(n)},Mn.prototype.invokeMap=lr(function(n,t){return typeof n=="function"?new Mn(this):this.map(function(r){return Dt(r,n,t)})}),Mn.prototype.reject=function(n){return this.filter(su(je(n)))},Mn.prototype.slice=function(n,t){n=Ou(n);var r=this;return r.__filtered__&&(0<n||0>t)?new Mn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),
|
||||
t!==F&&(t=Ou(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Mn.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Mn.prototype.toArray=function(){return this.take(4294967295)},Et(Mn.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=On[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(On.prototype[t]=function(){function t(n){return n=u.apply(On,s([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Mn,a=f[0],l=c||af(o);
|
||||
l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=i&&!h,c=c&&!p;return!i&&l?(o=c?o:new Mn(this),o=n.apply(o,f),o.__actions__.push({func:nu,args:[t],thisArg:F}),new zn(o,h)):a&&c?n.apply(this,f):(o=this.thru(t),a?e?o.value()[0]:o.value():o)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=ui[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);On.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){
|
||||
var u=this.value();return t.apply(af(u)?u:[],n)}return this[r](function(r){return t.apply(af(r)?r:[],n)})}}),Et(Mn.prototype,function(n,t){var r=On[t];if(r){var e=r.name+"";(Ji[e]||(Ji[e]=[])).push({name:t,func:r})}}),Ji[Xr(F,2).name]=[{name:"wrapper",func:F}],Mn.prototype.clone=function(){var n=new Mn(this.__wrapped__);return n.__actions__=Mr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Mr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Mr(this.__views__),
|
||||
n},Mn.prototype.reverse=function(){if(this.__filtered__){var n=new Mn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Mn.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=af(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c<a;){var l=o[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=Mi(n,f+s);break;case"takeRight":f=Di(f,n-s)}}if(n={start:f,end:n},o=n.start,f=n.end,n=f-o,
|
||||
o=u?f:o-1,f=this.__iteratees__,c=f.length,a=0,l=Mi(n,this.__takeCount__),!e||!u&&i==n&&l==n)return kr(t,this.__actions__);e=[];n:for(;n--&&a<l;){for(o+=r,u=-1,i=t[o];++u<c;){var h=f[u],s=h.type,h=(0,h.iteratee)(i);if(2==s)i=h;else if(!h){if(1==s)continue n;break n}}e[a++]=i}return e},On.prototype.at=Fo,On.prototype.chain=function(){return Xe(this)},On.prototype.commit=function(){return new zn(this.value(),this.__chain__)},On.prototype.next=function(){this.__values__===F&&(this.__values__=ku(this.value()));
|
||||
var n=this.__index__>=this.__values__.length;return{done:n,value:n?F:this.__values__[this.__index__++]}},On.prototype.plant=function(n){for(var t,r=this;r instanceof Sn;){var e=Pe(r);e.__index__=0,e.__values__=F,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},On.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Mn?(this.__actions__.length&&(n=new Mn(this)),n=n.reverse(),n.__actions__.push({func:nu,args:[Je],thisArg:F}),new zn(n,this.__chain__)):this.thru(Je);
|
||||
},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return kr(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Ai&&(On.prototype[Ai]=tu),On}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Zn._=it, define(function(){return it})):Vn?((Vn.exports=it)._=it,qn._=it):Zn._=it}).call(this);
|
||||
430
dist/mapping.fp.js
vendored
430
dist/mapping.fp.js
vendored
@@ -1,430 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["mapping"] = factory();
|
||||
else
|
||||
root["mapping"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'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', 'rangeStep', 'rangeStepRight',
|
||||
'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],
|
||||
'reduceRight': [1, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInAllWith': [1, 0],
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignAllWith': [1, 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, 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],
|
||||
'rangeStep': [1, 2, 0],
|
||||
'rangeStepRight': [1, 2, 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': { 'start': 0 },
|
||||
'assignInAll': { 'start': 0 },
|
||||
'assignInAllWith': { 'start': 0 },
|
||||
'defaultsAll': { 'start': 0 },
|
||||
'defaultsDeepAll': { 'start': 0 },
|
||||
'invokeArgs': { 'start': 2 },
|
||||
'invokeArgsMap': { 'start': 2 },
|
||||
'mergeAll': { 'start': 0 },
|
||||
'mergeAllWith': { 'start': 0 },
|
||||
'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
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignAll': true,
|
||||
'assignAllWith': true,
|
||||
'assignIn': true,
|
||||
'assignInAll': true,
|
||||
'assignInAllWith': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsAll': true,
|
||||
'defaultsDeep': true,
|
||||
'defaultsDeepAll': true,
|
||||
'merge': 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',
|
||||
'rangeStep': 'range',
|
||||
'rangeStepRight': 'rangeRight',
|
||||
'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
|
||||
};
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
11304
doc/README.md
11304
doc/README.md
File diff suppressed because it is too large
Load Diff
@@ -1,568 +0,0 @@
|
||||
var mapping = require('./_mapping'),
|
||||
fallbackHolder = require('./placeholder');
|
||||
|
||||
/** Built-in value reference. */
|
||||
var push = Array.prototype.push;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A specialized version of `_.spread` which flattens the spread array into
|
||||
* the arguments of the invoked `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to spread arguments over.
|
||||
* @param {number} start The start position of the spread.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function flatSpread(func, start) {
|
||||
return function() {
|
||||
var length = arguments.length,
|
||||
lastIndex = length - 1,
|
||||
args = Array(length);
|
||||
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var array = args[start],
|
||||
otherArgs = args.slice(0, start);
|
||||
|
||||
if (array) {
|
||||
push.apply(otherArgs, array);
|
||||
}
|
||||
if (start != lastIndex) {
|
||||
push.apply(otherArgs, args.slice(start + 1));
|
||||
}
|
||||
return func.apply(this, otherArgs);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||
* @param {boolean} [options.curry=true] Specify currying.
|
||||
* @param {boolean} [options.fixed=true] Specify fixed arity.
|
||||
* @param {boolean} [options.immutable=true] Specify immutable operations.
|
||||
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function baseConvert(util, name, func, options) {
|
||||
var setPlaceholder,
|
||||
isLib = typeof name == 'function',
|
||||
isObj = name === Object(name);
|
||||
|
||||
if (isObj) {
|
||||
options = func;
|
||||
func = name;
|
||||
name = undefined;
|
||||
}
|
||||
if (func == null) {
|
||||
throw new TypeError;
|
||||
}
|
||||
options || (options = {});
|
||||
|
||||
var config = {
|
||||
'cap': 'cap' in options ? options.cap : true,
|
||||
'curry': 'curry' in options ? options.curry : true,
|
||||
'fixed': 'fixed' in options ? options.fixed : true,
|
||||
'immutable': 'immutable' in options ? options.immutable : true,
|
||||
'rearg': 'rearg' in options ? options.rearg : true
|
||||
};
|
||||
|
||||
var forceCurry = ('curry' in options) && options.curry,
|
||||
forceFixed = ('fixed' in options) && options.fixed,
|
||||
forceRearg = ('rearg' in options) && options.rearg,
|
||||
placeholder = isLib ? func : fallbackHolder,
|
||||
pristine = isLib ? func.runInContext() : undefined;
|
||||
|
||||
var helpers = isLib ? func : {
|
||||
'ary': util.ary,
|
||||
'assign': util.assign,
|
||||
'clone': util.clone,
|
||||
'curry': util.curry,
|
||||
'forEach': util.forEach,
|
||||
'isArray': util.isArray,
|
||||
'isFunction': util.isFunction,
|
||||
'iteratee': util.iteratee,
|
||||
'keys': util.keys,
|
||||
'rearg': util.rearg,
|
||||
'toInteger': util.toInteger,
|
||||
'toPath': util.toPath
|
||||
};
|
||||
|
||||
var ary = helpers.ary,
|
||||
assign = helpers.assign,
|
||||
clone = helpers.clone,
|
||||
curry = helpers.curry,
|
||||
each = helpers.forEach,
|
||||
isArray = helpers.isArray,
|
||||
isFunction = helpers.isFunction,
|
||||
keys = helpers.keys,
|
||||
rearg = helpers.rearg,
|
||||
toInteger = helpers.toInteger,
|
||||
toPath = helpers.toPath;
|
||||
|
||||
var aryMethodKeys = keys(mapping.aryMethod);
|
||||
|
||||
var wrappers = {
|
||||
'castArray': function(castArray) {
|
||||
return function() {
|
||||
var value = arguments[0];
|
||||
return isArray(value)
|
||||
? castArray(cloneArray(value))
|
||||
: castArray.apply(undefined, arguments);
|
||||
};
|
||||
},
|
||||
'iteratee': function(iteratee) {
|
||||
return function() {
|
||||
var func = arguments[0],
|
||||
arity = arguments[1],
|
||||
result = iteratee(func, arity),
|
||||
length = result.length;
|
||||
|
||||
if (config.cap && typeof arity == 'number') {
|
||||
arity = arity > 2 ? (arity - 2) : 1;
|
||||
return (length && length <= arity) ? result : baseAry(result, arity);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
},
|
||||
'mixin': function(mixin) {
|
||||
return function(source) {
|
||||
var func = this;
|
||||
if (!isFunction(func)) {
|
||||
return mixin(func, Object(source));
|
||||
}
|
||||
var pairs = [];
|
||||
each(keys(source), function(key) {
|
||||
if (isFunction(source[key])) {
|
||||
pairs.push([key, func.prototype[key]]);
|
||||
}
|
||||
});
|
||||
|
||||
mixin(func, Object(source));
|
||||
|
||||
each(pairs, function(pair) {
|
||||
var value = pair[1];
|
||||
if (isFunction(value)) {
|
||||
func.prototype[pair[0]] = value;
|
||||
} else {
|
||||
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), options);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Casts `func` to a function with an arity capped iteratee if needed.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to inspect.
|
||||
* @param {Function} func The function to inspect.
|
||||
* @returns {Function} Returns the cast function.
|
||||
*/
|
||||
function castCap(name, func) {
|
||||
if (config.cap) {
|
||||
var indexes = mapping.iterateeRearg[name];
|
||||
if (indexes) {
|
||||
return iterateeRearg(func, indexes);
|
||||
}
|
||||
var n = !isLib && mapping.iterateeAry[name];
|
||||
if (n) {
|
||||
return iterateeAry(func, n);
|
||||
}
|
||||
}
|
||||
return func;
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts `func` to a curried function if needed.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to inspect.
|
||||
* @param {Function} func The function to inspect.
|
||||
* @param {number} n The arity of `func`.
|
||||
* @returns {Function} Returns the cast function.
|
||||
*/
|
||||
function castCurry(name, func, n) {
|
||||
return (forceCurry || (config.curry && n > 1))
|
||||
? curry(func, n)
|
||||
: func;
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts `func` to a fixed arity function if needed.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to inspect.
|
||||
* @param {Function} func The function to inspect.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the cast function.
|
||||
*/
|
||||
function castFixed(name, func, n) {
|
||||
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||
var data = mapping.methodSpread[name],
|
||||
start = data && data.start;
|
||||
|
||||
return start === undefined ? ary(func, n) : flatSpread(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 realName = mapping.aliasToReal[name] || name,
|
||||
methodName = mapping.remap[realName] || realName,
|
||||
oldOptions = options;
|
||||
|
||||
return function(options) {
|
||||
var newUtil = isLib ? pristine : helpers,
|
||||
newFunc = isLib ? pristine[methodName] : func,
|
||||
newOptions = assign(assign({}, oldOptions), options);
|
||||
|
||||
return baseConvert(newUtil, realName, 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) {
|
||||
var result,
|
||||
realName = mapping.aliasToReal[name] || name,
|
||||
wrapped = func,
|
||||
wrapper = wrappers[realName];
|
||||
|
||||
if (wrapper) {
|
||||
wrapped = wrapper(func);
|
||||
}
|
||||
else if (config.immutable) {
|
||||
if (mapping.mutate.array[realName]) {
|
||||
wrapped = wrapImmutable(func, cloneArray);
|
||||
}
|
||||
else if (mapping.mutate.object[realName]) {
|
||||
wrapped = wrapImmutable(func, createCloner(func));
|
||||
}
|
||||
else if (mapping.mutate.set[realName]) {
|
||||
wrapped = wrapImmutable(func, cloneByPath);
|
||||
}
|
||||
}
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(otherName) {
|
||||
if (realName == otherName) {
|
||||
var data = mapping.methodSpread[realName],
|
||||
afterRearg = data && data.afterRearg;
|
||||
|
||||
result = afterRearg
|
||||
? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey)
|
||||
: castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
|
||||
|
||||
result = castCap(realName, result);
|
||||
result = castCurry(realName, result, aryKey);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
result || (result = wrapped);
|
||||
if (result == func) {
|
||||
result = forceCurry ? curry(result, 1) : function() {
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
result.convert = createConverter(realName, func);
|
||||
if (mapping.placeholder[realName]) {
|
||||
setPlaceholder = true;
|
||||
result.placeholder = func.placeholder = placeholder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (!isObj) {
|
||||
return wrap(name, func);
|
||||
}
|
||||
var _ = func;
|
||||
|
||||
// Convert methods by ary cap.
|
||||
var pairs = [];
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(key) {
|
||||
var func = _[mapping.remap[key] || key];
|
||||
if (func) {
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Convert remaining methods.
|
||||
each(keys(_), function(key) {
|
||||
var func = _[key];
|
||||
if (typeof func == 'function') {
|
||||
var length = pairs.length;
|
||||
while (length--) {
|
||||
if (pairs[length][0] == key) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
func.convert = createConverter(key, func);
|
||||
pairs.push([key, func]);
|
||||
}
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
_.convert = convertLib;
|
||||
if (setPlaceholder) {
|
||||
_.placeholder = placeholder;
|
||||
}
|
||||
// Assign aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.realToAlias[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
module.exports = baseConvert;
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert');
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Function} lodash The lodash function to convert.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function browserConvert(lodash, options) {
|
||||
return baseConvert(lodash, lodash, options);
|
||||
}
|
||||
|
||||
if (typeof _ == 'function' && typeof _.runInContext == 'function') {
|
||||
_ = browserConvert(_.runInContext());
|
||||
}
|
||||
module.exports = browserConvert;
|
||||
368
fp/_mapping.js
368
fp/_mapping.js
@@ -1,368 +0,0 @@
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// 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', 'rangeStep', 'rangeStepRight',
|
||||
'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],
|
||||
'reduceRight': [1, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInAllWith': [1, 0],
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignAllWith': [1, 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, 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],
|
||||
'rangeStep': [1, 2, 0],
|
||||
'rangeStepRight': [1, 2, 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': { 'start': 0 },
|
||||
'assignInAll': { 'start': 0 },
|
||||
'assignInAllWith': { 'start': 0 },
|
||||
'defaultsAll': { 'start': 0 },
|
||||
'defaultsDeepAll': { 'start': 0 },
|
||||
'invokeArgs': { 'start': 2 },
|
||||
'invokeArgsMap': { 'start': 2 },
|
||||
'mergeAll': { 'start': 0 },
|
||||
'mergeAllWith': { 'start': 0 },
|
||||
'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
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignAll': true,
|
||||
'assignAllWith': true,
|
||||
'assignIn': true,
|
||||
'assignInAll': true,
|
||||
'assignInAllWith': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsAll': true,
|
||||
'defaultsDeep': true,
|
||||
'defaultsDeepAll': true,
|
||||
'merge': 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',
|
||||
'rangeStep': 'range',
|
||||
'rangeStepRight': 'rangeRight',
|
||||
'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
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* The default argument placeholder value for methods.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = {};
|
||||
@@ -1,71 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs-extra');
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
|
||||
const 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), (result, filePath) => {
|
||||
const 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,
|
||||
globTemplate,
|
||||
min,
|
||||
write
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _mapping = require('../../fp/_mapping');
|
||||
const util = require('./util');
|
||||
const Hash = util.Hash;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
module.exports = new Hash(_mapping);
|
||||
@@ -1,39 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs-extra');
|
||||
const uglify = require('uglify-js');
|
||||
|
||||
const uglifyOptions = require('./uglify.options');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* 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 = destPath;
|
||||
destPath = undefined;
|
||||
}
|
||||
if (!destPath) {
|
||||
destPath = srcPath.replace(/(?=\.js$)/, '.min');
|
||||
}
|
||||
const output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
|
||||
fs.writeFile(destPath, output.code, 'utf-8', callback);
|
||||
}
|
||||
|
||||
module.exports = minify;
|
||||
@@ -1,22 +0,0 @@
|
||||
'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': {
|
||||
'collapse_vars': true,
|
||||
'negate_iife': false,
|
||||
'pure_getters': true,
|
||||
'unsafe': true,
|
||||
'warnings': false
|
||||
},
|
||||
'output': {
|
||||
'ascii_only': true,
|
||||
'comments': /@license/,
|
||||
'max_line_len': 500
|
||||
}
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = 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, (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,
|
||||
pitch
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const async = require('async');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
|
||||
const file = require('../common/file');
|
||||
const util = require('../common/util');
|
||||
|
||||
const basePath = path.join(__dirname, '..', '..');
|
||||
const distPath = path.join(basePath, 'dist');
|
||||
const fpPath = path.join(basePath, 'fp');
|
||||
const filename = 'lodash.fp.js';
|
||||
|
||||
const fpConfig = {
|
||||
'entry': path.join(fpPath, '_convertBrowser.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': filename,
|
||||
'library': 'fp',
|
||||
'libraryTarget': 'umd'
|
||||
},
|
||||
'plugins': [
|
||||
new webpack.optimize.OccurenceOrderPlugin,
|
||||
new webpack.optimize.DedupePlugin
|
||||
]
|
||||
};
|
||||
|
||||
const mappingConfig = {
|
||||
'entry': path.join(fpPath, '_mapping.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': 'mapping.fp.js',
|
||||
'library': 'mapping',
|
||||
'libraryTarget': 'umd'
|
||||
}
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,78 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
const file = require('../common/file');
|
||||
const mapping = require('../common/mapping');
|
||||
const util = require('../common/util');
|
||||
|
||||
const templatePath = path.join(__dirname, 'template/doc');
|
||||
const template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
const argNames = ['a', 'b', 'c', 'd'];
|
||||
|
||||
const templateData = {
|
||||
mapping,
|
||||
toArgOrder,
|
||||
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) {
|
||||
const reordered = [];
|
||||
_.each(indexes, (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) {
|
||||
let chunks = _.chunk(funcNames.slice().sort(), 5);
|
||||
let lastChunk = _.last(chunks);
|
||||
const lastName = lastChunk ? lastChunk.pop() : undefined;
|
||||
|
||||
chunks = _.reject(chunks, _.isEmpty);
|
||||
lastChunk = _.last(chunks);
|
||||
|
||||
let result = '`' + _.map(chunks, chunk => chunk.join('`, `') + '`').join(',\n`');
|
||||
if (lastName == null) {
|
||||
return result;
|
||||
}
|
||||
if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
|
||||
result += ',';
|
||||
}
|
||||
result += ' &';
|
||||
result += _.size(lastChunk) < 5 ? ' ' : '\n';
|
||||
return result + '`' + lastName + '`';
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* 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));
|
||||
@@ -1,150 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const async = require('async');
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
|
||||
const file = require('../common/file');
|
||||
const mapping = require('../common/mapping');
|
||||
const util = require('../common/util');
|
||||
|
||||
const templatePath = path.join(__dirname, 'template/modules');
|
||||
const template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
const aryMethods = _.union(
|
||||
mapping.aryMethod[1],
|
||||
mapping.aryMethod[2],
|
||||
mapping.aryMethod[3],
|
||||
mapping.aryMethod[4]
|
||||
);
|
||||
|
||||
const categories = [
|
||||
'array',
|
||||
'collection',
|
||||
'date',
|
||||
'function',
|
||||
'lang',
|
||||
'math',
|
||||
'number',
|
||||
'object',
|
||||
'seq',
|
||||
'string',
|
||||
'util'
|
||||
];
|
||||
|
||||
const 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) {
|
||||
const 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);
|
||||
|
||||
const fpPath = path.join(target, 'fp');
|
||||
|
||||
// Glob existing lodash module paths.
|
||||
const modulePaths = glob.sync(path.join(target, '*.js'), {
|
||||
'nodir': true,
|
||||
'ignore': ignored.map(filename => {
|
||||
return path.join(target, filename);
|
||||
})
|
||||
});
|
||||
|
||||
// Add FP alias and remapped module paths.
|
||||
_.each([mapping.aliasToReal, mapping.remap], data => {
|
||||
_.forOwn(data, (realName, alias) => {
|
||||
const modulePath = path.join(target, alias + '.js');
|
||||
if (!_.includes(modulePaths, modulePath)) {
|
||||
modulePaths.push(modulePath);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const actions = modulePaths.map(modulePath => {
|
||||
const 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));
|
||||
@@ -1,228 +0,0 @@
|
||||
## 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='https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.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 capped to 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 as their last or only argument:<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), methodName => {
|
||||
const orders = mapping.methodRearg[methodName];
|
||||
return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
|
||||
}).join('\n') %>
|
||||
|
||||
The iteratee of `reduceRight` has an argument order of: `(b, a)`
|
||||
|
||||
#### New Methods
|
||||
|
||||
Not all variadic methods have corresponding new method variants. Feel free to
|
||||
[request](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md#feature-requests)
|
||||
any additions.
|
||||
|
||||
Methods created to accommodate Lodash’s variadic methods:<br>
|
||||
<%= toFuncList(_.keys(mapping.remap)) %>
|
||||
|
||||
#### Aliases
|
||||
|
||||
There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
|
||||
<%= _.map(_.keys(mapping.aliasToReal).sort(), alias => {
|
||||
const realName = mapping.aliasToReal[alias];
|
||||
return ' * `_.' + alias + '` is an alias of `_.' + realName + '`';
|
||||
}).join('\n') %>
|
||||
|
||||
## Placeholders
|
||||
|
||||
The placeholder argument, which defaults to `_`, may be used to fill in method
|
||||
arguments in a different order. Placeholders are filled by the first available
|
||||
arguments of the curried returned function.
|
||||
```js
|
||||
// The equivalent of `2 > 5`.
|
||||
_.gt(2)(5);
|
||||
// ➜ false
|
||||
|
||||
// The equivalent of `_.gt(5, 2)` or `5 > 2`.
|
||||
_.gt(_, 2)(5);
|
||||
// ➜ true
|
||||
```
|
||||
|
||||
## Chaining
|
||||
|
||||
The `lodash/fp` module **does not** convert chain sequence methods. See
|
||||
[Izaak Schroeder’s article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
|
||||
on using functional composition as an alternative to method chaining.
|
||||
|
||||
## Convert
|
||||
|
||||
Although `lodash/fp` & its method modules come pre-converted, there are times
|
||||
when you may want to customize the conversion. That’s when the `convert` method
|
||||
comes in handy.
|
||||
```js
|
||||
// Every option is `true` by default.
|
||||
var _fp = fp.convert({
|
||||
// Specify capping iteratee arguments.
|
||||
'cap': true,
|
||||
// Specify currying.
|
||||
'curry': true,
|
||||
// Specify fixed arity.
|
||||
'fixed': true,
|
||||
// Specify immutable operations.
|
||||
'immutable': true,
|
||||
// Specify rearranging arguments.
|
||||
'rearg': true
|
||||
});
|
||||
|
||||
// The `convert` method is available on each method too.
|
||||
var mapValuesWithKey = fp.mapValues.convert({ 'cap': false });
|
||||
|
||||
// Here’s an example of disabling iteratee argument caps to access the `key` param.
|
||||
mapValuesWithKey(function(value, key) {
|
||||
return key == 'a' ? -1 : value;
|
||||
})({ 'a': 1, 'b': 1 });
|
||||
// => { 'a': -1, 'b': 1 }
|
||||
```
|
||||
|
||||
Manual conversions are also possible with the `convert` module.
|
||||
```js
|
||||
var convert = require('lodash/fp/convert');
|
||||
|
||||
// Convert by name.
|
||||
var assign = convert('assign', require('lodash.assign'));
|
||||
|
||||
// Convert by object.
|
||||
var fp = convert({
|
||||
'assign': require('lodash.assign'),
|
||||
'chunk': require('lodash.chunk')
|
||||
});
|
||||
|
||||
// Convert by `lodash` instance.
|
||||
var fp = convert(lodash.runInContext());
|
||||
```
|
||||
|
||||
## Tooling
|
||||
|
||||
Use [eslint-plugin-lodash-fp](https://www.npmjs.com/package/eslint-plugin-lodash-fp)
|
||||
to help use `lodash/fp` more efficiently.
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
'cap': false,
|
||||
'curry': false,
|
||||
'fixed': false,
|
||||
'immutable': false,
|
||||
'rearg': false
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
'ary': require('../ary'),
|
||||
'assign': require('../_baseAssign'),
|
||||
'clone': require('../clone'),
|
||||
'curry': require('../curry'),
|
||||
'forEach': require('../_arrayEach'),
|
||||
'isArray': require('../isArray'),
|
||||
'isFunction': require('../isFunction'),
|
||||
'iteratee': require('../iteratee'),
|
||||
'keys': require('../_baseKeys'),
|
||||
'rearg': require('../rearg'),
|
||||
'toInteger': require('../toInteger'),
|
||||
'toPath': require('../toPath')
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('./<%= name %>');
|
||||
@@ -1,2 +0,0 @@
|
||||
var convert = require('./convert');
|
||||
module.exports = convert(require('../<%= name %>'));
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert'),
|
||||
util = require('./_util');
|
||||
|
||||
/**
|
||||
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied. If `name` is an object its methods
|
||||
* will be converted.
|
||||
*
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} [func] The function to wrap.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function convert(name, func, options) {
|
||||
return baseConvert(util, name, func, options);
|
||||
}
|
||||
|
||||
module.exports = convert;
|
||||
@@ -1,2 +0,0 @@
|
||||
var _ = require('./lodash.min').runInContext();
|
||||
module.exports = require('./fp/_baseConvert')(_, _);
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.get(mapping.remap, name, name) %>'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.get(mapping.remap, name, name) %>'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const async = require('async');
|
||||
const path = require('path');
|
||||
|
||||
const file = require('../common/file');
|
||||
const util = require('../common/util');
|
||||
|
||||
const basePath = path.join(__dirname, '..', '..');
|
||||
const distPath = path.join(basePath, 'dist');
|
||||
const filename = 'lodash.js';
|
||||
|
||||
const baseLodash = path.join(basePath, filename);
|
||||
const distLodash = path.join(distPath, filename);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,83 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const docdown = require('docdown');
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
const util = require('../common/util');
|
||||
|
||||
const basePath = path.join(__dirname, '..', '..');
|
||||
const docPath = path.join(basePath, 'doc');
|
||||
const readmePath = path.join(docPath, 'README.md');
|
||||
|
||||
const pkg = require('../../package.json');
|
||||
const version = pkg.version;
|
||||
|
||||
const 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('Ⓝ', '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) {
|
||||
const options = _.defaults({}, config.base, config[type]);
|
||||
const markdown = docdown(options);
|
||||
|
||||
fs.writeFile(readmePath, postprocess(markdown), util.pitch);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,34 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const async = require('async');
|
||||
const path = require('path');
|
||||
|
||||
const file = require('../common/file');
|
||||
const util = require('../common/util');
|
||||
|
||||
const basePath = path.join(__dirname, '..', '..');
|
||||
const distPath = path.join(basePath, 'dist');
|
||||
|
||||
const 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) {
|
||||
const actions = _.map(filePairs, pair =>
|
||||
file.copy(pair[0], path.join(target, pair[1])));
|
||||
|
||||
async.series(actions, util.pitch);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,224 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const cheerio = require('cheerio');
|
||||
const fs = require('fs');
|
||||
const marky = require('marky-markdown');
|
||||
const path = require('path');
|
||||
const util = require('../common/util');
|
||||
|
||||
const basePath = path.join(__dirname, '..', '..');
|
||||
const docPath = path.join(basePath, 'doc');
|
||||
const readmePath = path.join(docPath, 'README.md');
|
||||
|
||||
const highlights = {
|
||||
'html': [
|
||||
'string'
|
||||
],
|
||||
'js': [
|
||||
'comment',
|
||||
'console',
|
||||
'delimiter',
|
||||
'method',
|
||||
'modifier',
|
||||
'name',
|
||||
'numeric',
|
||||
'string',
|
||||
'support',
|
||||
'type'
|
||||
]
|
||||
};
|
||||
|
||||
const exts = _.keys(highlights);
|
||||
|
||||
/**
|
||||
* Converts Lodash method references into documentation links.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function autoLink($) {
|
||||
$('.doc-container code').each(function() {
|
||||
const $code = $(this);
|
||||
const html = $code.html();
|
||||
if (/^_\.\w+$/.test(html)) {
|
||||
const id = html.split('.')[1];
|
||||
$code.replaceWith(`<a href="#${ id }"><code>_.${ id }</code></a>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes horizontal rules from the document.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function removeHorizontalRules($) {
|
||||
$('hr').remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes marky-markdown specific ids and class names.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function removeMarkyAttributes($) {
|
||||
$('[id^="user-content-"]')
|
||||
.attr('class', null)
|
||||
.attr('id', null);
|
||||
|
||||
$(':header:not(h3) > a').each(function() {
|
||||
const $a = $(this);
|
||||
$a.replaceWith($a.html());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Renames "_" id and anchor references to "lodash".
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function renameLodashId($) {
|
||||
$('#_').attr('id', 'lodash');
|
||||
$('[href="#_"]').attr('href', '#lodash');
|
||||
}
|
||||
|
||||
/**
|
||||
* Repairs broken marky-markdown headers.
|
||||
* See https://github.com/npm/marky-markdown/issues/217 for more details.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function repairMarkyHeaders($) {
|
||||
$('p:empty + h3').prev().remove();
|
||||
|
||||
$('h3 ~ p:empty').each(function() {
|
||||
const $p = $(this);
|
||||
let node = this.prev;
|
||||
while ((node = node.prev) && node.name != 'h3' && node.name != 'p') {
|
||||
$p.prepend(node.next);
|
||||
}
|
||||
});
|
||||
|
||||
$('h3 code em').parent().each(function() {
|
||||
const $code = $(this);
|
||||
$code.html($code.html().replace(/<\/?em>/g, '_'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up highlights blocks by removing extraneous class names and elements.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} $ The Cheerio object.
|
||||
*/
|
||||
function tidyHighlights($) {
|
||||
$('.highlight').each(function() {
|
||||
let $spans;
|
||||
const $parent = $(this);
|
||||
const classes = $parent.find('.source,.text').first().attr('class').split(' ');
|
||||
const ext = _(classes).intersection(exts).last();
|
||||
|
||||
$parent.addClass(ext);
|
||||
|
||||
// Remove line indicators for single line snippets.
|
||||
$parent.children('pre').each(function() {
|
||||
const $divs = $(this).children('div');
|
||||
if ($divs.length == 1) {
|
||||
$divs.replaceWith($divs.html());
|
||||
}
|
||||
});
|
||||
// Remove extraneous class names.
|
||||
$parent.find('[class]').each(function() {
|
||||
const $element = $(this);
|
||||
const classes = $element.attr('class').split(' ');
|
||||
const attr = _(classes).intersection(highlights[ext]).join(' ');
|
||||
$element.attr('class', attr || null);
|
||||
});
|
||||
// Collapse nested comment highlights.
|
||||
$parent.find(`[class~="comment"]`).each(function() {
|
||||
const $element = $(this);
|
||||
$element.text($element.text().trim());
|
||||
});
|
||||
// Collapse nested string highlights.
|
||||
$parent.find(`[class~="string"]`).each(function() {
|
||||
const $element = $(this);
|
||||
$element.text($element.text());
|
||||
});
|
||||
// Collapse nested spans.
|
||||
while (($spans = $parent.find('span:not([class])')).length) {
|
||||
$spans.each(function() {
|
||||
let $span = $(this);
|
||||
while ($span[0] && $span[0].name == 'span' && !$span.attr('class')) {
|
||||
const $parent = $span.parent();
|
||||
$span.replaceWith($span.html());
|
||||
$span = $parent;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates the documentation HTML.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function build() {
|
||||
const markdown = fs
|
||||
// Load markdown.
|
||||
.readFileSync(readmePath, 'utf8')
|
||||
// Uncomment docdown HTML hints.
|
||||
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2')
|
||||
// Convert source and npm package links to anchors.
|
||||
.replace(/\[source\]\(([^)]+)\) \[npm package\]\(([^)]+)\)/g, (match, href1, href2) =>
|
||||
`<p><a href="${ href1 }">source</a> <a href="${ href2 }">npm package</a></p>`
|
||||
);
|
||||
|
||||
const $ = cheerio.load(marky(markdown, {
|
||||
'enableHeadingLinkIcons': false,
|
||||
'sanitize': false
|
||||
}));
|
||||
|
||||
const $header = $('h1').first().remove();
|
||||
const version = $header.find('span').first().text().trim().slice(1);
|
||||
|
||||
// Auto-link Lodash method references.
|
||||
autoLink($);
|
||||
// Rename "_" id references to "lodash".
|
||||
renameLodashId($);
|
||||
// Remove docdown horizontal rules.
|
||||
removeHorizontalRules($);
|
||||
// Remove marky-markdown attribute additions.
|
||||
removeMarkyAttributes($);
|
||||
// Repair marky-markdown wrapping around headers.
|
||||
repairMarkyHeaders($);
|
||||
// Cleanup highlights.
|
||||
tidyHighlights($);
|
||||
|
||||
const 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 %}',
|
||||
$.html().trim(),
|
||||
'{% endraw %}',
|
||||
''
|
||||
].join('\n');
|
||||
|
||||
fs.writeFile(path.join(docPath, version + '.html'), html, util.pitch);
|
||||
}
|
||||
|
||||
build();
|
||||
96
package.json
96
package.json
@@ -1,66 +1,50 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "4.17.4",
|
||||
"version": "5.0.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"main": "lodash.js",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"main": "dist/lodash.js",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "npm run build:main && npm run build:fp",
|
||||
"build:fp": "node lib/fp/build-dist.js",
|
||||
"build:fp-modules": "node lib/fp/build-modules.js",
|
||||
"build:main": "node lib/main/build-dist.js",
|
||||
"build:main-modules": "node lib/main/build-modules.js",
|
||||
"doc": "node lib/main/build-doc github && 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@^9.0.1 && 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 doc/*.md",
|
||||
"test:fp": "node test/test-fp",
|
||||
"test:main": "node test/test",
|
||||
"validate": "npm run style && npm run test"
|
||||
"prepare": "husky install",
|
||||
"lint": "eslint ./src/**/*.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^2.1.4",
|
||||
"benchmark": "^2.1.3",
|
||||
"chalk": "^1.1.3",
|
||||
"cheerio": "^0.22.0",
|
||||
"codecov.io": "~0.1.6",
|
||||
"coveralls": "^2.11.15",
|
||||
"curl-amd": "~0.8.12",
|
||||
"docdown": "~0.7.2",
|
||||
"dojo": "^1.12.1",
|
||||
"ecstatic": "^2.1.0",
|
||||
"fs-extra": "~1.0.0",
|
||||
"glob": "^7.1.1",
|
||||
"istanbul": "0.4.5",
|
||||
"jquery": "^3.1.1",
|
||||
"jscs": "^3.0.7",
|
||||
"lodash": "4.17.3",
|
||||
"lodash-doc-globals": "^0.1.1",
|
||||
"markdown-doctest": "^0.9.1",
|
||||
"optional-dev-dependency": "^2.0.0",
|
||||
"platform": "^1.3.3",
|
||||
"qunit-extras": "^3.0.0",
|
||||
"qunitjs": "^2.1.0",
|
||||
"request": "^2.79.0",
|
||||
"requirejs": "^2.3.2",
|
||||
"sauce-tunnel": "^2.5.0",
|
||||
"uglify-js": "2.7.5",
|
||||
"webpack": "^1.14.0"
|
||||
"@commitlint/cli": "17.7.1",
|
||||
"@commitlint/config-conventional": "17.7.0",
|
||||
"@types/eslint": "8.44.2",
|
||||
"@types/jest": "29.5.5",
|
||||
"@typescript-eslint/eslint-plugin": "6.7.0",
|
||||
"@typescript-eslint/parser": "6.7.0",
|
||||
"eslint": "8.49.0",
|
||||
"eslint-config-airbnb-base": "15.0.0",
|
||||
"eslint-config-airbnb-typescript": "17.1.0",
|
||||
"eslint-config-prettier": "9.0.0",
|
||||
"eslint-plugin-import": "2.28.1",
|
||||
"eslint-plugin-prettier": "5.0.0",
|
||||
"husky": "8.0.3",
|
||||
"lint-staged": "14.0.1",
|
||||
"lodash": "4.17.21",
|
||||
"prettier": "3.0.3"
|
||||
},
|
||||
"greenkeeper": {
|
||||
"ignore": [
|
||||
"lodash"
|
||||
"lint-staged": {
|
||||
"src/**/*.{ts}": [
|
||||
"eslint --fix"
|
||||
]
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"commit-msg": "bun run commitlint --edit $1"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.17.1",
|
||||
"yarn": "^1.22.19"
|
||||
},
|
||||
"volta": {
|
||||
"node": "18.17.1",
|
||||
"yarn": "1.22.19"
|
||||
},
|
||||
"engineStrict": true
|
||||
}
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the lodash builds. */
|
||||
var basePath = '../';
|
||||
|
||||
/** The lodash build to load. */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The other library to load. */
|
||||
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
|
||||
|
||||
/** The `ui` object. */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// Initialize controls.
|
||||
addEventListener('load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
otherIndex = otherList.selectedIndex,
|
||||
search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
|
||||
'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value);
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="perf-build">Build: </label>' +
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash">lodash (production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="perf-other">Other Library: </label>' +
|
||||
'<select id="perf-other">' +
|
||||
'<option value="underscore-dev">Underscore (development)</option>' +
|
||||
'<option value="underscore">Underscore (production)</option>' +
|
||||
'<option value="lodash">lodash</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
otherList = span2.lastChild,
|
||||
toolbar = document.getElementById('perf-toolbar');
|
||||
|
||||
toolbar.appendChild(span2);
|
||||
toolbar.appendChild(span1);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
otherList.selectedIndex = (function() {
|
||||
switch (other) {
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash': return 2;
|
||||
case 'underscore':
|
||||
case null: return 1;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
buildList.addEventListener('change', eventHandler);
|
||||
otherList.addEventListener('change', eventHandler);
|
||||
});
|
||||
|
||||
// The lodash build file path.
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case null: build = 'lodash';
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// The other library file path.
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||
case null: other = 'underscore';
|
||||
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
|
||||
default: return other;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
ui.urlParams = { 'build': build, 'other': other };
|
||||
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
@@ -1,80 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>lodash Performance Suite</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
#FirebugUI {
|
||||
top: 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 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="../lodash.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="../node_modules/benchmark/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="./asset/perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var measured,
|
||||
perfNow,
|
||||
begin = new Date;
|
||||
|
||||
function init() {
|
||||
var fbUI = document.getElementById('FirebugUI'),
|
||||
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
|
||||
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
|
||||
|
||||
if (!fbCommandLine) {
|
||||
return setTimeout(init, 15);
|
||||
}
|
||||
fbUI.style.height = (
|
||||
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
|
||||
document.getElementById('perf-toolbar').clientHeight
|
||||
) + 'px';
|
||||
|
||||
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
|
||||
setTimeout(run, 15);
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1978
perf/perf.js
1978
perf/perf.js
File diff suppressed because it is too large
Load Diff
18
src/.eslintrc.cjs
Normal file
18
src/.eslintrc.cjs
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('node:path');
|
||||
|
||||
module.exports = {
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.{ts}'],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
// Use package.json from both this package folder and root.
|
||||
{ packageDir: [__dirname, path.join(__dirname, '../')] },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
88
src/.internal/Hash.ts
Normal file
88
src/.internal/Hash.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
const HASH_UNDEFINED = '__lodash_hash_undefined__'
|
||||
|
||||
class Hash {
|
||||
|
||||
/**
|
||||
* Creates a hash object.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
constructor(entries) {
|
||||
let index = -1
|
||||
const length = entries == null ? 0 : entries.length
|
||||
|
||||
this.clear()
|
||||
while (++index < length) {
|
||||
const entry = entries[index]
|
||||
this.set(entry[0], entry[1])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the hash.
|
||||
*
|
||||
* @memberOf Hash
|
||||
*/
|
||||
clear() {
|
||||
this.__data__ = Object.create(null)
|
||||
this.size = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the hash.
|
||||
*
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
delete(key) {
|
||||
const result = this.has(key) && delete this.__data__[key]
|
||||
this.size -= result ? 1 : 0
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hash value for `key`.
|
||||
*
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
get(key) {
|
||||
const data = this.__data__
|
||||
const result = data[key]
|
||||
return result === HASH_UNDEFINED ? undefined : result
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a hash value for `key` exists.
|
||||
*
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
has(key) {
|
||||
const data = this.__data__
|
||||
return data[key] !== undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hash `key` to `value`.
|
||||
*
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the hash instance.
|
||||
*/
|
||||
set(key, value) {
|
||||
const data = this.__data__
|
||||
this.size += this.has(key) ? 0 : 1
|
||||
data[key] = value === undefined ? HASH_UNDEFINED : value
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export default Hash
|
||||
103
src/.internal/ListCache.ts
Normal file
103
src/.internal/ListCache.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import assocIndexOf from './assocIndexOf.js'
|
||||
|
||||
class ListCache {
|
||||
|
||||
/**
|
||||
* Creates an list cache object.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
constructor(entries) {
|
||||
let index = -1
|
||||
const length = entries == null ? 0 : entries.length
|
||||
|
||||
this.clear()
|
||||
while (++index < length) {
|
||||
const entry = entries[index]
|
||||
this.set(entry[0], entry[1])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the list cache.
|
||||
*
|
||||
* @memberOf ListCache
|
||||
*/
|
||||
clear() {
|
||||
this.__data__ = []
|
||||
this.size = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the list cache.
|
||||
*
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
delete(key) {
|
||||
const data = this.__data__
|
||||
const index = assocIndexOf(data, key)
|
||||
|
||||
if (index < 0) {
|
||||
return false
|
||||
}
|
||||
const lastIndex = data.length - 1
|
||||
if (index === lastIndex) {
|
||||
data.pop()
|
||||
} else {
|
||||
data.splice(index, 1)
|
||||
}
|
||||
--this.size
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list cache value for `key`.
|
||||
*
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
get(key) {
|
||||
const data = this.__data__
|
||||
const index = assocIndexOf(data, key)
|
||||
return index < 0 ? undefined : data[index][1]
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a list cache value for `key` exists.
|
||||
*
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
has(key) {
|
||||
return assocIndexOf(this.__data__, key) > -1
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list cache `key` to `value`.
|
||||
*
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the list cache instance.
|
||||
*/
|
||||
set(key, value) {
|
||||
const data = this.__data__
|
||||
const index = assocIndexOf(data, key)
|
||||
|
||||
if (index < 0) {
|
||||
++this.size
|
||||
data.push([key, value])
|
||||
} else {
|
||||
data[index][1] = value
|
||||
}
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export default ListCache
|
||||
120
src/.internal/MapCache.ts
Normal file
120
src/.internal/MapCache.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
|
||||
import Hash from './Hash.js'
|
||||
|
||||
/**
|
||||
* Gets the data for `map`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to query.
|
||||
* @param {string} key The reference key.
|
||||
* @returns {*} Returns the map data.
|
||||
*/
|
||||
function getMapData({ __data__ }, key) {
|
||||
const data = __data__
|
||||
return isKeyable(key)
|
||||
? data[typeof key === 'string' ? 'string' : 'hash']
|
||||
: data.map
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is suitable for use as unique object key.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
||||
*/
|
||||
function isKeyable(value) {
|
||||
const type = typeof value
|
||||
return (type === 'string' || type === 'number' || type === 'symbol' || type === 'boolean')
|
||||
? (value !== '__proto__')
|
||||
: (value === null)
|
||||
}
|
||||
|
||||
class MapCache {
|
||||
|
||||
/**
|
||||
* Creates a map cache object to store key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
constructor(entries) {
|
||||
let index = -1
|
||||
const length = entries == null ? 0 : entries.length
|
||||
|
||||
this.clear()
|
||||
while (++index < length) {
|
||||
const entry = entries[index]
|
||||
this.set(entry[0], entry[1])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the map.
|
||||
*
|
||||
* @memberOf MapCache
|
||||
*/
|
||||
clear() {
|
||||
this.size = 0
|
||||
this.__data__ = {
|
||||
'hash': new Hash,
|
||||
'map': new Map,
|
||||
'string': new Hash
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the map.
|
||||
*
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
delete(key) {
|
||||
const result = getMapData(this, key)['delete'](key)
|
||||
this.size -= result ? 1 : 0
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the map value for `key`.
|
||||
*
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
get(key) {
|
||||
return getMapData(this, key).get(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a map value for `key` exists.
|
||||
*
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
has(key) {
|
||||
return getMapData(this, key).has(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the map `key` to `value`.
|
||||
*
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the map cache instance.
|
||||
*/
|
||||
set(key, value) {
|
||||
const data = getMapData(this, key)
|
||||
const size = data.size
|
||||
|
||||
data.set(key, value)
|
||||
this.size += data.size === size ? 0 : 1
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export default MapCache
|
||||
52
src/.internal/SetCache.ts
Normal file
52
src/.internal/SetCache.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import MapCache from './MapCache.js'
|
||||
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
const HASH_UNDEFINED = '__lodash_hash_undefined__'
|
||||
|
||||
class SetCache {
|
||||
|
||||
/**
|
||||
* Creates an array cache object to store unique values.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [values] The values to cache.
|
||||
*/
|
||||
constructor(values) {
|
||||
let index = -1
|
||||
const length = values == null ? 0 : values.length
|
||||
|
||||
this.__data__ = new MapCache
|
||||
while (++index < length) {
|
||||
this.add(values[index])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds `value` to the array cache.
|
||||
*
|
||||
* @memberOf SetCache
|
||||
* @alias push
|
||||
* @param {*} value The value to cache.
|
||||
* @returns {Object} Returns the cache instance.
|
||||
*/
|
||||
add(value) {
|
||||
this.__data__.set(value, HASH_UNDEFINED)
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is in the array cache.
|
||||
*
|
||||
* @memberOf SetCache
|
||||
* @param {*} value The value to search for.
|
||||
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
||||
*/
|
||||
has(value) {
|
||||
return this.__data__.has(value)
|
||||
}
|
||||
}
|
||||
|
||||
SetCache.prototype.push = SetCache.prototype.add
|
||||
|
||||
export default SetCache
|
||||
93
src/.internal/Stack.ts
Normal file
93
src/.internal/Stack.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
import ListCache from './ListCache.js'
|
||||
import MapCache from './MapCache.js'
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
const LARGE_ARRAY_SIZE = 200
|
||||
|
||||
class Stack {
|
||||
|
||||
/**
|
||||
* Creates a stack cache object to store key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
constructor(entries) {
|
||||
const data = this.__data__ = new ListCache(entries)
|
||||
this.size = data.size
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the stack.
|
||||
*
|
||||
* @memberOf Stack
|
||||
*/
|
||||
clear() {
|
||||
this.__data__ = new ListCache
|
||||
this.size = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the stack.
|
||||
*
|
||||
* @memberOf Stack
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
delete(key) {
|
||||
const data = this.__data__
|
||||
const result = data['delete'](key)
|
||||
|
||||
this.size = data.size
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stack value for `key`.
|
||||
*
|
||||
* @memberOf Stack
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
get(key) {
|
||||
return this.__data__.get(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a stack value for `key` exists.
|
||||
*
|
||||
* @memberOf Stack
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
has(key) {
|
||||
return this.__data__.has(key)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stack `key` to `value`.
|
||||
*
|
||||
* @memberOf Stack
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the stack cache instance.
|
||||
*/
|
||||
set(key, value) {
|
||||
let data = this.__data__
|
||||
if (data instanceof ListCache) {
|
||||
const pairs = data.__data__
|
||||
if (pairs.length < LARGE_ARRAY_SIZE - 1) {
|
||||
pairs.push([key, value])
|
||||
this.size = ++data.size
|
||||
return this
|
||||
}
|
||||
data = this.__data__ = new MapCache(pairs)
|
||||
}
|
||||
data.set(key, value)
|
||||
this.size = data.size
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export default Stack
|
||||
15
src/.internal/addMapEntry.ts
Normal file
15
src/.internal/addMapEntry.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Adds the key-value `pair` to `map`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to modify.
|
||||
* @param {Array} pair The key-value pair to add.
|
||||
* @returns {Object} Returns `map`.
|
||||
*/
|
||||
function addMapEntry(map, pair) {
|
||||
// Don't return `map.set` because it's not chainable in IE 11.
|
||||
map.set(pair[0], pair[1])
|
||||
return map
|
||||
}
|
||||
|
||||
export default addMapEntry
|
||||
15
src/.internal/addSetEntry.ts
Normal file
15
src/.internal/addSetEntry.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Adds `value` to `set`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} set The set to modify.
|
||||
* @param {*} value The value to add.
|
||||
* @returns {Object} Returns `set`.
|
||||
*/
|
||||
function addSetEntry(set, value) {
|
||||
// Don't return `set.add` because it's not chainable in IE 11.
|
||||
set.add(value)
|
||||
return set
|
||||
}
|
||||
|
||||
export default addSetEntry
|
||||
21
src/.internal/arrayEach.ts
Normal file
21
src/.internal/arrayEach.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* A specialized version of `forEach` for arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function arrayEach(array, iteratee) {
|
||||
let index = -1
|
||||
const length = array.length
|
||||
|
||||
while (++index < length) {
|
||||
if (iteratee(array[index], index, array) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return array
|
||||
}
|
||||
|
||||
export default arrayEach
|
||||
20
src/.internal/arrayEachRight.ts
Normal file
20
src/.internal/arrayEachRight.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* A specialized version of `forEachRight` for arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function arrayEachRight(array, iteratee) {
|
||||
let length = array == null ? 0 : array.length
|
||||
|
||||
while (length--) {
|
||||
if (iteratee(array[length], length, array) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return array
|
||||
}
|
||||
|
||||
export default arrayEachRight
|
||||
17
src/.internal/arrayIncludes.ts
Normal file
17
src/.internal/arrayIncludes.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import baseIndexOf from './baseIndexOf.js'
|
||||
|
||||
/**
|
||||
* A specialized version of `includes` for arrays without support for
|
||||
* specifying an index to search from.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to inspect.
|
||||
* @param {*} target The value to search for.
|
||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||
*/
|
||||
function arrayIncludes(array, value) {
|
||||
const length = array == null ? 0 : array.length
|
||||
return !!length && baseIndexOf(array, value, 0) > -1
|
||||
}
|
||||
|
||||
export default arrayIncludes
|
||||
23
src/.internal/arrayIncludesWith.ts
Normal file
23
src/.internal/arrayIncludesWith.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This function is like `arrayIncludes` except that it accepts a comparator.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to inspect.
|
||||
* @param {*} target The value to search for.
|
||||
* @param {Function} comparator The comparator invoked per element.
|
||||
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
||||
*/
|
||||
function arrayIncludesWith(array, target, comparator) {
|
||||
if (array == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
for (const value of array) {
|
||||
if (comparator(target, value)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export default arrayIncludesWith
|
||||
43
src/.internal/arrayLikeKeys.ts
Normal file
43
src/.internal/arrayLikeKeys.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import isArguments from '../isArguments.js'
|
||||
import isBuffer from '../isBuffer.js'
|
||||
import isIndex from './isIndex.js'
|
||||
import isTypedArray from '../isTypedArray.js'
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
|
||||
/**
|
||||
* Creates an array of the enumerable property names of the array-like `value`.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to query.
|
||||
* @param {boolean} inherited Specify returning inherited property names.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
*/
|
||||
function arrayLikeKeys(value, inherited) {
|
||||
const isArr = Array.isArray(value)
|
||||
const isArg = !isArr && isArguments(value)
|
||||
const isBuff = !isArr && !isArg && isBuffer(value)
|
||||
const isType = !isArr && !isArg && !isBuff && isTypedArray(value)
|
||||
const skipIndexes = isArr || isArg || isBuff || isType
|
||||
const length = value.length
|
||||
const result = new Array(skipIndexes ? length : 0)
|
||||
let index = skipIndexes ? -1 : length
|
||||
while (++index < length) {
|
||||
result[index] = `${index}`
|
||||
}
|
||||
for (const key in value) {
|
||||
if ((inherited || hasOwnProperty.call(value, key)) &&
|
||||
!(skipIndexes && (
|
||||
// Safari 9 has enumerable `arguments.length` in strict mode.
|
||||
(key === 'length' ||
|
||||
// Skip index properties.
|
||||
isIndex(key, length))
|
||||
))) {
|
||||
result.push(key)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default arrayLikeKeys
|
||||
25
src/.internal/arrayReduce.ts
Normal file
25
src/.internal/arrayReduce.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* A specialized version of `reduce` for arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
||||
* the initial value.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
*/
|
||||
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
||||
let index = -1
|
||||
const length = array == null ? 0 : array.length
|
||||
|
||||
if (initAccum && length) {
|
||||
accumulator = array[++index]
|
||||
}
|
||||
while (++index < length) {
|
||||
accumulator = iteratee(accumulator, array[index], index, array)
|
||||
}
|
||||
return accumulator
|
||||
}
|
||||
|
||||
export default arrayReduce
|
||||
23
src/.internal/arrayReduceRight.ts
Normal file
23
src/.internal/arrayReduceRight.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* A specialized version of `reduceRight` for arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @param {boolean} [initAccum] Specify using the last element of `array` as
|
||||
* the initial value.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
*/
|
||||
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
||||
let length = array == null ? 0 : array.length
|
||||
if (initAccum && length) {
|
||||
accumulator = array[--length]
|
||||
}
|
||||
while (length--) {
|
||||
accumulator = iteratee(accumulator, array[length], length, array)
|
||||
}
|
||||
return accumulator
|
||||
}
|
||||
|
||||
export default arrayReduceRight
|
||||
12
src/.internal/asciiSize.ts
Normal file
12
src/.internal/asciiSize.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Gets the size of an ASCII `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string inspect.
|
||||
* @returns {number} Returns the string size.
|
||||
*/
|
||||
function asciiSize({ length }) {
|
||||
return length
|
||||
}
|
||||
|
||||
export default asciiSize
|
||||
12
src/.internal/asciiToArray.ts
Normal file
12
src/.internal/asciiToArray.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Converts an ASCII `string` to an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
*/
|
||||
function asciiToArray(string) {
|
||||
return string.split('')
|
||||
}
|
||||
|
||||
export default asciiToArray
|
||||
20
src/.internal/assignMergeValue.ts
Normal file
20
src/.internal/assignMergeValue.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import baseAssignValue from './baseAssignValue.js'
|
||||
import eq from '../eq.js'
|
||||
|
||||
/**
|
||||
* This function is like `assignValue` except that it doesn't assign
|
||||
* `undefined` values.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {string} key The key of the property to assign.
|
||||
* @param {*} value The value to assign.
|
||||
*/
|
||||
function assignMergeValue(object, key, value) {
|
||||
if ((value !== undefined && !eq(object[key], value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
baseAssignValue(object, key, value)
|
||||
}
|
||||
}
|
||||
|
||||
export default assignMergeValue
|
||||
27
src/.internal/assignValue.ts
Normal file
27
src/.internal/assignValue.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import baseAssignValue from './baseAssignValue.js'
|
||||
import eq from '../eq.js'
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
|
||||
/**
|
||||
* Assigns `value` to `key` of `object` if the existing value is not equivalent.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {string} key The key of the property to assign.
|
||||
* @param {*} value The value to assign.
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
const objValue = object[key]
|
||||
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value))) {
|
||||
if (value !== 0 || (1 / value) === (1 / objValue)) {
|
||||
baseAssignValue(object, key, value)
|
||||
}
|
||||
} else if (value === undefined && !(key in object)) {
|
||||
baseAssignValue(object, key, value)
|
||||
}
|
||||
}
|
||||
|
||||
export default assignValue
|
||||
21
src/.internal/assocIndexOf.ts
Normal file
21
src/.internal/assocIndexOf.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import eq from '../eq.js'
|
||||
|
||||
/**
|
||||
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} key The key to search for.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function assocIndexOf(array, key) {
|
||||
let { length } = array
|
||||
while (length--) {
|
||||
if (eq(array[length][0], key)) {
|
||||
return length
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
export default assocIndexOf
|
||||
23
src/.internal/baseAssignValue.ts
Normal file
23
src/.internal/baseAssignValue.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* The base implementation of `assignValue` and `assignMergeValue` without
|
||||
* value checks.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {string} key The key of the property to assign.
|
||||
* @param {*} value The value to assign.
|
||||
*/
|
||||
function baseAssignValue(object, key, value) {
|
||||
if (key === '__proto__') {
|
||||
Object.defineProperty(object, key, {
|
||||
'configurable': true,
|
||||
'enumerable': true,
|
||||
'value': value,
|
||||
'writable': true
|
||||
})
|
||||
} else {
|
||||
object[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
export default baseAssignValue
|
||||
23
src/.internal/baseAt.ts
Normal file
23
src/.internal/baseAt.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import get from '../get.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `at` without support for individual paths.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {string[]} paths The property paths to pick.
|
||||
* @returns {Array} Returns the picked elements.
|
||||
*/
|
||||
function baseAt(object, paths) {
|
||||
let index = -1
|
||||
const length = paths.length
|
||||
const result = new Array(length)
|
||||
const skip = object == null
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = skip ? undefined : get(object, paths[index])
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseAt
|
||||
241
src/.internal/baseClone.ts
Normal file
241
src/.internal/baseClone.ts
Normal file
@@ -0,0 +1,241 @@
|
||||
import Stack from './Stack.js'
|
||||
import arrayEach from './arrayEach.js'
|
||||
import assignValue from './assignValue.js'
|
||||
import cloneBuffer from './cloneBuffer.js'
|
||||
import copyArray from './copyArray.js'
|
||||
import copyObject from './copyObject.js'
|
||||
import cloneArrayBuffer from './cloneArrayBuffer.js'
|
||||
import cloneDataView from './cloneDataView.js'
|
||||
import cloneRegExp from './cloneRegExp.js'
|
||||
import cloneSymbol from './cloneSymbol.js'
|
||||
import cloneTypedArray from './cloneTypedArray.js'
|
||||
import copySymbols from './copySymbols.js'
|
||||
import copySymbolsIn from './copySymbolsIn.js'
|
||||
import getAllKeys from './getAllKeys.js'
|
||||
import getAllKeysIn from './getAllKeysIn.js'
|
||||
import getTag from './getTag.js'
|
||||
import initCloneObject from './initCloneObject.js'
|
||||
import isBuffer from '../isBuffer.js'
|
||||
import isObject from '../isObject.js'
|
||||
import isTypedArray from '../isTypedArray.js'
|
||||
import keys from '../keys.js'
|
||||
import keysIn from '../keysIn.js'
|
||||
|
||||
/** Used to compose bitmasks for cloning. */
|
||||
const CLONE_DEEP_FLAG = 1
|
||||
const CLONE_FLAT_FLAG = 2
|
||||
const CLONE_SYMBOLS_FLAG = 4
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
const argsTag = '[object Arguments]'
|
||||
const arrayTag = '[object Array]'
|
||||
const boolTag = '[object Boolean]'
|
||||
const dateTag = '[object Date]'
|
||||
const errorTag = '[object Error]'
|
||||
const mapTag = '[object Map]'
|
||||
const numberTag = '[object Number]'
|
||||
const objectTag = '[object Object]'
|
||||
const regexpTag = '[object RegExp]'
|
||||
const setTag = '[object Set]'
|
||||
const stringTag = '[object String]'
|
||||
const symbolTag = '[object Symbol]'
|
||||
const weakMapTag = '[object WeakMap]'
|
||||
|
||||
const arrayBufferTag = '[object ArrayBuffer]'
|
||||
const dataViewTag = '[object DataView]'
|
||||
const float32Tag = '[object Float32Array]'
|
||||
const float64Tag = '[object Float64Array]'
|
||||
const int8Tag = '[object Int8Array]'
|
||||
const int16Tag = '[object Int16Array]'
|
||||
const int32Tag = '[object Int32Array]'
|
||||
const uint8Tag = '[object Uint8Array]'
|
||||
const uint8ClampedTag = '[object Uint8ClampedArray]'
|
||||
const uint16Tag = '[object Uint16Array]'
|
||||
const uint32Tag = '[object Uint32Array]'
|
||||
|
||||
/** Used to identify `toStringTag` values supported by `clone`. */
|
||||
const cloneableTags = {}
|
||||
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
||||
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
||||
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
||||
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
||||
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
||||
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
||||
cloneableTags[numberTag] = cloneableTags[objectTag] =
|
||||
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
||||
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
||||
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
||||
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true
|
||||
cloneableTags[errorTag] = cloneableTags[weakMapTag] = false
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
|
||||
/**
|
||||
* Initializes an object clone based on its `toStringTag`.
|
||||
*
|
||||
* **Note:** This function only supports cloning values with tags of
|
||||
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to clone.
|
||||
* @param {string} tag The `toStringTag` of the object to clone.
|
||||
* @param {boolean} [isDeep] Specify a deep clone.
|
||||
* @returns {Object} Returns the initialized clone.
|
||||
*/
|
||||
function initCloneByTag(object, tag, isDeep) {
|
||||
const Ctor = object.constructor
|
||||
switch (tag) {
|
||||
case arrayBufferTag:
|
||||
return cloneArrayBuffer(object)
|
||||
|
||||
case boolTag:
|
||||
case dateTag:
|
||||
return new Ctor(+object)
|
||||
|
||||
case dataViewTag:
|
||||
return cloneDataView(object, isDeep)
|
||||
|
||||
case float32Tag: case float64Tag:
|
||||
case int8Tag: case int16Tag: case int32Tag:
|
||||
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
|
||||
return cloneTypedArray(object, isDeep)
|
||||
|
||||
case mapTag:
|
||||
return new Ctor
|
||||
|
||||
case numberTag:
|
||||
case stringTag:
|
||||
return new Ctor(object)
|
||||
|
||||
case regexpTag:
|
||||
return cloneRegExp(object)
|
||||
|
||||
case setTag:
|
||||
return new Ctor
|
||||
|
||||
case symbolTag:
|
||||
return cloneSymbol(object)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes an array clone.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to clone.
|
||||
* @returns {Array} Returns the initialized clone.
|
||||
*/
|
||||
function initCloneArray(array) {
|
||||
const { length } = array
|
||||
const result = new array.constructor(length)
|
||||
|
||||
// Add properties assigned by `RegExp#exec`.
|
||||
if (length && typeof array[0] === 'string' && hasOwnProperty.call(array, 'index')) {
|
||||
result.index = array.index
|
||||
result.input = array.input
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `clone` and `cloneDeep` which tracks
|
||||
* traversed objects.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to clone.
|
||||
* @param {number} bitmask The bitmask flags.
|
||||
* 1 - Deep clone
|
||||
* 2 - Flatten inherited properties
|
||||
* 4 - Clone symbols
|
||||
* @param {Function} [customizer] The function to customize cloning.
|
||||
* @param {string} [key] The key of `value`.
|
||||
* @param {Object} [object] The parent object of `value`.
|
||||
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
||||
* @returns {*} Returns the cloned value.
|
||||
*/
|
||||
function baseClone(value, bitmask, customizer, key, object, stack) {
|
||||
let result
|
||||
const isDeep = bitmask & CLONE_DEEP_FLAG
|
||||
const isFlat = bitmask & CLONE_FLAT_FLAG
|
||||
const isFull = bitmask & CLONE_SYMBOLS_FLAG
|
||||
|
||||
if (customizer) {
|
||||
result = object ? customizer(value, key, object, stack) : customizer(value)
|
||||
}
|
||||
if (result !== undefined) {
|
||||
return result
|
||||
}
|
||||
if (!isObject(value)) {
|
||||
return value
|
||||
}
|
||||
const isArr = Array.isArray(value)
|
||||
const tag = getTag(value)
|
||||
if (isArr) {
|
||||
result = initCloneArray(value)
|
||||
if (!isDeep) {
|
||||
return copyArray(value, result)
|
||||
}
|
||||
} else {
|
||||
const isFunc = typeof value === 'function'
|
||||
|
||||
if (isBuffer(value)) {
|
||||
return cloneBuffer(value, isDeep)
|
||||
}
|
||||
if (tag === objectTag || tag === argsTag || (isFunc && !object)) {
|
||||
result = (isFlat || isFunc) ? {} : initCloneObject(value)
|
||||
if (!isDeep) {
|
||||
return isFlat
|
||||
? copySymbolsIn(value, copyObject(value, keysIn(value), result))
|
||||
: copySymbols(value, Object.assign(result, value))
|
||||
}
|
||||
} else {
|
||||
if (isFunc || !cloneableTags[tag]) {
|
||||
return object ? value : {}
|
||||
}
|
||||
result = initCloneByTag(value, tag, isDeep)
|
||||
}
|
||||
}
|
||||
// Check for circular references and return its corresponding clone.
|
||||
stack || (stack = new Stack)
|
||||
const stacked = stack.get(value)
|
||||
if (stacked) {
|
||||
return stacked
|
||||
}
|
||||
stack.set(value, result)
|
||||
|
||||
if (tag === mapTag) {
|
||||
value.forEach((subValue, key) => {
|
||||
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack))
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
if (tag === setTag) {
|
||||
value.forEach((subValue) => {
|
||||
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack))
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
if (isTypedArray(value)) {
|
||||
return result
|
||||
}
|
||||
|
||||
const keysFunc = isFull
|
||||
? (isFlat ? getAllKeysIn : getAllKeys)
|
||||
: (isFlat ? keysIn : keys)
|
||||
|
||||
const props = isArr ? undefined : keysFunc(value)
|
||||
arrayEach(props || value, (subValue, key) => {
|
||||
if (props) {
|
||||
key = subValue
|
||||
subValue = value[key]
|
||||
}
|
||||
// Recursively populate clone (susceptible to call stack limits).
|
||||
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack))
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseClone
|
||||
16
src/.internal/baseConforms.ts
Normal file
16
src/.internal/baseConforms.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import baseConformsTo from './baseConformsTo.js'
|
||||
import keys from '../keys.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `conforms` which doesn't clone `source`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object of property predicates to conform to.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseConforms(source) {
|
||||
const props = keys(source)
|
||||
return (object) => baseConformsTo(object, source, props)
|
||||
}
|
||||
|
||||
export default baseConforms
|
||||
27
src/.internal/baseConformsTo.ts
Normal file
27
src/.internal/baseConformsTo.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* The base implementation of `conformsTo` which accepts `props` to check.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {Object} source The object of property predicates to conform to.
|
||||
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
|
||||
*/
|
||||
function baseConformsTo(object, source, props) {
|
||||
let length = props.length
|
||||
if (object == null) {
|
||||
return !length
|
||||
}
|
||||
object = Object(object)
|
||||
while (length--) {
|
||||
const key = props[length]
|
||||
const predicate = source[key]
|
||||
const value = object[key]
|
||||
|
||||
if ((value === undefined && !(key in object)) || !predicate(value)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
export default baseConformsTo
|
||||
63
src/.internal/baseDifference.ts
Normal file
63
src/.internal/baseDifference.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import SetCache from './SetCache.js'
|
||||
import arrayIncludes from './arrayIncludes.js'
|
||||
import arrayIncludesWith from './arrayIncludesWith.js'
|
||||
import map from '../map.js'
|
||||
import cacheHas from './cacheHas.js'
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
const LARGE_ARRAY_SIZE = 200
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `difference` without support
|
||||
* for excluding multiple arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} values The values to exclude.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
*/
|
||||
function baseDifference(array, values, iteratee, comparator) {
|
||||
let includes = arrayIncludes
|
||||
let isCommon = true
|
||||
const result = []
|
||||
const valuesLength = values.length
|
||||
|
||||
if (!array.length) {
|
||||
return result
|
||||
}
|
||||
if (iteratee) {
|
||||
values = map(values, (value) => iteratee(value))
|
||||
}
|
||||
if (comparator) {
|
||||
includes = arrayIncludesWith
|
||||
isCommon = false
|
||||
}
|
||||
else if (values.length >= LARGE_ARRAY_SIZE) {
|
||||
includes = cacheHas
|
||||
isCommon = false
|
||||
values = new SetCache(values)
|
||||
}
|
||||
outer:
|
||||
for (let value of array) {
|
||||
const computed = iteratee == null ? value : iteratee(value)
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0
|
||||
if (isCommon && computed === computed) {
|
||||
let valuesIndex = valuesLength
|
||||
while (valuesIndex--) {
|
||||
if (values[valuesIndex] === computed) {
|
||||
continue outer
|
||||
}
|
||||
}
|
||||
result.push(value)
|
||||
}
|
||||
else if (!includes(values, computed, comparator)) {
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseDifference
|
||||
31
src/.internal/baseEach.ts
Normal file
31
src/.internal/baseEach.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import baseForOwn from './baseForOwn.js'
|
||||
import isArrayLike from '../isArrayLike.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `forEach`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
*/
|
||||
function baseEach(collection, iteratee) {
|
||||
if (collection == null) {
|
||||
return collection
|
||||
}
|
||||
if (!isArrayLike(collection)) {
|
||||
return baseForOwn(collection, iteratee)
|
||||
}
|
||||
const length = collection.length
|
||||
const iterable = Object(collection)
|
||||
let index = -1
|
||||
|
||||
while (++index < length) {
|
||||
if (iteratee(iterable[index], index, iterable) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return collection
|
||||
}
|
||||
|
||||
export default baseEach
|
||||
30
src/.internal/baseEachRight.ts
Normal file
30
src/.internal/baseEachRight.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import baseForOwnRight from './baseForOwnRight.js'
|
||||
import isArrayLike from '../isArrayLike.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `forEachRight`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
*/
|
||||
function baseEachRight(collection, iteratee) {
|
||||
if (collection == null) {
|
||||
return collection
|
||||
}
|
||||
if (!isArrayLike(collection)) {
|
||||
return baseForOwnRight(collection, iteratee)
|
||||
}
|
||||
const iterable = Object(collection)
|
||||
let length = collection.length
|
||||
|
||||
while (length--) {
|
||||
if (iteratee(iterable[length], length, iterable) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return collection
|
||||
}
|
||||
|
||||
export default baseEachRight
|
||||
23
src/.internal/baseFindIndex.ts
Normal file
23
src/.internal/baseFindIndex.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* The base implementation of `findIndex` and `findLastIndex`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {number} fromIndex The index to search from.
|
||||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
||||
const { length } = array
|
||||
let index = fromIndex + (fromRight ? 1 : -1)
|
||||
|
||||
while ((fromRight ? index-- : ++index < length)) {
|
||||
if (predicate(array[index], index, array)) {
|
||||
return index
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
export default baseFindIndex
|
||||
22
src/.internal/baseFindKey.ts
Normal file
22
src/.internal/baseFindKey.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* The base implementation of methods like `findKey` and `findLastKey`
|
||||
* which iterates over `collection` using `eachFunc`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to inspect.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {Function} eachFunc The function to iterate over `collection`.
|
||||
* @returns {*} Returns the found element or its key, else `undefined`.
|
||||
*/
|
||||
function baseFindKey(collection, predicate, eachFunc) {
|
||||
let result
|
||||
eachFunc(collection, (value, key, collection) => {
|
||||
if (predicate(value, key, collection)) {
|
||||
result = key
|
||||
return false
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseFindKey
|
||||
37
src/.internal/baseFlatten.ts
Normal file
37
src/.internal/baseFlatten.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import isFlattenable from './isFlattenable.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `flatten` with support for restricting flattening.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {number} depth The maximum recursion depth.
|
||||
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
||||
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
||||
* @param {Array} [result=[]] The initial result value.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
*/
|
||||
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||
predicate || (predicate = isFlattenable)
|
||||
result || (result = [])
|
||||
|
||||
if (array == null) {
|
||||
return result
|
||||
}
|
||||
|
||||
for (const value of array) {
|
||||
if (depth > 0 && predicate(value)) {
|
||||
if (depth > 1) {
|
||||
// Recursively flatten arrays (susceptible to call stack limits).
|
||||
baseFlatten(value, depth - 1, predicate, isStrict, result)
|
||||
} else {
|
||||
result.push(...value)
|
||||
}
|
||||
} else if (!isStrict) {
|
||||
result[result.length] = value
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseFlatten
|
||||
27
src/.internal/baseFor.ts
Normal file
27
src/.internal/baseFor.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* The base implementation of `baseForOwn` which iterates over `object`
|
||||
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {Function} keysFunc The function to get the keys of `object`.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseFor(object, iteratee, keysFunc) {
|
||||
const iterable = Object(object)
|
||||
const props = keysFunc(object)
|
||||
let { length } = props
|
||||
let index = -1
|
||||
|
||||
while (length--) {
|
||||
const key = props[++index]
|
||||
if (iteratee(iterable[key], key, iterable) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return object
|
||||
}
|
||||
|
||||
export default baseFor
|
||||
16
src/.internal/baseForOwn.ts
Normal file
16
src/.internal/baseForOwn.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import baseFor from './baseFor.js'
|
||||
import keys from '../keys.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `forOwn`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseForOwn(object, iteratee) {
|
||||
return object && baseFor(object, iteratee, keys)
|
||||
}
|
||||
|
||||
export default baseForOwn
|
||||
16
src/.internal/baseForOwnRight.ts
Normal file
16
src/.internal/baseForOwnRight.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import baseForRight from './baseForRight.js'
|
||||
import keys from '../keys.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `forOwnRight`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseForOwnRight(object, iteratee) {
|
||||
return object && baseForRight(object, iteratee, keys)
|
||||
}
|
||||
|
||||
export default baseForOwnRight
|
||||
25
src/.internal/baseForRight.ts
Normal file
25
src/.internal/baseForRight.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* This function is like `baseFor` except that it iterates over properties
|
||||
* in the opposite order.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {Function} keysFunc The function to get the keys of `object`.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseForRight(object, iteratee, keysFunc) {
|
||||
const iterable = Object(object)
|
||||
const props = keysFunc(object)
|
||||
let { length } = props
|
||||
|
||||
while (length--) {
|
||||
const key = props[length]
|
||||
if (iteratee(iterable[key], key, iterable) === false) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return object
|
||||
}
|
||||
|
||||
export default baseForRight
|
||||
24
src/.internal/baseGet.ts
Normal file
24
src/.internal/baseGet.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import castPath from './castPath.js'
|
||||
import toKey from './toKey.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `get` without support for default values.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path of the property to get.
|
||||
* @returns {*} Returns the resolved value.
|
||||
*/
|
||||
function baseGet(object, path) {
|
||||
path = castPath(path, object)
|
||||
|
||||
let index = 0
|
||||
const length = path.length
|
||||
|
||||
while (object != null && index < length) {
|
||||
object = object[toKey(path[index++])]
|
||||
}
|
||||
return (index && index === length) ? object : undefined
|
||||
}
|
||||
|
||||
export default baseGet
|
||||
14
src/.internal/baseInRange.ts
Normal file
14
src/.internal/baseInRange.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* The base implementation of `inRange` which doesn't coerce arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {number} number The number to check.
|
||||
* @param {number} start The start of the range.
|
||||
* @param {number} end The end of the range.
|
||||
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
|
||||
*/
|
||||
function baseInRange(number, start, end) {
|
||||
return number >= Math.min(start, end) && number < Math.max(start, end)
|
||||
}
|
||||
|
||||
export default baseInRange
|
||||
20
src/.internal/baseIndexOf.ts
Normal file
20
src/.internal/baseIndexOf.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import baseFindIndex from './baseFindIndex.js'
|
||||
import baseIsNaN from './baseIsNaN.js'
|
||||
import strictIndexOf from './strictIndexOf.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `indexOf` without `fromIndex` bounds checks.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} value The value to search for.
|
||||
* @param {number} fromIndex The index to search from.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseIndexOf(array, value, fromIndex) {
|
||||
return value === value
|
||||
? strictIndexOf(array, value, fromIndex)
|
||||
: baseFindIndex(array, baseIsNaN, fromIndex)
|
||||
}
|
||||
|
||||
export default baseIndexOf
|
||||
23
src/.internal/baseIndexOfWith.ts
Normal file
23
src/.internal/baseIndexOfWith.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This function is like `baseIndexOf` except that it accepts a comparator.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} value The value to search for.
|
||||
* @param {number} fromIndex The index to search from.
|
||||
* @param {Function} comparator The comparator invoked per element.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
||||
let index = fromIndex - 1
|
||||
const { length } = array
|
||||
|
||||
while (++index < length) {
|
||||
if (comparator(array[index], value)) {
|
||||
return index
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
export default baseIndexOfWith
|
||||
72
src/.internal/baseIntersection.ts
Normal file
72
src/.internal/baseIntersection.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import SetCache from './SetCache.js'
|
||||
import arrayIncludes from './arrayIncludes.js'
|
||||
import arrayIncludesWith from './arrayIncludesWith.js'
|
||||
import map from '../map.js'
|
||||
import cacheHas from './cacheHas.js'
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `intersection` that accepts an
|
||||
* array of arrays to inspect.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} arrays The arrays to inspect.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of shared values.
|
||||
*/
|
||||
function baseIntersection(arrays, iteratee, comparator) {
|
||||
const includes = comparator ? arrayIncludesWith : arrayIncludes
|
||||
const length = arrays[0].length
|
||||
const othLength = arrays.length
|
||||
const caches = new Array(othLength)
|
||||
const result = []
|
||||
|
||||
let array
|
||||
let maxLength = Infinity
|
||||
let othIndex = othLength
|
||||
|
||||
while (othIndex--) {
|
||||
array = arrays[othIndex]
|
||||
if (othIndex && iteratee) {
|
||||
array = map(array, (value) => iteratee(value))
|
||||
}
|
||||
maxLength = Math.min(array.length, maxLength)
|
||||
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
|
||||
? new SetCache(othIndex && array)
|
||||
: undefined
|
||||
}
|
||||
array = arrays[0]
|
||||
|
||||
let index = -1
|
||||
const seen = caches[0]
|
||||
|
||||
outer:
|
||||
while (++index < length && result.length < maxLength) {
|
||||
let value = array[index]
|
||||
const computed = iteratee ? iteratee(value) : value
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0
|
||||
if (!(seen
|
||||
? cacheHas(seen, computed)
|
||||
: includes(result, computed, comparator)
|
||||
)) {
|
||||
othIndex = othLength
|
||||
while (--othIndex) {
|
||||
const cache = caches[othIndex]
|
||||
if (!(cache
|
||||
? cacheHas(cache, computed)
|
||||
: includes(arrays[othIndex], computed, comparator))
|
||||
) {
|
||||
continue outer
|
||||
}
|
||||
}
|
||||
if (seen) {
|
||||
seen.push(computed)
|
||||
}
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseIntersection
|
||||
28
src/.internal/baseIsEqual.ts
Normal file
28
src/.internal/baseIsEqual.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import baseIsEqualDeep from './baseIsEqualDeep.js'
|
||||
import isObjectLike from '../isObjectLike.js'
|
||||
|
||||
/**
|
||||
* The base implementation of `isEqual` which supports partial comparisons
|
||||
* and tracks traversed objects.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @param {boolean} bitmask The bitmask flags.
|
||||
* 1 - Unordered comparison
|
||||
* 2 - Partial comparison
|
||||
* @param {Function} [customizer] The function to customize comparisons.
|
||||
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||
*/
|
||||
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
||||
if (value === other) {
|
||||
return true
|
||||
}
|
||||
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
|
||||
return value !== value && other !== other
|
||||
}
|
||||
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack)
|
||||
}
|
||||
|
||||
export default baseIsEqual
|
||||
79
src/.internal/baseIsEqualDeep.ts
Normal file
79
src/.internal/baseIsEqualDeep.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import Stack from './Stack.js'
|
||||
import equalArrays from './equalArrays.js'
|
||||
import equalByTag from './equalByTag.js'
|
||||
import equalObjects from './equalObjects.js'
|
||||
import getTag from './getTag.js'
|
||||
import isBuffer from '../isBuffer.js'
|
||||
import isTypedArray from '../isTypedArray.js'
|
||||
|
||||
/** Used to compose bitmasks for value comparisons. */
|
||||
const COMPARE_PARTIAL_FLAG = 1
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
const argsTag = '[object Arguments]'
|
||||
const arrayTag = '[object Array]'
|
||||
const objectTag = '[object Object]'
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
|
||||
/**
|
||||
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
||||
* deep comparisons and tracks traversed objects enabling objects with circular
|
||||
* references to be compared.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to compare.
|
||||
* @param {Object} other The other object to compare.
|
||||
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
||||
* @param {Function} customizer The function to customize comparisons.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
||||
let objIsArr = Array.isArray(object)
|
||||
const othIsArr = Array.isArray(other)
|
||||
let objTag = objIsArr ? arrayTag : getTag(object)
|
||||
let othTag = othIsArr ? arrayTag : getTag(other)
|
||||
|
||||
objTag = objTag === argsTag ? objectTag : objTag
|
||||
othTag = othTag === argsTag ? objectTag : othTag
|
||||
|
||||
let objIsObj = objTag === objectTag
|
||||
const othIsObj = othTag === objectTag
|
||||
const isSameTag = objTag === othTag
|
||||
|
||||
if (isSameTag && isBuffer(object)) {
|
||||
if (!isBuffer(other)) {
|
||||
return false
|
||||
}
|
||||
objIsArr = true
|
||||
objIsObj = false
|
||||
}
|
||||
if (isSameTag && !objIsObj) {
|
||||
stack || (stack = new Stack)
|
||||
return (objIsArr || isTypedArray(object))
|
||||
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
||||
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack)
|
||||
}
|
||||
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
||||
const objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__')
|
||||
const othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__')
|
||||
|
||||
if (objIsWrapped || othIsWrapped) {
|
||||
const objUnwrapped = objIsWrapped ? object.value() : object
|
||||
const othUnwrapped = othIsWrapped ? other.value() : other
|
||||
|
||||
stack || (stack = new Stack)
|
||||
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack)
|
||||
}
|
||||
}
|
||||
if (!isSameTag) {
|
||||
return false
|
||||
}
|
||||
stack || (stack = new Stack)
|
||||
return equalObjects(object, other, bitmask, customizer, equalFunc, stack)
|
||||
}
|
||||
|
||||
export default baseIsEqualDeep
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user