mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
1085 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 | ||
|
|
912d6b04a1 | ||
|
|
165572022d | ||
|
|
ae467c7313 | ||
|
|
1e80c19b0f | ||
|
|
6eeafd3dc2 | ||
|
|
e33b15674d | ||
|
|
a23b918bef | ||
|
|
ef618992b5 | ||
|
|
708b962860 | ||
|
|
da2d08d771 | ||
|
|
30863e5fa6 | ||
|
|
6672a4f942 | ||
|
|
f7263047bf | ||
|
|
02fdf4e673 | ||
|
|
e2c703a96f | ||
|
|
32fdfcc1e5 | ||
|
|
6c1ae0b54d | ||
|
|
0c1c87b046 | ||
|
|
b51786e72e | ||
|
|
5ee5099af1 | ||
|
|
482dc9478b | ||
|
|
528b6a98a9 | ||
|
|
a8bcb5f3d5 | ||
|
|
d429f90ec5 | ||
|
|
72f559e1a3 | ||
|
|
2f92d55024 | ||
|
|
5a86b67263 | ||
|
|
bea4b29bc4 | ||
|
|
0cd4134bc6 | ||
|
|
ec74813be6 | ||
|
|
67926a4df2 | ||
|
|
40a591d0c0 | ||
|
|
783e03ffa3 | ||
|
|
1dddf27a39 | ||
|
|
2890eabf66 | ||
|
|
a3e077324a | ||
|
|
86ee93650d | ||
|
|
dd0d984d37 | ||
|
|
eba18891e5 | ||
|
|
5cb80a0a84 | ||
|
|
db14f324f6 | ||
|
|
238defb150 | ||
|
|
53ba1e0c3c | ||
|
|
95d3477c22 | ||
|
|
a06d1a0313 | ||
|
|
330c8cb46e | ||
|
|
da2e8a1030 | ||
|
|
5bc9e6b8bd | ||
|
|
9a02bd5fc7 | ||
|
|
89656fdf4a | ||
|
|
4cb7bea97d | ||
|
|
eb4861c3cd | ||
|
|
170c13b5ba | ||
|
|
26a6117889 | ||
|
|
014982cb2c | ||
|
|
058361e222 | ||
|
|
e344b66af9 | ||
|
|
54cb3599e3 | ||
|
|
6c427b7a26 | ||
|
|
ce093845e1 | ||
|
|
102c5f00d7 | ||
|
|
13d315a93b | ||
|
|
2cc247ddf8 | ||
|
|
5488644658 | ||
|
|
1fe9042953 | ||
|
|
8bde34dda0 | ||
|
|
98720bea4a | ||
|
|
032637bba1 | ||
|
|
dadde87cab | ||
|
|
fcd0bbfc56 | ||
|
|
600fbbadfb | ||
|
|
3d0df11e50 | ||
|
|
2e4c997dba | ||
|
|
5aaf7e40ae | ||
|
|
57703b040d | ||
|
|
c6ff776147 | ||
|
|
9ac729e1bc | ||
|
|
6d951ccc87 | ||
|
|
3217118fab | ||
|
|
6ef973ae33 | ||
|
|
e0a65ac34a | ||
|
|
b833d83a3e | ||
|
|
220713109c | ||
|
|
cafb9822ce | ||
|
|
1b3815928d | ||
|
|
fbb67f9dbe | ||
|
|
8d24f393ac | ||
|
|
7759376b91 | ||
|
|
ccc3081be0 | ||
|
|
62b66305f2 | ||
|
|
65daae2043 | ||
|
|
0fcf43b02b | ||
|
|
46d1f53ee9 | ||
|
|
fc22665dd8 | ||
|
|
7862e5ce2d | ||
|
|
7cbffd5ebf | ||
|
|
5028267c72 | ||
|
|
6f03ef955c | ||
|
|
f75bf13ad1 | ||
|
|
d7dbf0951d | ||
|
|
daf6de6a46 | ||
|
|
7d4c3ed404 | ||
|
|
a9fd17950a | ||
|
|
b91a515258 | ||
|
|
bc5729a9de | ||
|
|
729d1a57aa | ||
|
|
73e2562cd1 | ||
|
|
849423c9d8 | ||
|
|
1c9a9f364d | ||
|
|
e485e16d28 | ||
|
|
bc49e7fe18 | ||
|
|
6a9337434f | ||
|
|
0c89b9aeb5 | ||
|
|
6f7a8501cb | ||
|
|
7a03898ffe | ||
|
|
609ae34b4e | ||
|
|
2d21faf68a | ||
|
|
26ee0c5c2a | ||
|
|
cafb5e1331 | ||
|
|
7717b8aa64 | ||
|
|
c82322c490 | ||
|
|
4af0c066ec | ||
|
|
d2b10de40b | ||
|
|
26bfb74a60 | ||
|
|
ef129e4c8c | ||
|
|
0b04309ea5 | ||
|
|
fb4852f6db | ||
|
|
5046943020 | ||
|
|
14d7f89f75 | ||
|
|
d431e97030 | ||
|
|
8f06ea259a | ||
|
|
0a0fa58e2d | ||
|
|
286f1abb87 | ||
|
|
a621ba236a | ||
|
|
a041a3782d | ||
|
|
9f8064a8b5 | ||
|
|
729f424622 | ||
|
|
6a8e978fd7 | ||
|
|
aea509c230 | ||
|
|
21113b8c87 | ||
|
|
dcf6d382c4 | ||
|
|
c541598f40 | ||
|
|
bd8e38518f | ||
|
|
067036a359 | ||
|
|
22b51ed232 | ||
|
|
054e78572b | ||
|
|
31cb06a643 | ||
|
|
ee4a5a2604 | ||
|
|
05b60871c5 | ||
|
|
03a194fcb9 | ||
|
|
52e96c38dc | ||
|
|
f5dd98cac4 | ||
|
|
b890d40b54 | ||
|
|
457a0dc703 | ||
|
|
e4837cd75d | ||
|
|
67b2c6f900 | ||
|
|
260a84c4d8 | ||
|
|
4b0db6ec6c | ||
|
|
9c4c194bb5 | ||
|
|
ac74a1ea15 | ||
|
|
e4ddf3e155 | ||
|
|
896b27ef73 | ||
|
|
bdf0b9f288 | ||
|
|
1665e5cbff | ||
|
|
6e8c0de1ff | ||
|
|
4fb41ac6a9 | ||
|
|
af983b2dd3 | ||
|
|
405d5875b8 | ||
|
|
b30f979ec7 | ||
|
|
836bd258a0 | ||
|
|
d2f74ee245 | ||
|
|
45f668b416 | ||
|
|
d29d74f687 | ||
|
|
9fba7be296 | ||
|
|
f30851bac1 | ||
|
|
d308bce09f | ||
|
|
3d7dbd140c | ||
|
|
15bd64a1b4 | ||
|
|
3c30100837 | ||
|
|
81bdb9da43 | ||
|
|
60e3a93a30 | ||
|
|
158f2839fd | ||
|
|
c7b9df4286 | ||
|
|
0eca941e22 | ||
|
|
8592f4163f | ||
|
|
29e2598a39 | ||
|
|
32e75acb9f | ||
|
|
b54501a771 | ||
|
|
6062860628 | ||
|
|
a12c3797fb | ||
|
|
48bc8b4f1a | ||
|
|
e861681963 | ||
|
|
9985e81808 | ||
|
|
ffde99b216 | ||
|
|
492caa4fd2 | ||
|
|
01c0950ae8 | ||
|
|
20fa52309c | ||
|
|
7a345b5606 | ||
|
|
b6d8116882 | ||
|
|
4495e74f77 | ||
|
|
c009349d99 | ||
|
|
26d5ba992c | ||
|
|
320ef6f933 | ||
|
|
b678bb4a74 | ||
|
|
c1c394ac60 | ||
|
|
70d3057e17 | ||
|
|
3d27920226 | ||
|
|
33a43a5f93 | ||
|
|
fac9501840 | ||
|
|
4d6aade733 | ||
|
|
d9e2c1cc34 | ||
|
|
c8c6a7e7b1 | ||
|
|
69addb855e | ||
|
|
55fb0172c0 | ||
|
|
2026cbeebd | ||
|
|
d6d01cdfa0 | ||
|
|
cb07604dc6 | ||
|
|
549def0e48 | ||
|
|
a3c215919d | ||
|
|
ab904a1047 | ||
|
|
60381f4d6c | ||
|
|
8f607295ae | ||
|
|
27218a95af | ||
|
|
8e150ad6bc | ||
|
|
c8914a890c | ||
|
|
b25a86f352 | ||
|
|
ec8e279235 | ||
|
|
1cc16029db | ||
|
|
5c912bcc62 | ||
|
|
b3742c8d3c | ||
|
|
c3a7516712 | ||
|
|
12319d5775 | ||
|
|
45e1965936 | ||
|
|
6091c8ec49 | ||
|
|
cfb7dab0f3 | ||
|
|
2d9f3cde0f | ||
|
|
e5f4770247 | ||
|
|
dc7c321514 | ||
|
|
40164659b1 | ||
|
|
7829f3d224 | ||
|
|
92359257c1 | ||
|
|
d2a2b3a8c4 | ||
|
|
4019eb65f2 | ||
|
|
4c5bead5c6 | ||
|
|
0163aae357 | ||
|
|
8fa23a94a0 | ||
|
|
8176d56c72 | ||
|
|
5add168743 | ||
|
|
27e59404d3 | ||
|
|
54f5ac7b8d | ||
|
|
5c688cc0b7 | ||
|
|
86efb0ea09 | ||
|
|
bc13666222 | ||
|
|
d1abde7d1a | ||
|
|
691db4d406 | ||
|
|
fb833b0c19 | ||
|
|
4d2181ad83 | ||
|
|
9dd291a96e | ||
|
|
1344803e7e | ||
|
|
4a5f8fa974 | ||
|
|
212e4a6407 | ||
|
|
d47123779e | ||
|
|
fc734a6371 | ||
|
|
02be5b808e | ||
|
|
0d757fdc40 | ||
|
|
0263a879c4 | ||
|
|
c309ed1c49 | ||
|
|
e58de14437 | ||
|
|
78a7fa1d14 | ||
|
|
77178a9583 | ||
|
|
d2ab33eb52 | ||
|
|
7b3194660c | ||
|
|
f627b25e9d | ||
|
|
1bbb7c9d3b | ||
|
|
08a4ae1f56 | ||
|
|
7c398f8019 | ||
|
|
6651023f7f | ||
|
|
021df666a3 | ||
|
|
d7e60cb6d0 | ||
|
|
4cd26e6860 | ||
|
|
946a3bf5c8 | ||
|
|
b10e6a01b2 | ||
|
|
e23341a118 | ||
|
|
4446fb13a3 | ||
|
|
4dfbde7716 | ||
|
|
3c03d4a1f3 | ||
|
|
a0ecdfff0b | ||
|
|
60023a23df | ||
|
|
e96442631c | ||
|
|
94750bfa3c | ||
|
|
5cc02555d0 | ||
|
|
6e2f7e2f38 | ||
|
|
de92cc32e6 | ||
|
|
e97205409d | ||
|
|
091d8e3dbf | ||
|
|
171ca53c29 | ||
|
|
5be61796d9 | ||
|
|
1aee1c6cb8 | ||
|
|
343f48b08c | ||
|
|
358ecfd2eb | ||
|
|
8066ad7e65 | ||
|
|
7ae0d0099d | ||
|
|
2e4fc41c9b | ||
|
|
71247ff556 | ||
|
|
5ef163f143 | ||
|
|
510cbfaa3f | ||
|
|
bd3fcab9c0 | ||
|
|
9841e6aa4c | ||
|
|
1bf125eebd | ||
|
|
f9936b8b54 | ||
|
|
d11aa6de06 | ||
|
|
1c4fccc0fd | ||
|
|
aa0323f04d | ||
|
|
2916e9dd11 | ||
|
|
6958d7abd4 | ||
|
|
9e661cb858 | ||
|
|
a972026c67 | ||
|
|
2b1bda7418 | ||
|
|
a6a3f3ed80 | ||
|
|
5cca51e978 | ||
|
|
7c971587dc | ||
|
|
40a13d4b86 | ||
|
|
a0971d016d | ||
|
|
410e9e3eb8 | ||
|
|
37813c3826 | ||
|
|
e00c243662 | ||
|
|
f504f5aac5 | ||
|
|
0b63f2c259 | ||
|
|
14fb27ce77 | ||
|
|
7da7d7b7e0 | ||
|
|
907add6acc | ||
|
|
f110e3ddcd | ||
|
|
ed206e5611 | ||
|
|
e4d8af175b | ||
|
|
ba7ddc8cdc | ||
|
|
389f5790a7 | ||
|
|
6071982dd9 | ||
|
|
f71c0bd4c3 | ||
|
|
50b45d013a | ||
|
|
93a047e77c | ||
|
|
a3bf0e8888 | ||
|
|
d8fa2f3e89 | ||
|
|
e361c5a5b3 | ||
|
|
3ef032cbaf | ||
|
|
36cf5a7ff3 | ||
|
|
6d930d6920 | ||
|
|
f676a8c9c1 | ||
|
|
941ffee2d3 | ||
|
|
0a71f3372f | ||
|
|
f817f68487 | ||
|
|
826975f392 | ||
|
|
5f244d3c31 | ||
|
|
71be34859f | ||
|
|
f9a4705c9c | ||
|
|
a546842792 | ||
|
|
ba86e20179 | ||
|
|
b32fc6f6e6 | ||
|
|
1f13a34687 | ||
|
|
f212b4850d | ||
|
|
1b4555afb6 | ||
|
|
358013c67e | ||
|
|
a98667ca05 | ||
|
|
02e9f4c333 | ||
|
|
d7951db01b | ||
|
|
21fba2df9f | ||
|
|
a4947139a6 | ||
|
|
c01e7580cd | ||
|
|
8b4f22ed75 | ||
|
|
669b76bf99 | ||
|
|
efee02ace7 | ||
|
|
cd8adf5611 | ||
|
|
d216106b88 | ||
|
|
6dd8fb12ad | ||
|
|
a4999575d0 | ||
|
|
fcaff8ff28 | ||
|
|
cf0b3e3212 | ||
|
|
bccb4150fd | ||
|
|
9a297b0eb5 | ||
|
|
9c4baf7645 | ||
|
|
73b2f20509 | ||
|
|
642690e692 | ||
|
|
1468c74c36 | ||
|
|
0bfa1ec2d0 | ||
|
|
7c74464d7a | ||
|
|
de051ac1ac | ||
|
|
ba0c4c413d | ||
|
|
7e6f5ef4f5 | ||
|
|
712eeb009f | ||
|
|
b54e28deb7 | ||
|
|
1f44cebac3 | ||
|
|
9c05e8392b | ||
|
|
9a67fec48a | ||
|
|
1966ac7979 | ||
|
|
8b624217c5 | ||
|
|
40499af9b9 | ||
|
|
b3bd359a0d | ||
|
|
de07e3f874 | ||
|
|
c7e8953b68 | ||
|
|
80e7fe4bf9 | ||
|
|
2bc199d7fc | ||
|
|
9b710d8e81 | ||
|
|
cc6a0ee98d | ||
|
|
c9492d79a1 | ||
|
|
94c4719c0d | ||
|
|
c253e8d7b8 | ||
|
|
98f12fb8e1 | ||
|
|
e05a40bb16 | ||
|
|
c73bb67486 | ||
|
|
3ad0cbc86d | ||
|
|
6402af7db9 | ||
|
|
6a41a79ded | ||
|
|
fbd9a804a9 | ||
|
|
694e1175a1 | ||
|
|
80dbd4cbfa | ||
|
|
d459f4ac7c | ||
|
|
2c5c4bfbea | ||
|
|
a1a68bb5d7 | ||
|
|
984a10c1b1 | ||
|
|
3c4c06cb5e | ||
|
|
8d28a5ca3f | ||
|
|
801c4a56c3 | ||
|
|
ea000e6ce7 | ||
|
|
6723cdfa07 | ||
|
|
2cf10711f5 | ||
|
|
bde171e947 | ||
|
|
2696615523 | ||
|
|
f98028d1d8 | ||
|
|
97475fc365 | ||
|
|
ea7aa52ea3 | ||
|
|
ec4ae5978b | ||
|
|
90d73143e1 | ||
|
|
249f0cd72c | ||
|
|
232cc1ab34 | ||
|
|
2cea31cb1b | ||
|
|
02c4d60861 | ||
|
|
8c9073308a | ||
|
|
8cb5455671 | ||
|
|
8bc44e3bff | ||
|
|
73f84baaec | ||
|
|
d3acace1c4 | ||
|
|
7f3539d001 | ||
|
|
3ef19f1ab1 | ||
|
|
749b2db846 | ||
|
|
a3e99b5d89 | ||
|
|
dbbb3fbb55 | ||
|
|
6eeac45d23 | ||
|
|
5669cc0a0b | ||
|
|
d986901a1c | ||
|
|
5394bbf06a | ||
|
|
d7b2f922b5 | ||
|
|
9ab55443eb | ||
|
|
67c7a43e6f | ||
|
|
26a4bfb838 | ||
|
|
e7a16b2e64 | ||
|
|
a5612ed668 | ||
|
|
f55d15692b | ||
|
|
107994859b | ||
|
|
a8d3689061 | ||
|
|
4fb4ec5328 | ||
|
|
9bc8519656 | ||
|
|
af36d2d8e5 | ||
|
|
6b0069f10f | ||
|
|
a64b629333 | ||
|
|
fc4cc977ed | ||
|
|
7483520c8c | ||
|
|
5d18fb8c70 | ||
|
|
1163bfac5c | ||
|
|
d643bbd7e4 | ||
|
|
32158935f8 | ||
|
|
50bf1ea784 | ||
|
|
fa29123c5e | ||
|
|
314c652818 | ||
|
|
a3dd60370e | ||
|
|
3d82567118 | ||
|
|
eaac5e02c0 | ||
|
|
3bd5703bdb | ||
|
|
bf80a75474 | ||
|
|
bea7016223 | ||
|
|
c8ff2b4612 | ||
|
|
6c673cd19b | ||
|
|
c1ae43e041 | ||
|
|
9605072200 | ||
|
|
9cabc7c222 | ||
|
|
b2b3391827 | ||
|
|
19e94b8889 | ||
|
|
4bee8c9ead | ||
|
|
3f1ae77306 | ||
|
|
9f6d6d7b37 | ||
|
|
adac412f58 | ||
|
|
31ca38515a | ||
|
|
4a35929979 | ||
|
|
4a0610f107 | ||
|
|
9a1b3d813a | ||
|
|
a7a4862491 | ||
|
|
5783536837 | ||
|
|
f8646d1a5d | ||
|
|
39bb7064e7 | ||
|
|
388bf6934d | ||
|
|
5122e9271c | ||
|
|
32b36435f8 | ||
|
|
807ad48bbc | ||
|
|
b5842314b4 | ||
|
|
efb4db2b86 | ||
|
|
ecbf8cd722 | ||
|
|
9992144130 | ||
|
|
1f9cba6f53 | ||
|
|
2465a6bdbd | ||
|
|
1a7199fd6b | ||
|
|
57f0a4c6d7 | ||
|
|
138cf77916 | ||
|
|
43d1ca89c2 | ||
|
|
51e619b18f | ||
|
|
21df7426e2 | ||
|
|
2f6b2ca0c7 | ||
|
|
cf1b9f9595 | ||
|
|
b0ec8339fa | ||
|
|
762748684e | ||
|
|
bdfd5880e9 | ||
|
|
9e55e5bcea | ||
|
|
887576e4a5 | ||
|
|
ccd1d6ab29 | ||
|
|
fcbb63ad60 | ||
|
|
1607e7914c | ||
|
|
68e98397ab | ||
|
|
3983d4f473 | ||
|
|
9eda959489 | ||
|
|
4880f9923c | ||
|
|
87e8a4290e | ||
|
|
fd96d59963 | ||
|
|
1a1771f0b5 | ||
|
|
22ed53260f | ||
|
|
77cf88a3bf | ||
|
|
695d74d7c5 | ||
|
|
a164735369 | ||
|
|
6ccea636b1 | ||
|
|
0ccaf76661 | ||
|
|
593f6f9f86 | ||
|
|
fbdda6df03 | ||
|
|
a7dcce3e8d | ||
|
|
ee5718003b | ||
|
|
a43065ec08 | ||
|
|
1740ee91da | ||
|
|
90f95306f9 | ||
|
|
0964f9175e | ||
|
|
dbde3f8826 | ||
|
|
33e08baf3f | ||
|
|
6e67ebab05 | ||
|
|
5fbc5303ff | ||
|
|
e582ad226a | ||
|
|
dfb71a3a50 | ||
|
|
5355f4f25e | ||
|
|
98c422d227 | ||
|
|
e18b577d20 | ||
|
|
7226df593e | ||
|
|
8a376f647e | ||
|
|
050087f6c4 | ||
|
|
c67e347255 | ||
|
|
3fdac985c7 | ||
|
|
02ff3e6258 | ||
|
|
65ce1b0bb5 | ||
|
|
7e8528104b | ||
|
|
40ac55acb6 | ||
|
|
42c639d252 | ||
|
|
d110b64ee4 | ||
|
|
a2617d810c | ||
|
|
90d07bc04c | ||
|
|
013d9db86f | ||
|
|
9d4d725bc7 | ||
|
|
9881cc9e10 | ||
|
|
01474fed0b | ||
|
|
024e6d8ae8 | ||
|
|
607ba653f7 | ||
|
|
9090c1904f | ||
|
|
158b762367 | ||
|
|
e8b3b2dc31 | ||
|
|
5d72eec742 | ||
|
|
6fe020c920 | ||
|
|
40c5a6af49 | ||
|
|
803dce242b | ||
|
|
4ed722ccd8 | ||
|
|
f35d479d5e | ||
|
|
f3af61de97 | ||
|
|
077fb89083 | ||
|
|
d4d4390846 | ||
|
|
33e54546fe | ||
|
|
bf008e0680 | ||
|
|
08694bd709 | ||
|
|
91242440fc | ||
|
|
68ae6fc212 | ||
|
|
14a16c2a7a | ||
|
|
9cbb50d3a6 | ||
|
|
47635b9978 | ||
|
|
f90c3f2483 | ||
|
|
5a67ecc142 | ||
|
|
a542f8ab54 | ||
|
|
f32349db7d | ||
|
|
32f5db3f72 | ||
|
|
670e3983b4 | ||
|
|
e1cc4d8552 | ||
|
|
8422bb37b0 | ||
|
|
ebf9b64062 | ||
|
|
56b397b506 | ||
|
|
de6cc79ac8 | ||
|
|
d28395fdb9 | ||
|
|
84b8ee7bda | ||
|
|
b56c732332 | ||
|
|
041c1b4586 | ||
|
|
0edc480d17 | ||
|
|
1a3bcb4ebd | ||
|
|
7d8c2a84b7 | ||
|
|
4faac431c4 | ||
|
|
df9ded3282 | ||
|
|
1fe8d1679e | ||
|
|
708505f2b1 | ||
|
|
b2da5ee1a7 | ||
|
|
315e751f43 | ||
|
|
dc5544223f | ||
|
|
c14728d31a | ||
|
|
7d4b154866 | ||
|
|
b69647a0c3 | ||
|
|
d054442e2c | ||
|
|
e50bf1fb44 | ||
|
|
d40b6a75da | ||
|
|
e124e7fb5f | ||
|
|
7c3a163f9c | ||
|
|
03af0791aa | ||
|
|
464885a539 | ||
|
|
346579ac7a | ||
|
|
76ed206e9b | ||
|
|
06e7c963ef | ||
|
|
573d902026 | ||
|
|
66cdfe5896 | ||
|
|
9afd4659c7 | ||
|
|
7249217600 | ||
|
|
2f20c672e0 | ||
|
|
6d02a64c47 | ||
|
|
3d078383cb | ||
|
|
64e765bf7a | ||
|
|
b5b6125730 | ||
|
|
e45984f6b8 | ||
|
|
a95cf1c26c | ||
|
|
4a19913726 | ||
|
|
52ae769bfa | ||
|
|
44d7c3887d | ||
|
|
315271996c | ||
|
|
2357704540 | ||
|
|
262049f737 | ||
|
|
04d6e351a6 | ||
|
|
9fa86ec712 | ||
|
|
901e3dcff2 |
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
|
||||
|
||||
41
.github/CONTRIBUTING.md
vendored
41
.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://jquery.org/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,
|
||||
@@ -13,27 +19,25 @@ Feature requests should be submitted in the
|
||||
[issue tracker](https://github.com/lodash/lodash/issues), with a description of
|
||||
the expected behavior & use case, where they’ll remain closed until sufficient interest,
|
||||
[e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/),
|
||||
has been shown by the community. Before submitting a request, please search for
|
||||
similar ones in the
|
||||
has been [shown by the community](https://github.com/lodash/lodash/issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).
|
||||
Before submitting a request, please search for similar ones in the
|
||||
[closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
For additions or bug fixes you should only need to modify `lodash.js`. Include
|
||||
updated unit tests in the `test` directory as part of your pull request. 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 [jQuery Foundation](https://jquery.org/).
|
||||
As such, we request that all contributors sign the jQuery Foundation
|
||||
[contributor license agreement (CLA)](https://contribute.jquery.org/CLA/).
|
||||
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://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
|
||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1,9 +1,8 @@
|
||||
.DS_Store
|
||||
*.custom.*
|
||||
*.log
|
||||
*.map
|
||||
lodash.compat.min.js
|
||||
coverage
|
||||
node_modules
|
||||
.opt-in
|
||||
.opt-out
|
||||
*.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,44 +0,0 @@
|
||||
var _ = require('./lodash.js');
|
||||
|
||||
function mockQuery() {
|
||||
return {
|
||||
'on': function(eventName, callback) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
mockQuery.each = _.each;
|
||||
|
||||
module.exports = {
|
||||
'babel': false,
|
||||
'globals': {
|
||||
'_': _,
|
||||
|
||||
// Example mocks.
|
||||
'asyncSave': _.noop,
|
||||
'addContactToList': _.noop,
|
||||
'batchLog': _.noop,
|
||||
'calculateLayout': _.noop,
|
||||
'createApplication': _.noop,
|
||||
'data': { 'user': 'mock'},
|
||||
'mainText': '',
|
||||
'renewToken': _.noop,
|
||||
'sendMail': _.noop,
|
||||
'updatePosition': _.noop,
|
||||
|
||||
// DOM mocks.
|
||||
'document': { 'body': { 'childNodes': [], 'nodeName': 'BODY' } },
|
||||
'element': {},
|
||||
'EventSource': _.noop,
|
||||
'jQuery': mockQuery,
|
||||
'window': {},
|
||||
|
||||
// Node.js mocks.
|
||||
'Buffer': Buffer,
|
||||
'fs': { 'writeFileSync': _.noop },
|
||||
'path': require('path'),
|
||||
'process': process,
|
||||
'setImmediate': setImmediate
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
86
.travis.yml
86
.travis.yml
@@ -1,86 +0,0 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "6"
|
||||
env:
|
||||
global:
|
||||
- BIN="node" ISTANBUL=false OPTION=""
|
||||
- SAUCE_LABS=false SAUCE_USERNAME="lodash"
|
||||
- secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
|
||||
matrix:
|
||||
-
|
||||
- BIN="phantomjs"
|
||||
- ISTANBUL=true
|
||||
- SAUCE_LABS=true
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "0.10"
|
||||
env:
|
||||
- node_js: "0.12"
|
||||
env:
|
||||
- node_js: "4"
|
||||
env:
|
||||
- node_js: "5"
|
||||
env:
|
||||
git:
|
||||
depth: 10
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
|
||||
on_success: change
|
||||
on_failure: always
|
||||
before_install:
|
||||
- "nvm use $TRAVIS_NODE_VERSION"
|
||||
- "npm set loglevel error"
|
||||
- "npm set progress false"
|
||||
- "npm i -g npm@\"^2.0.0\""
|
||||
- |
|
||||
PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|"
|
||||
PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|"
|
||||
PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
|
||||
PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|"
|
||||
PATTERN[4]="|\bcase\s+(?:dataView|promise|set|map|weakMap)CtorString:.+|g"
|
||||
PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
|
||||
PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
|
||||
PATTERN[7]="|\s*define\([\s\S]+?\);|"
|
||||
PATTERN[8]="|\s*root\._\s*=\s*_;|"
|
||||
|
||||
if [ $ISTANBUL == true ]; then
|
||||
set -e
|
||||
for PTRN in ${PATTERN[@]}; do
|
||||
node ./test/remove.js "$PTRN" ./lodash.js
|
||||
done
|
||||
fi
|
||||
- "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli"
|
||||
- "mkdir -p ./node_modules/lodash-cli/node_modules/lodash && cd $_ && cp ../../../../lodash.js ./lodash.js && cp ../../../../package.json ./package.json"
|
||||
- "cd ../../ && npm i && cd ../../"
|
||||
script:
|
||||
|
||||
# Detect code coverage.
|
||||
- "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js"
|
||||
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true"
|
||||
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true"
|
||||
|
||||
# Test in Node.js and PhantomJS.
|
||||
- "[ $ISTANBUL == true ] || node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
|
||||
- "[ $ISTANBUL == true ] || (node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./ && node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js)"
|
||||
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || cd ./test"
|
||||
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || $BIN $OPTION ./test.js ../lodash.js"
|
||||
- "[ $ISTANBUL == true ] || [ $SAUCE_LABS == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
|
||||
|
||||
# Test in Sauce Labs.
|
||||
- "[ $SAUCE_LABS == false ] || node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
|
||||
- "[ $SAUCE_LABS == false ] || npm run build"
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash-fp tests\" runner=\"test/fp.html?noglobals=true\" tags=\"development\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.js\" tags=\"development,underscore\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.min.js\" tags=\"production,underscore\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.js\" tags=\"development,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.min.js\" tags=\"production,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.js\" tags=\"development,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.min.js\" tags=\"production,backbone\""
|
||||
4
LICENSE
4
LICENSE
@@ -1,4 +1,6 @@
|
||||
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
The MIT License
|
||||
|
||||
Copyright JS Foundation and other contributors <https://js.foundation/>
|
||||
|
||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
66
README.md
66
README.md
@@ -1,46 +1,72 @@
|
||||
# lodash v4.12.0
|
||||
# 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/4.12.0/.github/CONTRIBUTING.md) |
|
||||
[Contributing](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md) |
|
||||
[Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") |
|
||||
[Code of Conduct](https://jquery.org/conduct/) |
|
||||
[Twitter](https://twitter.com/bestiejs) |
|
||||
[Chat](https://gitter.im/lodash/lodash)
|
||||
[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):
|
||||
```bash
|
||||
$ npm run build
|
||||
```shell
|
||||
$ bun run build
|
||||
$ lodash -o ./dist/lodash.js
|
||||
$ lodash core -o ./dist/lodash.core.js
|
||||
```
|
||||
|
||||
## Download
|
||||
|
||||
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.12.0/LICENSE) & supports [modern environments](#support).<br>
|
||||
* [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.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.
|
||||
|
||||
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.core.min.js))
|
||||
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.12.0/dist/lodash.min.js))
|
||||
* [CDN copies](https://www.jsdelivr.com/projects/lodash)
|
||||
## Installation
|
||||
|
||||
In a browser:
|
||||
```html
|
||||
<script src="lodash.js"></script>
|
||||
```
|
||||
|
||||
Using bun:
|
||||
```shell
|
||||
$ bun i lodash
|
||||
```
|
||||
|
||||
In [Bun](https://bun.sh):
|
||||
```js
|
||||
// Load the full build.
|
||||
var _ = require('lodash');
|
||||
// Load the core build.
|
||||
var _ = require('lodash/core');
|
||||
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
|
||||
var fp = require('lodash/fp');
|
||||
|
||||
// Load method categories.
|
||||
var array = require('lodash/array');
|
||||
var object = require('lodash/fp/object');
|
||||
|
||||
// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
|
||||
var at = require('lodash/at');
|
||||
var curryN = require('lodash/fp/curryN');
|
||||
```
|
||||
|
||||
Looking for Lodash modules written in ES6 or smaller bundle sizes? Check out [lodash-es](https://www.npmjs.com/package/lodash-es).
|
||||
|
||||
## Why Lodash?
|
||||
|
||||
Lodash makes JavaScript easier by taking the hassle out of working with arrays,<br>
|
||||
numbers, objects, strings, etc. Lodash’s modular methods are great for:
|
||||
|
||||
* Iterating arrays, objects, & strings
|
||||
* Manipulating & testing values
|
||||
* Creating composite functions
|
||||
* Iterating arrays, objects, & strings
|
||||
* Manipulating & testing values
|
||||
* Creating composite functions
|
||||
|
||||
## Module Formats
|
||||
|
||||
Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
|
||||
|
||||
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
|
||||
* [lodash-amd](https://www.npmjs.com/package/lodash-amd)
|
||||
* [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash)
|
||||
* [lodash/fp](https://github.com/lodash/lodash/tree/4.12.0-npm/fp)
|
||||
* [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)
|
||||
|
||||
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"
|
||||
3926
dist/lodash.core.js
vendored
3926
dist/lodash.core.js
vendored
File diff suppressed because it is too large
Load Diff
28
dist/lodash.core.min.js
vendored
28
dist/lodash.core.min.js
vendored
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return O(t,function(t){return n[t]})}function u(n){return n&&n.Object===Object?n:null}function o(n){return gn[n]}function i(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function c(n){return n instanceof f?n:new f(n)}function f(n,t){
|
||||
this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function l(n){return nn(n)?Bn(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(pn,r)},t)}function s(n,t){var r=true;return zn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===pn?i===i:r(i,c)))var c=i,f=o;
|
||||
}return f}function v(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=G),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Cn(n,t,on)}function b(n,t){return v(t,function(t){return Y(n[t])})}function _(n,t){return n>t}function d(n,t,r,e,u){return n===t?true:null==n||null==t||!nn(n)&&!tn(t)?n!==n&&t!==t:j(n,t,d,r,e,u)}function j(n,t,r,e,u,o){var c=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";
|
||||
c||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=V(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o),
|
||||
o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),K(t,function(t,r){
|
||||
return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(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 S(n){return N(n,0,n.length)}function T(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(t,r){return K(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function R(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){
|
||||
var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function B(n){return Q(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=n.length>3&&typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function D(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return nn(t)?t:r}}function I(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=D(n);return e}function $(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:pn;++c<i;){var l=n[c],p=t[c];if(void 0!==pn){f=false;break}if(a){if(!T(t,function(n,t){return U(a,t)||l!==n&&!r(l,n,e,u,o)?void 0:a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function q(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":
|
||||
return+n==+t;case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function z(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,
|
||||
r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),a}function C(n){var t=n?n.length:pn;if(Z(t)&&(Vn(n)||en(n)||W(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function G(n){return Vn(n)||W(n)}function J(n,t){return t=null==t?9007199254740991:t,!!t&&(typeof n=="number"||yn.test(n))&&n>-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En);
|
||||
}function P(n){return n&&n.length?n[0]:pn}function U(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function V(n,r){return t(n,m(r),zn)}function H(n,t){return zn(n,m(t))}function K(n,t,e){return r(n,m(t),e,3>arguments.length,zn)}function L(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}
|
||||
function Q(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function W(n){return tn(n)&&X(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n))}function X(n){return null!=n&&Z(Gn(n))&&!Y(n)}function Y(n){return n=nn(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n;
|
||||
}function Z(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object"}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length;
|
||||
for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t<u;){var f=e[t];i&&("length"==f||J(f,c))||"constructor"==f&&(r||!kn.call(n,f))||o.push(f)}return o}function fn(n){return n?e(n,on(n)):[]}function an(n){return n}function ln(t,r,e){var u=on(r),o=b(r,u);null!=e||nn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,on(r)));var i=!(nn(e)&&"chain"in e&&!e.chain),c=Y(t);return zn(o,function(e){
|
||||
var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max;
|
||||
f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(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}}(g),Cn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(w=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Gn=k("length"),Jn=String,Mn=Q(function(n,t,r){
|
||||
return I(n,t,r)}),Pn=Q(function(n,t){return p(n,1,t)}),Un=Q(function(n,t,r){return p(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=B(function(n,t){R(t,on(t),n)}),Qn=B(function(n,t){R(t,cn(t),n)}),Wn=B(function(n,t,r,e){R(t,cn(t),n,e)}),Xn=Q(function(n){return n.push(pn,a),Wn.apply(pn,n)}),Yn=Q(function(n,t){return null==n?{}:E(n,O(y(t,1),Jn))}),Zn=m;c.assignIn=Qn,c.before=L,c.bind=Mn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){
|
||||
for(var t=arguments.length,r=Array(t?t-1:0),e=arguments[0],u=t;u--;)r[u-1]=arguments[u];return t?n(Vn(e)?S(e):[e],y(r,1)):[]},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){
|
||||
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return L(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){
|
||||
r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=V,c.forEach=H,c.has=function(n,t){return null!=n&&kn.call(n,t);
|
||||
},c.head=P,c.identity=an,c.indexOf=U,c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)},c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn,
|
||||
c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn),this},c.noop=function(){},c.reduce=K,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n),
|
||||
n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=H,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.12.0",zn("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);c.prototype[n]=function(){
|
||||
var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this);
|
||||
860
dist/lodash.fp.js
vendored
860
dist/lodash.fp.js
vendored
@@ -1,860 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["fp"] = factory();
|
||||
else
|
||||
root["fp"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var baseConvert = __webpack_require__(1);
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Function} lodash The lodash function to convert.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function browserConvert(lodash, options) {
|
||||
return baseConvert(lodash, lodash, options);
|
||||
}
|
||||
|
||||
if (typeof _ == 'function') {
|
||||
_ = browserConvert(_.runInContext());
|
||||
}
|
||||
module.exports = browserConvert;
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 1 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var mapping = __webpack_require__(2),
|
||||
mutateMap = mapping.mutate,
|
||||
fallbackHolder = __webpack_require__(3);
|
||||
|
||||
/**
|
||||
* Creates a function, with an arity of `n`, that invokes `func` with the
|
||||
* arguments it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} n The arity of the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseArity(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func.apply(undefined, arguments); }
|
||||
: function(a) { return func.apply(undefined, arguments); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
|
||||
* any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseAry(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func(a, b); }
|
||||
: function(a) { return func(a); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to clone.
|
||||
* @returns {Array} Returns the cloned array.
|
||||
*/
|
||||
function cloneArray(array) {
|
||||
var length = array ? array.length : 0,
|
||||
result = Array(length);
|
||||
|
||||
while (length--) {
|
||||
result[length] = array[length];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that clones a given object using the assignment `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The assignment function.
|
||||
* @returns {Function} Returns the new cloner function.
|
||||
*/
|
||||
function createCloner(func) {
|
||||
return function(object) {
|
||||
return func({}, object);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and uses `cloner` to clone the first
|
||||
* argument it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {Function} cloner The function to clone arguments.
|
||||
* @returns {Function} Returns the new immutable function.
|
||||
*/
|
||||
function immutWrap(func, cloner) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var result = args[0] = cloner.apply(undefined, args);
|
||||
func.apply(undefined, args);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `convert` which accepts a `util` object of methods
|
||||
* required to perform conversions.
|
||||
*
|
||||
* @param {Object} util The util object.
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||
* @param {boolean} [options.curry=true] Specify currying.
|
||||
* @param {boolean} [options.fixed=true] Specify fixed arity.
|
||||
* @param {boolean} [options.immutable=true] Specify immutable operations.
|
||||
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function baseConvert(util, name, func, options) {
|
||||
var setPlaceholder,
|
||||
isLib = typeof name == 'function',
|
||||
isObj = name === Object(name);
|
||||
|
||||
if (isObj) {
|
||||
options = func;
|
||||
func = name;
|
||||
name = undefined;
|
||||
}
|
||||
if (func == null) {
|
||||
throw new TypeError;
|
||||
}
|
||||
options || (options = {});
|
||||
|
||||
var config = {
|
||||
'cap': 'cap' in options ? options.cap : true,
|
||||
'curry': 'curry' in options ? options.curry : true,
|
||||
'fixed': 'fixed' in options ? options.fixed : true,
|
||||
'immutable': 'immutable' in options ? options.immutable : true,
|
||||
'rearg': 'rearg' in options ? options.rearg : true
|
||||
};
|
||||
|
||||
var forceCurry = ('curry' in options) && options.curry,
|
||||
forceFixed = ('fixed' in options) && options.fixed,
|
||||
forceRearg = ('rearg' in options) && options.rearg,
|
||||
placeholder = isLib ? func : fallbackHolder,
|
||||
pristine = isLib ? func.runInContext() : undefined;
|
||||
|
||||
var helpers = isLib ? func : {
|
||||
'ary': util.ary,
|
||||
'assign': util.assign,
|
||||
'clone': util.clone,
|
||||
'curry': util.curry,
|
||||
'forEach': util.forEach,
|
||||
'isArray': util.isArray,
|
||||
'isFunction': util.isFunction,
|
||||
'iteratee': util.iteratee,
|
||||
'keys': util.keys,
|
||||
'rearg': util.rearg,
|
||||
'spread': util.spread,
|
||||
'toPath': util.toPath
|
||||
};
|
||||
|
||||
var ary = helpers.ary,
|
||||
assign = helpers.assign,
|
||||
clone = helpers.clone,
|
||||
curry = helpers.curry,
|
||||
each = helpers.forEach,
|
||||
isArray = helpers.isArray,
|
||||
isFunction = helpers.isFunction,
|
||||
keys = helpers.keys,
|
||||
rearg = helpers.rearg,
|
||||
spread = helpers.spread,
|
||||
toPath = helpers.toPath;
|
||||
|
||||
var aryMethodKeys = keys(mapping.aryMethod);
|
||||
|
||||
var wrappers = {
|
||||
'castArray': function(castArray) {
|
||||
return function() {
|
||||
var value = arguments[0];
|
||||
return isArray(value)
|
||||
? castArray(cloneArray(value))
|
||||
: castArray.apply(undefined, arguments);
|
||||
};
|
||||
},
|
||||
'iteratee': function(iteratee) {
|
||||
return function() {
|
||||
var func = arguments[0],
|
||||
arity = arguments[1],
|
||||
result = iteratee(func, arity),
|
||||
length = result.length;
|
||||
|
||||
if (config.cap && typeof arity == 'number') {
|
||||
arity = arity > 2 ? (arity - 2) : 1;
|
||||
return (length && length <= arity) ? result : baseAry(result, arity);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
},
|
||||
'mixin': function(mixin) {
|
||||
return function(source) {
|
||||
var func = this;
|
||||
if (!isFunction(func)) {
|
||||
return mixin(func, Object(source));
|
||||
}
|
||||
var 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;
|
||||
};
|
||||
},
|
||||
'runInContext': function(runInContext) {
|
||||
return function(context) {
|
||||
return baseConvert(util, runInContext(context), options);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a clone of `object` by `path`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to clone.
|
||||
* @param {Array|string} path The path to clone by.
|
||||
* @returns {Object} Returns the cloned object.
|
||||
*/
|
||||
function cloneByPath(object, path) {
|
||||
path = toPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
lastIndex = length - 1,
|
||||
result = clone(Object(object)),
|
||||
nested = result;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = path[index],
|
||||
value = nested[key];
|
||||
|
||||
if (value != null) {
|
||||
nested[path[index]] = clone(index == lastIndex ? value : Object(value));
|
||||
}
|
||||
nested = nested[key];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function convertLib(options) {
|
||||
return _.runInContext.convert(options)(undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a converter function for `func` of `name`.
|
||||
*
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @returns {Function} Returns the new converter function.
|
||||
*/
|
||||
function createConverter(name, func) {
|
||||
var oldOptions = options;
|
||||
return function(options) {
|
||||
var newUtil = isLib ? pristine : helpers,
|
||||
newFunc = isLib ? pristine[name] : func,
|
||||
newOptions = assign(assign({}, oldOptions), options);
|
||||
|
||||
return baseConvert(newUtil, name, newFunc, newOptions);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
|
||||
* arguments, ignoring any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap iteratee arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeAry(func, n) {
|
||||
return overArg(func, function(func) {
|
||||
return typeof func == 'function' ? baseAry(func, n) : func;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee with arguments
|
||||
* arranged according to the specified `indexes` where the argument value at
|
||||
* the first index is provided as the first argument, the argument value at
|
||||
* the second index is provided as the second argument, and so on.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to rearrange iteratee arguments for.
|
||||
* @param {number[]} indexes The arranged argument indexes.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeRearg(func, indexes) {
|
||||
return overArg(func, function(func) {
|
||||
var n = indexes.length;
|
||||
return baseArity(rearg(baseAry(func, n), indexes), n);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with its first argument passed
|
||||
* thru `transform`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...Function} transform The functions to transform the first argument.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function overArg(func, transform) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return func();
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var index = config.rearg ? 0 : (length - 1);
|
||||
args[index] = transform(args[index]);
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and applys the conversions
|
||||
* rules by `name`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} func The function to wrap.
|
||||
* @returns {Function} Returns the converted function.
|
||||
*/
|
||||
function wrap(name, func) {
|
||||
name = mapping.aliasToReal[name] || name;
|
||||
|
||||
var result,
|
||||
wrapped = func,
|
||||
wrapper = wrappers[name];
|
||||
|
||||
if (wrapper) {
|
||||
wrapped = wrapper(func);
|
||||
}
|
||||
else if (config.immutable) {
|
||||
if (mutateMap.array[name]) {
|
||||
wrapped = immutWrap(func, cloneArray);
|
||||
}
|
||||
else if (mutateMap.object[name]) {
|
||||
wrapped = immutWrap(func, createCloner(func));
|
||||
}
|
||||
else if (mutateMap.set[name]) {
|
||||
wrapped = immutWrap(func, cloneByPath);
|
||||
}
|
||||
}
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(otherName) {
|
||||
if (name == otherName) {
|
||||
var aryN = !isLib && mapping.iterateeAry[name],
|
||||
reargIndexes = mapping.iterateeRearg[name],
|
||||
spreadStart = mapping.methodSpread[name];
|
||||
|
||||
result = wrapped;
|
||||
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||
result = spreadStart === undefined
|
||||
? ary(result, aryKey)
|
||||
: spread(result, spreadStart);
|
||||
}
|
||||
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
|
||||
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
|
||||
}
|
||||
if (config.cap) {
|
||||
if (reargIndexes) {
|
||||
result = iterateeRearg(result, reargIndexes);
|
||||
} else if (aryN) {
|
||||
result = iterateeAry(result, aryN);
|
||||
}
|
||||
}
|
||||
if (forceCurry || (config.curry && aryKey > 1)) {
|
||||
forceCurry && console.log(forceCurry, name);
|
||||
result = curry(result, aryKey);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
result || (result = wrapped);
|
||||
if (result == func) {
|
||||
result = forceCurry ? curry(result, 1) : function() {
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
result.convert = createConverter(name, func);
|
||||
if (mapping.placeholder[name]) {
|
||||
setPlaceholder = true;
|
||||
result.placeholder = func.placeholder = placeholder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (!isObj) {
|
||||
return wrap(name, func);
|
||||
}
|
||||
var _ = func;
|
||||
|
||||
// Convert methods by ary cap.
|
||||
var pairs = [];
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(key) {
|
||||
var func = _[mapping.remap[key] || key];
|
||||
if (func) {
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Convert remaining methods.
|
||||
each(keys(_), function(key) {
|
||||
var func = _[key];
|
||||
if (typeof func == 'function') {
|
||||
var length = pairs.length;
|
||||
while (length--) {
|
||||
if (pairs[length][0] == key) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
func.convert = createConverter(key, func);
|
||||
pairs.push([key, func]);
|
||||
}
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
_.convert = convertLib;
|
||||
if (setPlaceholder) {
|
||||
_.placeholder = placeholder;
|
||||
}
|
||||
// Assign aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.realToAlias[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
module.exports = baseConvert;
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 2 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'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',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
|
||||
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
|
||||
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
|
||||
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
|
||||
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
|
||||
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
|
||||
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
|
||||
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
|
||||
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
|
||||
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
|
||||
'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
|
||||
|
||||
/***/ },
|
||||
/* 3 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/**
|
||||
* The default argument placeholder value for methods.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = {};
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
16
dist/lodash.fp.min.js
vendored
16
dist/lodash.fp.min.js
vendored
@@ -1,16 +0,0 @@
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())),
|
||||
t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(!r)return i;for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n),
|
||||
i}}function u(t,e,r,d){function f(t,e){e=F(e);for(var r=-1,n=e.length,i=n-1,a=M(Object(t)),o=a;null!=o&&++r<n;){var s=e[r],u=o[s];null!=u&&(o[e[r]]=M(r==i?u:Object(u))),o=o[s]}return a}function h(t){return N.runInContext.convert(t)(void 0)}function y(t,e){var r=d;return function(n){var i=R?B:j,a=R?B[t]:e,o=w(w({},r),n);return u(i,t,a,o)}}function g(t,e){return v(t,function(t){return"function"==typeof t?i(t,e):t})}function m(t,e){return v(t,function(t){var r=e.length;return n(L(i(t,r),e),r)})}function v(t,e){
|
||||
return function(){var r=arguments.length;if(!r)return t();for(var n=Array(r);r--;)n[r]=arguments[r];var i=I.rearg?0:r-1;return n[i]=e(n[i]),t.apply(void 0,n)}}function x(t,e){t=p.aliasToReal[t]||t;var r,n=e,i=_[t];return i?n=i(e):I.immutable&&(l.array[t]?n=s(e,a):l.object[t]?n=s(e,o(e)):l.set[t]&&(n=s(e,f))),P(T,function(e){return P(p.aryMethod[e],function(i){if(t==i){var a=!R&&p.iterateeAry[t],o=p.iterateeRearg[t],s=p.methodSpread[t];return r=n,!I.fixed||!k&&p.skipFixed[t]||(r=void 0===s?C(r,e):D(r,s)),
|
||||
I.rearg&&e>1&&(E||!p.skipRearg[t])&&(r=L(r,p.methodRearg[t]||p.aryRearg[e])),I.cap&&(o?r=m(r,o):a&&(r=g(r,a))),(b||I.curry&&e>1)&&(b&&console.log(b,t),r=q(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=b?q(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=O),r}var W,R="function"==typeof e,A=e===Object(e);if(A&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var I={cap:"cap"in d?d.cap:!0,curry:"curry"in d?d.curry:!0,fixed:"fixed"in d?d.fixed:!0,
|
||||
immutable:"immutable"in d?d.immutable:!0,rearg:"rearg"in d?d.rearg:!0},b="curry"in d&&d.curry,k="fixed"in d&&d.fixed,E="rearg"in d&&d.rearg,O=R?r:c,B=R?r.runInContext():void 0,j=R?r:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isFunction:t.isFunction,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,spread:t.spread,toPath:t.toPath},C=j.ary,w=j.assign,M=j.clone,q=j.curry,P=j.forEach,S=j.isArray,z=j.isFunction,K=j.keys,L=j.rearg,D=j.spread,F=j.toPath,T=K(p.aryMethod),_={
|
||||
castArray:function(t){return function(){var e=arguments[0];return S(e)?t(a(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],r=arguments[1],n=t(e,r),a=n.length;return I.cap&&"number"==typeof r?(r=r>2?r-2:1,a&&r>=a?n:i(n,r)):n}},mixin:function(t){return function(e){var r=this;if(!z(r))return t(r,Object(e));var n=[];return P(K(e),function(t){z(e[t])&&n.push([t,r.prototype[t]])}),t(r,Object(e)),P(n,function(t){var e=t[1];z(e)?r.prototype[t[0]]=e:delete r.prototype[t[0]];
|
||||
}),r}},runInContext:function(e){return function(r){return u(t,e(r),d)}}};if(!A)return x(e,r);var N=r,V=[];return P(T,function(t){P(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),P(K(N),function(t){var e=N[t];if("function"==typeof e){for(var r=V.length;r--;)if(V[r][0]==t)return;e.convert=y(t,e),V.push([t,e])}}),P(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=O),P(K(N),function(t){P(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),l=p.mutate,c=r(3);
|
||||
t.exports=u},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendWith:"assignInWith",first:"head",__:"placeholder",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",equals:"isEqual",identical:"eq",init:"initial",invertObj:"invert",juxt:"over",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",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},e.aryMethod={1:["attempt","castArray","ceil","create","curry","curryRight","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"],
|
||||
2:["add","after","ary","assign","assignIn","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],
|
||||
3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],
|
||||
4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],getOr:[2,1,0],isEqualWith:[1,2,0],
|
||||
isMatchWith:[2,1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],updateWith:[3,1,2,0],zipWith:[1,2,0]},e.methodSpread={invokeArgs:2,invokeArgsMap:2,partial:1,partialRight:1,without:1},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,
|
||||
merge:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={curryN:"curry",curryRightN:"curryRight",getOr:"get",invokeArgs:"invoke",invokeArgsMap:"invokeMap",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",restFrom:"rest",
|
||||
spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,without:!0,zip:!0,zipObject:!0}},function(t,e){t.exports={}}])});
|
||||
16242
dist/lodash.js
vendored
16242
dist/lodash.js
vendored
File diff suppressed because it is too large
Load Diff
125
dist/lodash.min.js
vendored
125
dist/lodash.min.js
vendored
@@ -1,125 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t.length;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t.length;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=t.length;r--&&false!==n(t[r],r,t););return t}function i(t,n){
|
||||
for(var r=-1,e=t.length;++r<e;)if(!n(t[r],r,t))return false;return true}function f(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function c(t,n){return!!t.length&&-1<d(t,n,0)}function a(t,n,r){for(var e=-1,u=t.length;++e<u;)if(r(n,t[e]))return true;return false}function l(t,n){for(var r=-1,e=t.length,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function s(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function h(t,n,r,e){var u=-1,o=t.length;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);
|
||||
return r}function p(t,n,r,e){var u=t.length;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function _(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return true;return false}function v(t,n,r,e){var u;return r(t,function(t,r,o){return n(t,r,o)?(u=e?r:t,false):void 0}),u}function g(t,n,r){for(var e=t.length,u=r?e:-1;r?u--:++u<e;)if(n(t[u],u,t))return u;return-1}function d(t,n,r){if(n!==n)return M(t,r);--r;for(var e=t.length;++r<e;)if(t[r]===n)return r;return-1}function y(t,n,r,e){--r;for(var u=t.length;++r<u;)if(e(t[r],n))return r;
|
||||
return-1}function b(t,n){var r=t?t.length:0;return r?w(t,n)/r:V}function x(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=false,t):n(r,t,u,o)}),r}function j(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].c;return t}function w(t,n){for(var r,e=-1,u=t.length;++e<u;){var o=n(t[e]);o!==T&&(r=r===T?o:r+o)}return r}function m(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function A(t,n){return l(n,function(n){return[n,t[n]]})}function O(t){return function(n){return t(n)}}function k(t,n){return l(n,function(n){
|
||||
return t[n]})}function E(t,n){return t.has(n)}function I(t,n){for(var r=-1,e=t.length;++r<e&&-1<d(n,t[r],0););return r}function S(t,n){for(var r=t.length;r--&&-1<d(n,t[r],0););return r}function R(t){return t&&t.Object===Object?t:null}function W(t){return zt[t]}function B(t){return Ut[t]}function L(t){return"\\"+$t[t]}function M(t,n,r){var e=t.length;for(n+=r?0:-1;r?n--:++n<e;){var u=t[n];if(u!==u)return n}return-1}function C(t){var n=false;if(null!=t&&typeof t.toString!="function")try{n=!!(t+"")}catch(r){}
|
||||
return n}function z(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function U(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function D(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];i!==n&&"__lodash_placeholder__"!==i||(t[r]="__lodash_placeholder__",o[u++]=r)}return o}function F(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function $(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=[t,t]}),r}function N(t){
|
||||
if(!t||!Wt.test(t))return t.length;for(var n=St.lastIndex=0;St.test(t);)n++;return n}function P(t){return Dt[t]}function Z(R){function At(t){if(De(t)&&!ai(t)&&!(t instanceof zt)){if(t instanceof kt)return t;if(wu.call(t,"__wrapped__"))return ie(t)}return new kt(t)}function Ot(){}function kt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=T}function zt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],
|
||||
this.__takeCount__=4294967295,this.__views__=[]}function Ut(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Dt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Ft(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function $t(t){var n=-1,r=t?t.length:0;for(this.__data__=new Ft;++n<r;)this.add(t[n])}function Zt(t){this.__data__=new Dt(t)}function Tt(t,n,r,e){return t===T||Se(t,bu[r])&&!wu.call(e,r)?n:t;
|
||||
}function Vt(t,n,r){(r===T||Se(t[n],r))&&(typeof n!="number"||r!==T||n in t)||(t[n]=r)}function Kt(t,n,r){var e=t[n];wu.call(t,n)&&Se(e,r)&&(r!==T||n in t)||(t[n]=r)}function Gt(t,n){for(var r=t.length;r--;)if(Se(t[r][0],n))return r;return-1}function Ht(t,n,r,e){return go(t,function(t,u,o){n(e,t,r(t),o)}),e}function Qt(t,n){return t&&ar(n,nu(n),t)}function Xt(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r<u;)o[r]=e?T:Xe(t,n[r]);return o}function tn(t,n,r){return t===t&&(r!==T&&(t=r>=t?t:r),
|
||||
n!==T&&(t=t>=n?t:n)),t}function nn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==T)return c;if(!Ue(t))return t;if(o=ai(t)){if(c=Tr(t),!n)return cr(t,c)}else{var a=Pr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(li(t))return er(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(C(t))return i?t:{};if(c=qr(l?{}:t),!n)return lr(t,Qt(c,t))}else{if(!Ct[a])return i?t:{};c=Vr(t,a,nn,n)}}if(f||(f=new Zt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?vn(t,nu,Nr):nu(t);
|
||||
return u(s||t,function(u,o){s&&(o=u,u=t[o]),Kt(c,o,nn(u,n,r,e,o,t,f))}),c}function rn(t){var n=nu(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===T&&!(o in Object(e))||!i(f))return false}return true}}function en(t){return Ue(t)?zu(t):{}}function un(t,n,r){if(typeof t!="function")throw new du("Expected a function");return Du(function(){t.apply(T,r)},n)}function on(t,n,r,e){var u=-1,o=c,i=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,O(r))),e?(o=a,
|
||||
i=false):n.length>=200&&(o=E,i=false,n=new $t(n));t:for(;++u<f;){var p=t[u],_=r?r(p):p,p=e||0!==p?p:0;if(i&&_===_){for(var v=h;v--;)if(n[v]===_)continue t;s.push(p)}else o(n,_,e)||s.push(p)}return s}function fn(t,n){var r=true;return go(t,function(t,e,u){return r=!!n(t,e,u)}),r}function cn(t,n,r){for(var e=-1,u=t.length;++e<u;){var o=t[e],i=n(o);if(null!=i&&(f===T?i===i&&!Te(i):r(i,f)))var f=i,c=o}return c}function an(t,n){var r=[];return go(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function ln(t,n,r,e,u){
|
||||
var o=-1,i=t.length;for(r||(r=Gr),u||(u=[]);++o<i;){var f=t[o];n>0&&r(f)?n>1?ln(f,n-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function sn(t,n){return t&&bo(t,n,nu)}function hn(t,n){return t&&xo(t,n,nu)}function pn(t,n){return f(n,function(n){return Me(t[n])})}function _n(t,n){n=Qr(n,t)?[n]:nr(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[ue(n[r++])];return r&&r==e?t:T}function vn(t,n,r){return n=n(t),ai(t)?n:s(n,r(t))}function gn(t,n){return t>n}function dn(t,n){return wu.call(t,n)||typeof t=="object"&&n in t&&null===Pu(Object(t));
|
||||
}function yn(t,n){return n in Object(t)}function bn(t,n,r){for(var e=r?a:c,u=t[0].length,o=t.length,i=o,f=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=l(p,O(n))),s=Ku(p.length,s),f[i]=!r&&(n||u>=120&&p.length>=120)?new $t(i&&p):T}var p=t[0],_=-1,v=f[0];t:for(;++_<u&&s>h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!E(v,d):!e(h,d,r)){for(i=o;--i;){var y=f[i];if(y?!E(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function xn(t,n,r){var e={};return sn(t,function(t,u,o){n(e,r(t),u,o);
|
||||
}),e}function jn(t,n,e){return Qr(n,t)||(n=nr(n),t=ee(t,n),n=le(n)),n=null==t?t:t[ue(n)],null==n?T:r(n,t,e)}function wn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Ue(t)&&!De(n))n=t!==t&&n!==n;else t:{var o=ai(t),i=ai(n),f="[object Array]",c="[object Array]";o||(f=Pr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Pr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!C(t),i="[object Object]"==c&&!C(n);if((c=f==c)&&!a)u||(u=new Zt),n=o||qe(t)?Lr(t,n,wn,r,e,u):Mr(t,n,f,wn,r,e,u);else{
|
||||
if(!(2&e)&&(o=a&&wu.call(t,"__wrapped__"),f=i&&wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new Zt),n=wn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Zt),o=2&e,f=nu(t),i=f.length,c=nu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:dn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{c=true,u.set(t,n);for(var s=o;++a<i;){var l=f[a],h=t[l],p=n[l];if(r)var _=o?r(p,h,l,n,t,u):r(h,p,l,t,n,u);if(_===T?h!==p&&!wn(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(r=t.constructor,
|
||||
e=n.constructor,r!=e&&"constructor"in t&&"constructor"in n&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),u["delete"](t),n=c}}else n=false;else n=false}}return n}function mn(t,n,r,e){var u=r.length,o=u,i=!e;if(null==t)return!o;for(t=Object(t);u--;){var f=r[u];if(i&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return false}for(;++u<o;){var f=r[u],c=f[0],a=t[c],l=f[1];if(i&&f[2]){if(a===T&&!(c in t))return false}else{if(f=new Zt,e)var s=e(a,l,c,t,n,f);if(s===T?!wn(l,a,e,3,f):!s)return false;
|
||||
}}return true}function An(t){return typeof t=="function"?t:null==t?cu:typeof t=="object"?ai(t)?Sn(t[0],t[1]):In(t):hu(t)}function On(t){t=null==t?t:Object(t);var n,r=[];for(n in t)r.push(n);return r}function kn(t,n){return n>t}function En(t,n){var r=-1,e=We(t)?Array(t.length):[];return go(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function In(t){var n=Fr(t);return 1==n.length&&n[0][2]?ne(n[0][0],n[0][1]):function(r){return r===t||mn(r,t,n)}}function Sn(t,n){return Qr(t)&&n===n&&!Ue(n)?ne(ue(t),n):function(r){
|
||||
var e=Xe(r,t);return e===T&&e===n?tu(r,t):wn(n,e,T,3)}}function Rn(t,n,r,e,o){if(t!==n){if(!ai(n)&&!qe(n))var i=ru(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),Ue(u)){o||(o=new Zt);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Vt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):T,p=h===T;p&&(h=s,ai(s)||qe(s)?ai(l)?h=l:Be(l)?h=cr(l):(p=false,h=nn(s,true)):Ne(s)||Re(s)?Re(l)?h=He(l):!Ue(l)||r&&Me(l)?(p=false,h=nn(s,true)):h=l:p=false),a.set(s,h),p&&Rn(h,s,r,e,a),a["delete"](s),Vt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):T,c===T&&(c=u),
|
||||
Vt(t,f,c)})}}function Wn(t,n){var r=t.length;return r?(n+=0>n?r:0,Yr(n,r)?t[n]:T):void 0}function Bn(t,n,r){var e=-1;return n=l(n.length?n:[cu],O(Ur())),t=En(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),j(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e<i;){var c=or(u[e],o[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Ln(t,n){return t=Object(t),h(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Mn(t,n){for(var r=-1,e=vn(t,ru,Oo),u=e.length,o={};++r<u;){
|
||||
var i=e[r],f=t[i];n(f,i)&&(o[i]=f)}return o}function Cn(t){return function(n){return null==n?T:n[t]}}function zn(t){return function(n){return _n(n,t)}}function Un(t,n,r,e){var u=e?y:d,o=-1,i=n.length,f=t;for(r&&(f=l(t,O(r)));++o<i;)for(var c=0,a=n[o],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==t&&Fu.call(f,c,1),Fu.call(t,c,1);return t}function Dn(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(r==e||u!==o){var o=u;if(Yr(u))Fu.call(t,u,1);else if(Qr(u,t))delete t[ue(u)];else{var u=nr(u),i=ee(t,u);null!=i&&delete i[ue(le(u))];
|
||||
}}}}function Fn(t,n){return t+Nu(Ju()*(n-t+1))}function $n(t,n){var r="";if(!t||1>n||n>9007199254740991)return r;do n%2&&(r+=t),(n=Nu(n/2))&&(t+=t);while(n);return r}function Nn(t,n,r,e){n=Qr(n,t)?[n]:nr(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){var c=ue(n[u]);if(Ue(f)){var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):T;a===T&&(a=null==l?Yr(n[u+1])?[]:{}:l)}Kt(f,c,a)}f=f[c]}return t}function Pn(t,n,r){var e=-1,u=t.length;for(0>n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e<u;)r[e]=t[e+n];
|
||||
return r}function Zn(t,n){var r;return go(t,function(t,e,u){return r=n(t,e,u),!r}),!!r}function Tn(t,n,r){var e=0,u=t?t.length:e;if(typeof n=="number"&&n===n&&2147483647>=u){for(;u>e;){var o=e+u>>>1,i=t[o];null!==i&&!Te(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u}return qn(t,n,cu,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Te(n),a=n===T;o>u;){var l=Nu((u+o)/2),s=r(t[l]),h=s!==T,p=null===s,_=s===s,v=Te(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l;
|
||||
}return Ku(o,4294967294)}function Vn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r],f=n?n(i):i;if(!r||!Se(f,c)){var c=f;o[u++]=0===i?0:i}}return o}function Kn(t){return typeof t=="number"?t:Te(t)?V:+t}function Gn(t){if(typeof t=="string")return t;if(Te(t))return vo?vo.call(t):"";var n=t+"";return"0"==n&&1/t==-q?"-0":n}function Jn(t,n,r){var e=-1,u=c,o=t.length,i=true,f=[],l=f;if(r)i=false,u=a;else if(o>=200){if(u=n?null:wo(t))return F(u);i=false,u=E,l=new $t}else l=n?[]:f;t:for(;++e<o;){var s=t[e],h=n?n(s):s,s=r||0!==s?s:0;
|
||||
if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function Yn(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?Pn(t,e?0:o,e?o+1:u):Pn(t,e?o+1:0,e?u:o)}function Hn(t,n){var r=t;return r instanceof zt&&(r=r.value()),h(n,function(t,n){return n.func.apply(n.thisArg,s([t],n.args))},r)}function Qn(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?s(on(o,t[e],n,r),on(t[e],o,n,r)):t[e];return o&&o.length?Jn(o,n,r):[];
|
||||
}function Xn(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;)r(i,t[e],o>e?n[e]:T);return i}function tr(t){return Be(t)?t:[]}function nr(t){return ai(t)?t:Eo(t)}function rr(t,n,r){var e=t.length;return r=r===T?e:r,!n&&r>=e?t:Pn(t,n,r)}function er(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ur(t){var n=new t.constructor(t.byteLength);return new Wu(n).set(new Wu(t)),n}function or(t,n){if(t!==n){var r=t!==T,e=null===t,u=t===t,o=Te(t),i=n!==T,f=null===n,c=n===n,a=Te(n);
|
||||
if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function ir(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Vu(o-i,0),l=Array(c+a);for(e=!e;++f<c;)l[f]=n[f];for(;++u<i;)(e||o>u)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function fr(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Vu(o-f,0),s=Array(l+a);for(e=!e;++u<l;)s[u]=t[u];for(l=u;++c<a;)s[l+c]=n[c];for(;++i<f;)(e||o>u)&&(s[l+r[i]]=t[u++]);
|
||||
return s}function cr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function ar(t,n,r,e){r||(r={});for(var u=-1,o=n.length;++u<o;){var i=n[u],f=e?e(r[i],t[i],i,r,t):t[i];Kt(r,i,f)}return r}function lr(t,n){return ar(t,Nr(t),n)}function sr(t,n){return function(r,u){var o=ai(r)?e:Ht,i=n?n():{};return o(r,t,Ur(u),i)}}function hr(t){return Ie(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:T,i=u>2?r[2]:T,o=t.length>3&&typeof o=="function"?(u--,o):T;for(i&&Hr(r[0],r[1],i)&&(o=3>u?T:o,
|
||||
u=1),n=Object(n);++e<u;)(i=r[e])&&t(n,i,e,o);return n})}function pr(t,n){return function(r,e){if(null==r)return r;if(!We(r))return t(r,e);for(var u=r.length,o=n?u:-1,i=Object(r);(n?o--:++o<u)&&false!==e(i[o],o,i););return r}}function _r(t){return function(n,r,e){var u=-1,o=Object(n);e=e(n);for(var i=e.length;i--;){var f=e[t?i:++u];if(false===r(o[f],f,o))break}return n}}function vr(t,n,r){function e(){return(this&&this!==Jt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=yr(t);return e}function gr(t){
|
||||
return function(n){n=Qe(n);var r=Wt.test(n)?n.match(St):T,e=r?r[0]:n.charAt(0);return n=r?rr(r,1).join(""):n.slice(1),e[t]()+n}}function dr(t){return function(n){return h(iu(ou(n).replace(Et,"")),t,"")}}function yr(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);
|
||||
case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var r=en(t.prototype),n=t.apply(r,n);return Ue(n)?n:r}}function br(t,n,e){function u(){for(var i=arguments.length,f=Array(i),c=i,a=zr(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:D(f,a),i-=c.length,e>i?Sr(t,n,jr,u.placeholder,T,f,c,T,T,e-i):r(this&&this!==Jt&&this instanceof u?o:t,this,f)}var o=yr(t);return u}function xr(t){return Ie(function(n){n=ln(n,1);var r=n.length,e=r,u=kt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];
|
||||
if(typeof o!="function")throw new du("Expected a function");if(u&&!i&&"wrapper"==Cr(o))var i=new kt([],true)}for(e=i?e:r;++e<r;)var o=n[e],u=Cr(o),f="wrapper"==u?mo(o):T,i=f&&Xr(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[Cr(f[0])].apply(i,f[3]):1==o.length&&Xr(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&ai(e)&&e.length>=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++u<r;)t=n[u].call(this,t);return t}})}function jr(t,n,r,e,u,o,i,f,c,a){function l(){
|
||||
for(var d=arguments.length,y=Array(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=zr(l),b=y.length;for(x=0;b--;)y[b]===j&&x++}if(e&&(y=ir(y,e,u,_)),o&&(y=fr(y,o,i,_)),d-=x,_&&a>d)return j=D(y,j),Sr(t,n,jr,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[t]:t,d=y.length,f){x=y.length;for(var w=Ku(f.length,x),m=cr(y);w--;){var A=f[w];y[w]=Yr(A,x)?m[A]:T}}else v&&d>1&&y.reverse();return s&&d>c&&(y.length=c),this&&this!==Jt&&this instanceof l&&(b=g||yr(b)),b.apply(j,y)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?T:yr(t);
|
||||
return l}function wr(t,n){return function(r,e){return xn(r,t,n(e))}}function mr(t){return function(n,r){var e;if(n===T&&r===T)return 0;if(n!==T&&(e=n),r!==T){if(e===T)return r;typeof n=="string"||typeof r=="string"?(n=Gn(n),r=Gn(r)):(n=Kn(n),r=Kn(r)),e=t(n,r)}return e}}function Ar(t){return Ie(function(n){return n=1==n.length&&ai(n[0])?l(n[0],O(Ur())):l(ln(n,1,Jr),O(Ur())),Ie(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Or(t,n){n=n===T?" ":Gn(n);var r=n.length;return 2>r?r?$n(n,t):n:(r=$n(n,$u(t/N(n))),
|
||||
Wt.test(n)?rr(r.match(St),0,t).join(""):r.slice(0,t))}function kr(t,n,e,u){function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Jt&&this instanceof o?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++n];return r(h,i?e:this,s)}var i=1&n,f=yr(t);return o}function Er(t){return function(n,r,e){e&&typeof e!="number"&&Hr(n,r,e)&&(r=e=T),n=Ye(n),n=n===n?n:0,r===T?(r=n,n=0):r=Ye(r)||0,e=e===T?r>n?1:-1:Ye(e)||0;var u=-1;r=Vu($u((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,
|
||||
n+=e;return o}}function Ir(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=Ye(n),r=Ye(r)),t(n,r)}}function Sr(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:T;i=l?T:i;var h=l?o:T;return o=l?T:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(T,n),Xr(t)&&ko(r,n),r.placeholder=e,r}function Rr(t){var n=vu[t];return function(t,r){if(t=Ye(t),r=Ge(r)){var e=(Qe(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(Qe(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t);
|
||||
}}function Wr(t){return function(n){var r=Pr(n);return"[object Map]"==r?U(n):"[object Set]"==r?$(n):A(n,t(n))}}function Br(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new du("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=T),i=i===T?i:Vu(Ge(i),0),f=f===T?f:Ge(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=T}var h=c?T:mo(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],
|
||||
n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?ir(e,r,h[4]):r,o[4]=e?D(o[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=o[5],o[5]=e?fr(e,r,h[6]):r,o[6]=e?D(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:Ku(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Vu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?jo:ko)(n&&1!=n?8==n||16==n?br(t,n,f):32!=n&&33!=n||u.length?jr.apply(T,o):kr(t,n,r,e):vr(t,n,r),o)}function Lr(t,n,r,e,u,o){
|
||||
var i=2&u,f=t.length,c=n.length;if(f!=c&&!(i&&c>f))return false;if(c=o.get(t))return c==n;var c=-1,a=true,l=1&u?new $t:T;for(o.set(t,n);++c<f;){var s=t[c],h=n[c];if(e)var p=i?e(h,s,c,n,t,o):e(s,h,c,t,n,o);if(p!==T){if(p)continue;a=false;break}if(l){if(!_(n,function(t,n){return l.has(n)||s!==t&&!r(s,t,e,u,o)?void 0:l.add(n)})){a=false;break}}else if(s!==h&&!r(s,h,e,u,o)){a=false;break}}return o["delete"](t),a}function Mr(t,n,r,e,u,o,i){switch(r){case"[object DataView]":if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)break;
|
||||
t=t.buffer,n=n.buffer;case"[object ArrayBuffer]":if(t.byteLength!=n.byteLength||!e(new Wu(t),new Wu(n)))break;return true;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object Error]":return t.name==n.name&&t.message==n.message;case"[object Number]":return t!=+t?n!=+n:t==+n;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var f=U;case"[object Set]":if(f||(f=F),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),Lr(f(t),f(n),e,u,o,i));case"[object Symbol]":
|
||||
if(_o)return _o.call(t)==_o.call(n)}return false}function Cr(t){for(var n=t.name+"",r=fo[n],e=wu.call(fo,n)?r.length:0;e--;){var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function zr(t){return(wu.call(At,"placeholder")?At:t).placeholder}function Ur(){var t=At.iteratee||au,t=t===au?An:t;return arguments.length?t(arguments[0],arguments[1]):t}function Dr(t,n){var r=t.__data__,e=typeof n;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n)?r[typeof n=="string"?"string":"hash"]:r.map;
|
||||
}function Fr(t){t=Ei(t);for(var n=t.length;n--;){var r=t[n][1];t[n][2]=r===r&&!Ue(r)}return t}function $r(t,n){var r=t[n];return Fe(r)?r:T}function Nr(t){return Mu(Object(t))}function Pr(t){return Ou.call(t)}function Zr(t,n,r){n=Qr(n,t)?[n]:nr(n);for(var e,u=-1,o=n.length;++u<o;){var i=ue(n[u]);if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&ze(o)&&Yr(i,o)&&(ai(t)||Ze(t)||Re(t)))}function Tr(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&wu.call(t,"index")&&(r.index=t.index,
|
||||
r.input=t.input),r}function qr(t){return typeof t.constructor!="function"||te(t)?{}:en(Pu(Object(t)))}function Vr(r,e,u,o){var i=r.constructor;switch(e){case"[object ArrayBuffer]":return ur(r);case"[object Boolean]":case"[object Date]":return new i(+r);case"[object DataView]":return e=o?ur(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":
|
||||
case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return e=o?ur(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);case"[object Map]":return e=o?u(U(r),true):U(r),h(e,t,new r.constructor);case"[object Number]":case"[object String]":return new i(r);case"[object RegExp]":return e=new r.constructor(r.source,_t.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=o?u(F(r),true):F(r),h(e,n,new r.constructor);case"[object Symbol]":return _o?Object(_o.call(r)):{};
|
||||
}}function Kr(t){var n=t?t.length:T;return ze(n)&&(ai(t)||Ze(t)||Re(t))?m(n,String):null}function Gr(t){return ai(t)||Re(t)}function Jr(t){return ai(t)&&!(2==t.length&&!Me(t[0]))}function Yr(t,n){return n=null==n?9007199254740991:n,!!n&&(typeof t=="number"||xt.test(t))&&t>-1&&0==t%1&&n>t}function Hr(t,n,r){if(!Ue(r))return false;var e=typeof n;return("number"==e?We(r)&&Yr(n,r.length):"string"==e&&n in r)?Se(r[n],t):false}function Qr(t,n){if(ai(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Te(t)?true:ut.test(t)||!et.test(t)||null!=n&&t in Object(n);
|
||||
}function Xr(t){var n=Cr(t),r=At[n];return typeof r=="function"&&n in zt.prototype?t===r?true:(n=mo(r),!!n&&t===n[0]):false}function te(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||bu)}function ne(t,n){return function(r){return null==r?false:r[t]===n&&(n!==T||t in Object(r))}}function re(t,n,r,e,u,o){return Ue(t)&&Ue(n)&&Rn(t,n,T,re,o.set(n,t)),t}function ee(t,n){return 1==n.length?t:_n(t,Pn(n,0,-1))}function ue(t){if(typeof t=="string"||Te(t))return t;var n=t+"";return"0"==n&&1/t==-q?"-0":n;
|
||||
}function oe(t){if(null!=t){try{return ju.call(t)}catch(n){}return t+""}return""}function ie(t){if(t instanceof zt)return t.clone();var n=new kt(t.__wrapped__,t.__chain__);return n.__actions__=cr(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}function fe(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),Pn(t,0>n?0:n,e)):[]}function ce(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function ae(t){return t&&t.length?t[0]:T}function le(t){var n=t?t.length:0;
|
||||
return n?t[n-1]:T}function se(t,n){return t&&t.length&&n&&n.length?Un(t,n):t}function he(t){return t?Hu.call(t):t}function pe(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){return Be(t)?(n=Vu(t.length,n),true):void 0}),m(n,function(n){return l(t,Cn(n))})}function _e(t,n){if(!t||!t.length)return[];var e=pe(t);return null==n?e:l(e,function(t){return r(n,T,t)})}function ve(t){return t=At(t),t.__chain__=true,t}function ge(t,n){return n(t)}function de(){return this}function ye(t,n){return(ai(t)?u:go)(t,Ur(n,3));
|
||||
}function be(t,n){return(ai(t)?o:yo)(t,Ur(n,3))}function xe(t,n){return(ai(t)?l:En)(t,Ur(n,3))}function je(t,n,r){var e=-1,u=Ve(t),o=u.length,i=o-1;for(n=(r?Hr(t,n,r):n===T)?1:tn(Ge(n),0,o);++e<n;)t=Fn(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,u}function we(t,n,r){return n=r?T:n,n=t&&null==n?t.length:n,Br(t,128,T,T,T,T,n)}function me(t,n){var r;if(typeof n!="function")throw new du("Expected a function");return t=Ge(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=T),r}}function Ae(t,n,r){
|
||||
return n=r?T:n,t=Br(t,8,T,T,T,T,T,n),t.placeholder=Ae.placeholder,t}function Oe(t,n,r){return n=r?T:n,t=Br(t,16,T,T,T,T,T,n),t.placeholder=Oe.placeholder,t}function ke(t,n,r){function e(n){var r=c,e=a;return c=a=T,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,!p||r>=n||0>r||g&&t>=l}function o(){var t=Qo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?Ku(t,l-r):t,h=Du(o,r)}function i(t){return Bu(h),h=T,d&&c?e(t):(c=a=T,s)}function f(){var t=Qo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===T)return _=t=p,
|
||||
h=Du(o,n),v?e(t):s;if(g)return Bu(h),h=Du(o,n),e(p)}return h===T&&(h=Du(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new du("Expected a function");return n=Ye(n)||0,Ue(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Vu(Ye(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&Bu(h),p=_=0,c=a=h=T},f.flush=function(){return h===T?s:i(Qo())},f}function Ee(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),
|
||||
r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new du("Expected a function");return r.cache=new(Ee.Cache||Ft),r}function Ie(t,n){if(typeof t!="function")throw new du("Expected a function");return n=Vu(n===T?t.length-1:Ge(n),0),function(){for(var e=arguments,u=-1,o=Vu(e.length-n,0),i=Array(o);++u<o;)i[u]=e[n+u];switch(n){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}for(o=Array(n+1),u=-1;++u<n;)o[u]=e[u];return o[n]=i,
|
||||
r(t,this,o)}}function Se(t,n){return t===n||t!==t&&n!==n}function Re(t){return Be(t)&&wu.call(t,"callee")&&(!Uu.call(t,"callee")||"[object Arguments]"==Ou.call(t))}function We(t){return null!=t&&ze(Ao(t))&&!Me(t)}function Be(t){return De(t)&&We(t)}function Le(t){return De(t)?"[object Error]"==Ou.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Me(t){return t=Ue(t)?Ou.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function Ce(t){return typeof t=="number"&&t==Ge(t);
|
||||
}function ze(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t}function Ue(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function De(t){return!!t&&typeof t=="object"}function Fe(t){return Ue(t)?(Me(t)||C(t)?Eu:yt).test(oe(t)):false}function $e(t){return typeof t=="number"||De(t)&&"[object Number]"==Ou.call(t)}function Ne(t){return!De(t)||"[object Object]"!=Ou.call(t)||C(t)?false:(t=Pu(Object(t)),null===t?true:(t=wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&ju.call(t)==Au));
|
||||
}function Pe(t){return Ue(t)&&"[object RegExp]"==Ou.call(t)}function Ze(t){return typeof t=="string"||!ai(t)&&De(t)&&"[object String]"==Ou.call(t)}function Te(t){return typeof t=="symbol"||De(t)&&"[object Symbol]"==Ou.call(t)}function qe(t){return De(t)&&ze(t.length)&&!!Mt[Ou.call(t)]}function Ve(t){if(!t)return[];if(We(t))return Ze(t)?t.match(St):cr(t);if(Cu&&t[Cu])return z(t[Cu]());var n=Pr(t);return("[object Map]"==n?U:"[object Set]"==n?F:eu)(t)}function Ke(t){return t?(t=Ye(t),t===q||t===-q?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0;
|
||||
}function Ge(t){t=Ke(t);var n=t%1;return t===t?n?t-n:t:0}function Je(t){return t?tn(Ge(t),0,4294967295):0}function Ye(t){if(typeof t=="number")return t;if(Te(t))return V;if(Ue(t)&&(t=Me(t.valueOf)?t.valueOf():t,t=Ue(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ct,"");var n=dt.test(t);return n||bt.test(t)?Pt(t.slice(2),n?2:8):gt.test(t)?V:+t}function He(t){return ar(t,ru(t))}function Qe(t){return null==t?"":Gn(t)}function Xe(t,n,r){return t=null==t?T:_n(t,n),t===T?r:t}function tu(t,n){
|
||||
return null!=t&&Zr(t,n,yn)}function nu(t){var n=te(t);if(!n&&!We(t))return qu(Object(t));var r,e=Kr(t),u=!!e,e=e||[],o=e.length;for(r in t)!dn(t,r)||u&&("length"==r||Yr(r,o))||n&&"constructor"==r||e.push(r);return e}function ru(t){for(var n=-1,r=te(t),e=On(t),u=e.length,o=Kr(t),i=!!o,o=o||[],f=o.length;++n<u;){var c=e[n];i&&("length"==c||Yr(c,f))||"constructor"==c&&(r||!wu.call(t,c))||o.push(c)}return o}function eu(t){return t?k(t,nu(t)):[]}function uu(t){return zi(Qe(t).toLowerCase())}function ou(t){
|
||||
return(t=Qe(t))&&t.replace(jt,W).replace(It,"")}function iu(t,n,r){return t=Qe(t),n=r?T:n,n===T&&(n=Bt.test(t)?Rt:st),t.match(n)||[]}function fu(t){return function(){return t}}function cu(t){return t}function au(t){return An(typeof t=="function"?t:nn(t,true))}function lu(t,n,r){var e=nu(n),o=pn(n,e);null!=r||Ue(n)&&(o.length||!e.length)||(r=n,n=t,t=this,o=pn(n,nu(n)));var i=!(Ue(r)&&"chain"in r&&!r.chain),f=Me(t);return u(o,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){var n=this.__chain__;
|
||||
if(i||n){var r=t(this.__wrapped__);return(r.__actions__=cr(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function su(){}function hu(t){return Qr(t)?Cn(ue(t)):zn(t)}R=R?Yt.defaults({},R,Yt.pick(Jt,Lt)):Jt;var pu=R.Date,_u=R.Error,vu=R.Math,gu=R.RegExp,du=R.TypeError,yu=R.Array.prototype,bu=R.Object.prototype,xu=R.String.prototype,ju=R.Function.prototype.toString,wu=bu.hasOwnProperty,mu=0,Au=ju.call(Object),Ou=bu.toString,ku=Jt._,Eu=gu("^"+ju.call(wu).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Iu=qt?R.Buffer:T,Su=R.Reflect,Ru=R.Symbol,Wu=R.Uint8Array,Bu=R.clearTimeout,Lu=Su?Su.f:T,Mu=Object.getOwnPropertySymbols,Cu=typeof(Cu=Ru&&Ru.iterator)=="symbol"?Cu:T,zu=Object.create,Uu=bu.propertyIsEnumerable,Du=R.setTimeout,Fu=yu.splice,$u=vu.ceil,Nu=vu.floor,Pu=Object.getPrototypeOf,Zu=R.isFinite,Tu=yu.join,qu=Object.keys,Vu=vu.max,Ku=vu.min,Gu=R.parseInt,Ju=vu.random,Yu=xu.replace,Hu=yu.reverse,Qu=xu.split,Xu=$r(R,"DataView"),to=$r(R,"Map"),no=$r(R,"Promise"),ro=$r(R,"Set"),eo=$r(R,"WeakMap"),uo=$r(Object,"create"),oo=eo&&new eo,io=!Uu.call({
|
||||
valueOf:1},"valueOf"),fo={},co=oe(Xu),ao=oe(to),lo=oe(no),so=oe(ro),ho=oe(eo),po=Ru?Ru.prototype:T,_o=po?po.valueOf:T,vo=po?po.toString:T;At.templateSettings={escape:tt,evaluate:nt,interpolate:rt,variable:"",imports:{_:At}},At.prototype=Ot.prototype,At.prototype.constructor=At,kt.prototype=en(Ot.prototype),kt.prototype.constructor=kt,zt.prototype=en(Ot.prototype),zt.prototype.constructor=zt,Ut.prototype.clear=function(){this.__data__=uo?uo(null):{}},Ut.prototype["delete"]=function(t){return this.has(t)&&delete this.__data__[t];
|
||||
},Ut.prototype.get=function(t){var n=this.__data__;return uo?(t=n[t],"__lodash_hash_undefined__"===t?T:t):wu.call(n,t)?n[t]:T},Ut.prototype.has=function(t){var n=this.__data__;return uo?n[t]!==T:wu.call(n,t)},Ut.prototype.set=function(t,n){return this.__data__[t]=uo&&n===T?"__lodash_hash_undefined__":n,this},Dt.prototype.clear=function(){this.__data__=[]},Dt.prototype["delete"]=function(t){var n=this.__data__;return t=Gt(n,t),0>t?false:(t==n.length-1?n.pop():Fu.call(n,t,1),true)},Dt.prototype.get=function(t){
|
||||
var n=this.__data__;return t=Gt(n,t),0>t?T:n[t][1]},Dt.prototype.has=function(t){return-1<Gt(this.__data__,t)},Dt.prototype.set=function(t,n){var r=this.__data__,e=Gt(r,t);return 0>e?r.push([t,n]):r[e][1]=n,this},Ft.prototype.clear=function(){this.__data__={hash:new Ut,map:new(to||Dt),string:new Ut}},Ft.prototype["delete"]=function(t){return Dr(this,t)["delete"](t)},Ft.prototype.get=function(t){return Dr(this,t).get(t)},Ft.prototype.has=function(t){return Dr(this,t).has(t)},Ft.prototype.set=function(t,n){
|
||||
return Dr(this,t).set(t,n),this},$t.prototype.add=$t.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},$t.prototype.has=function(t){return this.__data__.has(t)},Zt.prototype.clear=function(){this.__data__=new Dt},Zt.prototype["delete"]=function(t){return this.__data__["delete"](t)},Zt.prototype.get=function(t){return this.__data__.get(t)},Zt.prototype.has=function(t){return this.__data__.has(t)},Zt.prototype.set=function(t,n){var r=this.__data__;return r instanceof Dt&&200==r.__data__.length&&(r=this.__data__=new Ft(r.__data__)),
|
||||
r.set(t,n),this};var go=pr(sn),yo=pr(hn,true),bo=_r(),xo=_r(true);Lu&&!Uu.call({valueOf:1},"valueOf")&&(On=function(t){return z(Lu(t))});var jo=oo?function(t,n){return oo.set(t,n),t}:cu,wo=ro&&1/F(new ro([,-0]))[1]==q?function(t){return new ro(t)}:su,mo=oo?function(t){return oo.get(t)}:su,Ao=Cn("length");Mu||(Nr=function(){return[]});var Oo=Mu?function(t){for(var n=[];t;)s(n,Nr(t)),t=Pu(Object(t));return n}:Nr;(Xu&&"[object DataView]"!=Pr(new Xu(new ArrayBuffer(1)))||to&&"[object Map]"!=Pr(new to)||no&&"[object Promise]"!=Pr(no.resolve())||ro&&"[object Set]"!=Pr(new ro)||eo&&"[object WeakMap]"!=Pr(new eo))&&(Pr=function(t){
|
||||
var n=Ou.call(t);if(t=(t="[object Object]"==n?t.constructor:T)?oe(t):T)switch(t){case co:return"[object DataView]";case ao:return"[object Map]";case lo:return"[object Promise]";case so:return"[object Set]";case ho:return"[object WeakMap]"}return n});var ko=function(){var t=0,n=0;return function(r,e){var u=Qo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return jo(r,e)}}(),Eo=Ee(function(t){var n=[];return Qe(t).replace(ot,function(t,r,e,u){n.push(e?u.replace(ht,"$1"):r||t)}),n}),Io=Ie(function(t,n){
|
||||
return Be(t)?on(t,ln(n,1,Be,true)):[]}),So=Ie(function(t,n){var r=le(n);return Be(r)&&(r=T),Be(t)?on(t,ln(n,1,Be,true),Ur(r)):[]}),Ro=Ie(function(t,n){var r=le(n);return Be(r)&&(r=T),Be(t)?on(t,ln(n,1,Be,true),T,r):[]}),Wo=Ie(function(t){var n=l(t,tr);return n.length&&n[0]===t[0]?bn(n):[]}),Bo=Ie(function(t){var n=le(t),r=l(t,tr);return n===le(r)?n=T:r.pop(),r.length&&r[0]===t[0]?bn(r,Ur(n)):[]}),Lo=Ie(function(t){var n=le(t),r=l(t,tr);return n===le(r)?n=T:r.pop(),r.length&&r[0]===t[0]?bn(r,T,n):[]}),Mo=Ie(se),Co=Ie(function(t,n){
|
||||
n=ln(n,1);var r=t?t.length:0,e=Xt(t,n);return Dn(t,l(n,function(t){return Yr(t,r)?+t:t}).sort(or)),e}),zo=Ie(function(t){return Jn(ln(t,1,Be,true))}),Uo=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Jn(ln(t,1,Be,true),Ur(n))}),Do=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Jn(ln(t,1,Be,true),T,n)}),Fo=Ie(function(t,n){return Be(t)?on(t,n):[]}),$o=Ie(function(t){return Qn(f(t,Be))}),No=Ie(function(t){var n=le(t);return Be(n)&&(n=T),Qn(f(t,Be),Ur(n))}),Po=Ie(function(t){var n=le(t);return Be(n)&&(n=T),
|
||||
Qn(f(t,Be),T,n)}),Zo=Ie(pe),To=Ie(function(t){var n=t.length,n=n>1?t[n-1]:T,n=typeof n=="function"?(t.pop(),n):T;return _e(t,n)}),qo=Ie(function(t){function n(n){return Xt(n,t)}t=ln(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof zt&&Yr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ge,args:[n],thisArg:T}),new kt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(T),t})):this.thru(n)}),Vo=sr(function(t,n,r){wu.call(t,r)?++t[r]:t[r]=1;
|
||||
}),Ko=sr(function(t,n,r){wu.call(t,r)?t[r].push(n):t[r]=[n]}),Go=Ie(function(t,n,e){var u=-1,o=typeof n=="function",i=Qr(n),f=We(t)?Array(t.length):[];return go(t,function(t){var c=o?n:i&&null!=t?t[n]:T;f[++u]=c?r(c,t,e):jn(t,n,e)}),f}),Jo=sr(function(t,n,r){t[r]=n}),Yo=sr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Ho=Ie(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Hr(t,n[0],n[1])?n=[]:r>2&&Hr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&ai(n[0])?n[0]:ln(n,1,Jr),Bn(t,n,[]);
|
||||
}),Qo=pu.now,Xo=Ie(function(t,n,r){var e=1;if(r.length)var u=D(r,zr(Xo)),e=32|e;return Br(t,e,n,r,u)}),ti=Ie(function(t,n,r){var e=3;if(r.length)var u=D(r,zr(ti)),e=32|e;return Br(n,e,t,r,u)}),ni=Ie(function(t,n){return un(t,1,n)}),ri=Ie(function(t,n,r){return un(t,Ye(n)||0,r)});Ee.Cache=Ft;var ei=Ie(function(t,n){n=1==n.length&&ai(n[0])?l(n[0],O(Ur())):l(ln(n,1,Jr),O(Ur()));var e=n.length;return Ie(function(u){for(var o=-1,i=Ku(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]);return r(t,this,u)})}),ui=Ie(function(t,n){
|
||||
var r=D(n,zr(ui));return Br(t,32,T,n,r)}),oi=Ie(function(t,n){var r=D(n,zr(oi));return Br(t,64,T,n,r)}),ii=Ie(function(t,n){return Br(t,256,T,T,T,ln(n,1))}),fi=Ir(gn),ci=Ir(function(t,n){return t>=n}),ai=Array.isArray,li=Iu?function(t){return t instanceof Iu}:fu(false),si=Ir(kn),hi=Ir(function(t,n){return n>=t}),pi=hr(function(t,n){if(io||te(n)||We(n))ar(n,nu(n),t);else for(var r in n)wu.call(n,r)&&Kt(t,r,n[r])}),_i=hr(function(t,n){if(io||te(n)||We(n))ar(n,ru(n),t);else for(var r in n)Kt(t,r,n[r])}),vi=hr(function(t,n,r,e){
|
||||
ar(n,ru(n),t,e)}),gi=hr(function(t,n,r,e){ar(n,nu(n),t,e)}),di=Ie(function(t,n){return Xt(t,ln(n,1))}),yi=Ie(function(t){return t.push(T,Tt),r(vi,T,t)}),bi=Ie(function(t){return t.push(T,re),r(Ai,T,t)}),xi=wr(function(t,n,r){t[n]=r},fu(cu)),ji=wr(function(t,n,r){wu.call(t,n)?t[n].push(r):t[n]=[r]},Ur),wi=Ie(jn),mi=hr(function(t,n,r){Rn(t,n,r)}),Ai=hr(function(t,n,r,e){Rn(t,n,r,e)}),Oi=Ie(function(t,n){return null==t?{}:(n=l(ln(n,1),ue),Ln(t,on(vn(t,ru,Oo),n)))}),ki=Ie(function(t,n){return null==t?{}:Ln(t,l(ln(n,1),ue));
|
||||
}),Ei=Wr(nu),Ii=Wr(ru),Si=dr(function(t,n,r){return n=n.toLowerCase(),t+(r?uu(n):n)}),Ri=dr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Wi=dr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Bi=gr("toLowerCase"),Li=dr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Mi=dr(function(t,n,r){return t+(r?" ":"")+zi(n)}),Ci=dr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),zi=gr("toUpperCase"),Ui=Ie(function(t,n){try{return r(t,T,n)}catch(e){return Le(e)?e:new _u(e)}}),Di=Ie(function(t,n){
|
||||
return u(ln(n,1),function(n){n=ue(n),t[n]=Xo(t[n],t)}),t}),Fi=xr(),$i=xr(true),Ni=Ie(function(t,n){return function(r){return jn(r,t,n)}}),Pi=Ie(function(t,n){return function(r){return jn(t,r,n)}}),Zi=Ar(l),Ti=Ar(i),qi=Ar(_),Vi=Er(),Ki=Er(true),Gi=mr(function(t,n){return t+n}),Ji=Rr("ceil"),Yi=mr(function(t,n){return t/n}),Hi=Rr("floor"),Qi=mr(function(t,n){return t*n}),Xi=Rr("round"),tf=mr(function(t,n){return t-n});return At.after=function(t,n){if(typeof n!="function")throw new du("Expected a function");
|
||||
return t=Ge(t),function(){return 1>--t?n.apply(this,arguments):void 0}},At.ary=we,At.assign=pi,At.assignIn=_i,At.assignInWith=vi,At.assignWith=gi,At.at=di,At.before=me,At.bind=Xo,At.bindAll=Di,At.bindKey=ti,At.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ai(t)?t:[t]},At.chain=ve,At.chunk=function(t,n,r){if(n=(r?Hr(t,n,r):n===T)?1:Vu(Ge(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array($u(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},At.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++n<r;){
|
||||
var o=t[n];o&&(u[e++]=o)}return u},At.concat=function(){for(var t=arguments.length,n=Array(t?t-1:0),r=arguments[0],e=t;e--;)n[e-1]=arguments[e];return t?s(ai(r)?cr(r):[r],ln(n,1)):[]},At.cond=function(t){var n=t?t.length:0,e=Ur();return t=n?l(t,function(t){if("function"!=typeof t[1])throw new du("Expected a function");return[e(t[0]),t[1]]}):[],Ie(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e)}})},At.conforms=function(t){return rn(nn(t,true))},At.constant=fu,At.countBy=Vo,
|
||||
At.create=function(t,n){var r=en(t);return n?Qt(r,n):r},At.curry=Ae,At.curryRight=Oe,At.debounce=ke,At.defaults=yi,At.defaultsDeep=bi,At.defer=ni,At.delay=ri,At.difference=Io,At.differenceBy=So,At.differenceWith=Ro,At.drop=fe,At.dropRight=ce,At.dropRightWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3),true,true):[]},At.dropWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3),true):[]},At.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&Hr(t,n,r)&&(r=0,e=u),u=t.length,
|
||||
r=Ge(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Ge(e),0>e&&(e+=u),e=r>e?0:Je(e);e>r;)t[r++]=n;return t},At.filter=function(t,n){return(ai(t)?f:an)(t,Ur(n,3))},At.flatMap=function(t,n){return ln(xe(t,n),1)},At.flatMapDeep=function(t,n){return ln(xe(t,n),q)},At.flatMapDepth=function(t,n,r){return r=r===T?1:Ge(r),ln(xe(t,n),r)},At.flatten=function(t){return t&&t.length?ln(t,1):[]},At.flattenDeep=function(t){return t&&t.length?ln(t,q):[]},At.flattenDepth=function(t,n){return t&&t.length?(n=n===T?1:Ge(n),ln(t,n)):[];
|
||||
},At.flip=function(t){return Br(t,512)},At.flow=Fi,At.flowRight=$i,At.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n<r;){var u=t[n];e[u[0]]=u[1]}return e},At.functions=function(t){return null==t?[]:pn(t,nu(t))},At.functionsIn=function(t){return null==t?[]:pn(t,ru(t))},At.groupBy=Ko,At.initial=function(t){return ce(t,1)},At.intersection=Wo,At.intersectionBy=Bo,At.intersectionWith=Lo,At.invert=xi,At.invertBy=ji,At.invokeMap=Go,At.iteratee=au,At.keyBy=Jo,At.keys=nu,At.keysIn=ru,At.map=xe,
|
||||
At.mapKeys=function(t,n){var r={};return n=Ur(n,3),sn(t,function(t,e,u){r[n(t,e,u)]=t}),r},At.mapValues=function(t,n){var r={};return n=Ur(n,3),sn(t,function(t,e,u){r[e]=n(t,e,u)}),r},At.matches=function(t){return In(nn(t,true))},At.matchesProperty=function(t,n){return Sn(t,nn(n,true))},At.memoize=Ee,At.merge=mi,At.mergeWith=Ai,At.method=Ni,At.methodOf=Pi,At.mixin=lu,At.negate=function(t){if(typeof t!="function")throw new du("Expected a function");return function(){return!t.apply(this,arguments)}},At.nthArg=function(t){
|
||||
return t=Ge(t),Ie(function(n){return Wn(n,t)})},At.omit=Oi,At.omitBy=function(t,n){return n=Ur(n),Mn(t,function(t,r){return!n(t,r)})},At.once=function(t){return me(2,t)},At.orderBy=function(t,n,r,e){return null==t?[]:(ai(n)||(n=null==n?[]:[n]),r=e?T:r,ai(r)||(r=null==r?[]:[r]),Bn(t,n,r))},At.over=Zi,At.overArgs=ei,At.overEvery=Ti,At.overSome=qi,At.partial=ui,At.partialRight=oi,At.partition=Yo,At.pick=ki,At.pickBy=function(t,n){return null==t?{}:Mn(t,Ur(n))},At.property=hu,At.propertyOf=function(t){
|
||||
return function(n){return null==t?T:_n(t,n)}},At.pull=Mo,At.pullAll=se,At.pullAllBy=function(t,n,r){return t&&t.length&&n&&n.length?Un(t,n,Ur(r)):t},At.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?Un(t,n,T,r):t},At.pullAt=Co,At.range=Vi,At.rangeRight=Ki,At.rearg=ii,At.reject=function(t,n){var r=ai(t)?f:an;return n=Ur(n,3),r(t,function(t,r,e){return!n(t,r,e)})},At.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=Ur(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i),
|
||||
u.push(e))}return Dn(t,u),r},At.rest=Ie,At.reverse=he,At.sampleSize=je,At.set=function(t,n,r){return null==t?t:Nn(t,n,r)},At.setWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null==t?t:Nn(t,n,r,e)},At.shuffle=function(t){return je(t,4294967295)},At.slice=function(t,n,r){var e=t?t.length:0;return e?(r&&typeof r!="number"&&Hr(t,n,r)?(n=0,r=e):(n=null==n?0:Ge(n),r=r===T?e:Ge(r)),Pn(t,n,r)):[]},At.sortBy=Ho,At.sortedUniq=function(t){return t&&t.length?Vn(t):[]},At.sortedUniqBy=function(t,n){
|
||||
return t&&t.length?Vn(t,Ur(n)):[]},At.split=function(t,n,r){return r&&typeof r!="number"&&Hr(t,n,r)&&(n=r=T),r=r===T?4294967295:r>>>0,r?(t=Qe(t))&&(typeof n=="string"||null!=n&&!Pe(n))&&(n=Gn(n),""==n&&Wt.test(t))?rr(t.match(St),0,r):Qu.call(t,n,r):[]},At.spread=function(t,n){if(typeof t!="function")throw new du("Expected a function");return n=n===T?0:Vu(Ge(n),0),Ie(function(e){var u=e[n];return e=rr(e,0,n),u&&s(e,u),r(t,this,e)})},At.tail=function(t){return fe(t,1)},At.take=function(t,n,r){return t&&t.length?(n=r||n===T?1:Ge(n),
|
||||
Pn(t,0,0>n?0:n)):[]},At.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===T?1:Ge(n),n=e-n,Pn(t,0>n?0:n,e)):[]},At.takeRightWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3),false,true):[]},At.takeWhile=function(t,n){return t&&t.length?Yn(t,Ur(n,3)):[]},At.tap=function(t,n){return n(t),t},At.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new du("Expected a function");return Ue(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ke(t,n,{leading:e,maxWait:n,
|
||||
trailing:u})},At.thru=ge,At.toArray=Ve,At.toPairs=Ei,At.toPairsIn=Ii,At.toPath=function(t){return ai(t)?l(t,ue):Te(t)?[t]:cr(Eo(t))},At.toPlainObject=He,At.transform=function(t,n,r){var e=ai(t)||qe(t);if(n=Ur(n,4),null==r)if(e||Ue(t)){var o=t.constructor;r=e?ai(t)?new o:[]:Me(o)?en(Pu(Object(t))):{}}else r={};return(e?u:sn)(t,function(t,e,u){return n(r,t,e,u)}),r},At.unary=function(t){return we(t,1)},At.union=zo,At.unionBy=Uo,At.unionWith=Do,At.uniq=function(t){return t&&t.length?Jn(t):[]},At.uniqBy=function(t,n){
|
||||
return t&&t.length?Jn(t,Ur(n)):[]},At.uniqWith=function(t,n){return t&&t.length?Jn(t,T,n):[]},At.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Qr(e,r)?[e]:nr(e);r=ee(r,e),e=ue(le(e)),r=!(null!=r&&dn(r,e))||delete r[e]}return r},At.unzip=pe,At.unzipWith=_e,At.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:cu)(_n(t,n)),void 0)},At.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:T,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:cu)(_n(t,n)),e)),t},At.values=eu,
|
||||
At.valuesIn=function(t){return null==t?[]:k(t,ru(t))},At.without=Fo,At.words=iu,At.wrap=function(t,n){return n=null==n?cu:n,ui(n,t)},At.xor=$o,At.xorBy=No,At.xorWith=Po,At.zip=Zo,At.zipObject=function(t,n){return Xn(t||[],n||[],Kt)},At.zipObjectDeep=function(t,n){return Xn(t||[],n||[],Nn)},At.zipWith=To,At.entries=Ei,At.entriesIn=Ii,At.extend=_i,At.extendWith=vi,lu(At,At),At.add=Gi,At.attempt=Ui,At.camelCase=Si,At.capitalize=uu,At.ceil=Ji,At.clamp=function(t,n,r){return r===T&&(r=n,n=T),r!==T&&(r=Ye(r),
|
||||
r=r===r?r:0),n!==T&&(n=Ye(n),n=n===n?n:0),tn(Ye(t),n,r)},At.clone=function(t){return nn(t,false,true)},At.cloneDeep=function(t){return nn(t,true,true)},At.cloneDeepWith=function(t,n){return nn(t,true,true,n)},At.cloneWith=function(t,n){return nn(t,false,true,n)},At.deburr=ou,At.divide=Yi,At.endsWith=function(t,n,r){t=Qe(t),n=Gn(n);var e=t.length;return r=r===T?e:tn(Ge(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},At.eq=Se,At.escape=function(t){return(t=Qe(t))&&X.test(t)?t.replace(H,B):t},At.escapeRegExp=function(t){
|
||||
return(t=Qe(t))&&ft.test(t)?t.replace(it,"\\$&"):t},At.every=function(t,n,r){var e=ai(t)?i:fn;return r&&Hr(t,n,r)&&(n=T),e(t,Ur(n,3))},At.find=function(t,n){if(n=Ur(n,3),ai(t)){var r=g(t,n);return r>-1?t[r]:T}return v(t,n,go)},At.findIndex=function(t,n){return t&&t.length?g(t,Ur(n,3)):-1},At.findKey=function(t,n){return v(t,Ur(n,3),sn,true)},At.findLast=function(t,n){if(n=Ur(n,3),ai(t)){var r=g(t,n,true);return r>-1?t[r]:T}return v(t,n,yo)},At.findLastIndex=function(t,n){return t&&t.length?g(t,Ur(n,3),true):-1;
|
||||
},At.findLastKey=function(t,n){return v(t,Ur(n,3),hn,true)},At.floor=Hi,At.forEach=ye,At.forEachRight=be,At.forIn=function(t,n){return null==t?t:bo(t,Ur(n,3),ru)},At.forInRight=function(t,n){return null==t?t:xo(t,Ur(n,3),ru)},At.forOwn=function(t,n){return t&&sn(t,Ur(n,3))},At.forOwnRight=function(t,n){return t&&hn(t,Ur(n,3))},At.get=Xe,At.gt=fi,At.gte=ci,At.has=function(t,n){return null!=t&&Zr(t,n,dn)},At.hasIn=tu,At.head=ae,At.identity=cu,At.includes=function(t,n,r,e){return t=We(t)?t:eu(t),r=r&&!e?Ge(r):0,
|
||||
e=t.length,0>r&&(r=Vu(e+r,0)),Ze(t)?e>=r&&-1<t.indexOf(n,r):!!e&&-1<d(t,n,r)},At.indexOf=function(t,n,r){var e=t?t.length:0;return e?(r=Ge(r),0>r&&(r=Vu(e+r,0)),d(t,n,r)):-1},At.inRange=function(t,n,r){return n=Ye(n)||0,r===T?(r=n,n=0):r=Ye(r)||0,t=Ye(t),t>=Ku(n,r)&&t<Vu(n,r)},At.invoke=wi,At.isArguments=Re,At.isArray=ai,At.isArrayBuffer=function(t){return De(t)&&"[object ArrayBuffer]"==Ou.call(t)},At.isArrayLike=We,At.isArrayLikeObject=Be,At.isBoolean=function(t){return true===t||false===t||De(t)&&"[object Boolean]"==Ou.call(t);
|
||||
},At.isBuffer=li,At.isDate=function(t){return De(t)&&"[object Date]"==Ou.call(t)},At.isElement=function(t){return!!t&&1===t.nodeType&&De(t)&&!Ne(t)},At.isEmpty=function(t){if(We(t)&&(ai(t)||Ze(t)||Me(t.splice)||Re(t)||li(t)))return!t.length;if(De(t)){var n=Pr(t);if("[object Map]"==n||"[object Set]"==n)return!t.size}for(var r in t)if(wu.call(t,r))return false;return!(io&&nu(t).length)},At.isEqual=function(t,n){return wn(t,n)},At.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:T)?r(t,n):T;return e===T?wn(t,n,r):!!e;
|
||||
},At.isError=Le,At.isFinite=function(t){return typeof t=="number"&&Zu(t)},At.isFunction=Me,At.isInteger=Ce,At.isLength=ze,At.isMap=function(t){return De(t)&&"[object Map]"==Pr(t)},At.isMatch=function(t,n){return t===n||mn(t,n,Fr(n))},At.isMatchWith=function(t,n,r){return r=typeof r=="function"?r:T,mn(t,n,Fr(n),r)},At.isNaN=function(t){return $e(t)&&t!=+t},At.isNative=Fe,At.isNil=function(t){return null==t},At.isNull=function(t){return null===t},At.isNumber=$e,At.isObject=Ue,At.isObjectLike=De,At.isPlainObject=Ne,
|
||||
At.isRegExp=Pe,At.isSafeInteger=function(t){return Ce(t)&&t>=-9007199254740991&&9007199254740991>=t},At.isSet=function(t){return De(t)&&"[object Set]"==Pr(t)},At.isString=Ze,At.isSymbol=Te,At.isTypedArray=qe,At.isUndefined=function(t){return t===T},At.isWeakMap=function(t){return De(t)&&"[object WeakMap]"==Pr(t)},At.isWeakSet=function(t){return De(t)&&"[object WeakSet]"==Ou.call(t)},At.join=function(t,n){return t?Tu.call(t,n):""},At.kebabCase=Ri,At.last=le,At.lastIndexOf=function(t,n,r){var e=t?t.length:0;
|
||||
if(!e)return-1;var u=e;if(r!==T&&(u=Ge(r),u=(0>u?Vu(e+u,0):Ku(u,e-1))+1),n!==n)return M(t,u,true);for(;u--;)if(t[u]===n)return u;return-1},At.lowerCase=Wi,At.lowerFirst=Bi,At.lt=si,At.lte=hi,At.max=function(t){return t&&t.length?cn(t,cu,gn):T},At.maxBy=function(t,n){return t&&t.length?cn(t,Ur(n),gn):T},At.mean=function(t){return b(t,cu)},At.meanBy=function(t,n){return b(t,Ur(n))},At.min=function(t){return t&&t.length?cn(t,cu,kn):T},At.minBy=function(t,n){return t&&t.length?cn(t,Ur(n),kn):T},At.multiply=Qi,
|
||||
At.nth=function(t,n){return t&&t.length?Wn(t,Ge(n)):T},At.noConflict=function(){return Jt._===this&&(Jt._=ku),this},At.noop=su,At.now=Qo,At.pad=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return!n||e>=n?t:(n=(n-e)/2,Or(Nu(n),r)+t+Or($u(n),r))},At.padEnd=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return n&&n>e?t+Or(n-e,r):t},At.padStart=function(t,n,r){t=Qe(t);var e=(n=Ge(n))?N(t):0;return n&&n>e?Or(n-e,r)+t:t},At.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=Qe(t).replace(ct,""),
|
||||
Gu(t,n||(vt.test(t)?16:10))},At.random=function(t,n,r){if(r&&typeof r!="boolean"&&Hr(t,n,r)&&(n=r=T),r===T&&(typeof n=="boolean"?(r=n,n=T):typeof t=="boolean"&&(r=t,t=T)),t===T&&n===T?(t=0,n=1):(t=Ye(t)||0,n===T?(n=t,t=0):n=Ye(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Ju(),Ku(t+r*(n-t+Nt("1e-"+((r+"").length-1))),n)):Fn(t,n)},At.reduce=function(t,n,r){var e=ai(t)?h:x,u=3>arguments.length;return e(t,Ur(n,4),r,u,go)},At.reduceRight=function(t,n,r){var e=ai(t)?p:x,u=3>arguments.length;return e(t,Ur(n,4),r,u,yo);
|
||||
},At.repeat=function(t,n,r){return n=(r?Hr(t,n,r):n===T)?1:Ge(n),$n(Qe(t),n)},At.replace=function(){var t=arguments,n=Qe(t[0]);return 3>t.length?n:Yu.call(n,t[1],t[2])},At.result=function(t,n,r){n=Qr(n,t)?[n]:nr(n);var e=-1,u=n.length;for(u||(t=T,u=1);++e<u;){var o=null==t?T:t[ue(n[e])];o===T&&(e=u,o=r),t=Me(o)?o.call(t):o}return t},At.round=Xi,At.runInContext=Z,At.sample=function(t){t=We(t)?t:eu(t);var n=t.length;return n>0?t[Fn(0,n-1)]:T},At.size=function(t){if(null==t)return 0;if(We(t)){var n=t.length;
|
||||
return n&&Ze(t)?N(t):n}return De(t)&&(n=Pr(t),"[object Map]"==n||"[object Set]"==n)?t.size:nu(t).length},At.snakeCase=Li,At.some=function(t,n,r){var e=ai(t)?_:Zn;return r&&Hr(t,n,r)&&(n=T),e(t,Ur(n,3))},At.sortedIndex=function(t,n){return Tn(t,n)},At.sortedIndexBy=function(t,n,r){return qn(t,n,Ur(r))},At.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&Se(t[e],n))return e}return-1},At.sortedLastIndex=function(t,n){return Tn(t,n,true)},At.sortedLastIndexBy=function(t,n,r){return qn(t,n,Ur(r),true);
|
||||
},At.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(Se(t[r],n))return r}return-1},At.startCase=Mi,At.startsWith=function(t,n,r){return t=Qe(t),r=tn(Ge(r),0,t.length),t.lastIndexOf(Gn(n),r)==r},At.subtract=tf,At.sum=function(t){return t&&t.length?w(t,cu):0},At.sumBy=function(t,n){return t&&t.length?w(t,Ur(n)):0},At.template=function(t,n,r){var e=At.templateSettings;r&&Hr(t,n,r)&&(n=T),t=Qe(t),n=vi({},n,e,Tt),r=vi({},n.imports,e.imports,Tt);var u,o,i=nu(r),f=k(r,i),c=0;r=n.interpolate||wt;
|
||||
var a="__p+='";r=gu((n.escape||wt).source+"|"+r.source+"|"+(r===rt?pt:wt).source+"|"+(n.evaluate||wt).source+"|$","g");var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(mt,L),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(K,""):a).replace(G,"$1").replace(J,"$1;"),a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",
|
||||
n=Ui(function(){return Function(i,l+"return "+a).apply(T,f)}),n.source=a,Le(n))throw n;return n},At.times=function(t,n){if(t=Ge(t),1>t||t>9007199254740991)return[];var r=4294967295,e=Ku(t,4294967295);for(n=Ur(n),t-=4294967295,e=m(e,n);++r<t;)n(r);return e},At.toFinite=Ke,At.toInteger=Ge,At.toLength=Je,At.toLower=function(t){return Qe(t).toLowerCase()},At.toNumber=Ye,At.toSafeInteger=function(t){return tn(Ge(t),-9007199254740991,9007199254740991)},At.toString=Qe,At.toUpper=function(t){return Qe(t).toUpperCase();
|
||||
},At.trim=function(t,n,r){return(t=Qe(t))&&(r||n===T)?t.replace(ct,""):t&&(n=Gn(n))?(t=t.match(St),n=n.match(St),rr(t,I(t,n),S(t,n)+1).join("")):t},At.trimEnd=function(t,n,r){return(t=Qe(t))&&(r||n===T)?t.replace(lt,""):t&&(n=Gn(n))?(t=t.match(St),n=S(t,n.match(St))+1,rr(t,0,n).join("")):t},At.trimStart=function(t,n,r){return(t=Qe(t))&&(r||n===T)?t.replace(at,""):t&&(n=Gn(n))?(t=t.match(St),n=I(t,n.match(St)),rr(t,n).join("")):t},At.truncate=function(t,n){var r=30,e="...";if(Ue(n))var u="separator"in n?n.separator:u,r="length"in n?Ge(n.length):r,e="omission"in n?Gn(n.omission):e;
|
||||
t=Qe(t);var o=t.length;if(Wt.test(t))var i=t.match(St),o=i.length;if(r>=o)return t;if(o=r-N(e),1>o)return e;if(r=i?rr(i,0,o).join(""):t.slice(0,o),u===T)return r+e;if(i&&(o+=r.length-o),Pe(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=gu(u.source,Qe(_t.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===T?o:c)}}else t.indexOf(Gn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},At.unescape=function(t){return(t=Qe(t))&&Q.test(t)?t.replace(Y,P):t},At.uniqueId=function(t){
|
||||
var n=++mu;return Qe(t)+n},At.upperCase=Ci,At.upperFirst=zi,At.each=ye,At.eachRight=be,At.first=ae,lu(At,function(){var t={};return sn(At,function(n,r){wu.call(At.prototype,r)||(t[r]=n)}),t}(),{chain:false}),At.VERSION="4.12.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){At[t].placeholder=At}),u(["drop","take"],function(t,n){zt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new zt(this);r=r===T?1:Vu(Ge(r),0);var u=this.clone();return e?u.__takeCount__=Ku(r,u.__takeCount__):u.__views__.push({
|
||||
size:Ku(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},zt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;zt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Ur(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");zt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");
|
||||
zt.prototype[t]=function(){return this.__filtered__?new zt(this):this[r](1)}}),zt.prototype.compact=function(){return this.filter(cu)},zt.prototype.find=function(t){return this.filter(t).head()},zt.prototype.findLast=function(t){return this.reverse().find(t)},zt.prototype.invokeMap=Ie(function(t,n){return typeof t=="function"?new zt(this):this.map(function(r){return jn(r,t,n)})}),zt.prototype.reject=function(t){return t=Ur(t,3),this.filter(function(n){return!t(n)})},zt.prototype.slice=function(t,n){
|
||||
t=Ge(t);var r=this;return r.__filtered__&&(t>0||0>n)?new zt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==T&&(n=Ge(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},zt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zt.prototype.toArray=function(){return this.take(4294967295)},sn(zt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=At[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(At.prototype[n]=function(){
|
||||
function n(t){return t=u.apply(At,s([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof zt,a=f[0],l=c||ai(i);l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&l?(i=c?i:new zt(this),i=t.apply(i,f),i.__actions__.push({func:ge,args:[n],thisArg:T}),new kt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=yu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);
|
||||
At.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(ai(u)?u:[],t)}return this[r](function(r){return n.apply(ai(r)?r:[],t)})}}),sn(zt.prototype,function(t,n){var r=At[n];if(r){var e=r.name+"";(fo[e]||(fo[e]=[])).push({name:n,func:r})}}),fo[jr(T,2).name]=[{name:"wrapper",func:T}],zt.prototype.clone=function(){var t=new zt(this.__wrapped__);return t.__actions__=cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cr(this.__iteratees__),
|
||||
t.__takeCount__=this.__takeCount__,t.__views__=cr(this.__views__),t},zt.prototype.reverse=function(){if(this.__filtered__){var t=new zt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},zt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=ai(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++c<a;){var l=i[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":t-=s;break;case"take":t=Ku(t,f+s);break;case"takeRight":
|
||||
f=Vu(f,t-s)}}if(t={start:f,end:t},i=t.start,f=t.end,t=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,c=0,a=Ku(t,this.__takeCount__),!e||200>o||o==t&&a==t)return Hn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o<f;){var h=i[o],s=h.type,h=(0,h.iteratee)(l);if(2==s)l=h;else if(!h){if(1==s)continue t;break t}}e[c++]=l}return e},At.prototype.at=qo,At.prototype.chain=function(){return ve(this)},At.prototype.commit=function(){return new kt(this.value(),this.__chain__)},At.prototype.next=function(){
|
||||
this.__values__===T&&(this.__values__=Ve(this.value()));var t=this.__index__>=this.__values__.length,n=t?T:this.__values__[this.__index__++];return{done:t,value:n}},At.prototype.plant=function(t){for(var n,r=this;r instanceof Ot;){var e=ie(r);e.__index__=0,e.__values__=T,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},At.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof zt?(this.__actions__.length&&(t=new zt(this)),t=t.reverse(),t.__actions__.push({func:ge,
|
||||
args:[he],thisArg:T}),new kt(t,this.__chain__)):this.thru(he)},At.prototype.toJSON=At.prototype.valueOf=At.prototype.value=function(){return Hn(this.__wrapped__,this.__actions__)},Cu&&(At.prototype[Cu]=de),At}var T,q=1/0,V=NaN,K=/\b__p\+='';/g,G=/\b(__p\+=)''\+/g,J=/(__e\(.*?\)|\b__t\))\+'';/g,Y=/&(?:amp|lt|gt|quot|#39|#96);/g,H=/[&<>"'`]/g,Q=RegExp(Y.source),X=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,nt=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,it=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(it.source),ct=/^\s+|\s+$/g,at=/^\s+/,lt=/\s+$/,st=/[a-zA-Z0-9]+/g,ht=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,vt=/^0x/i,gt=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,jt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,wt=/($^)/,mt=/['\n\r\u2028\u2029\\]/g,At="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",Ot="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+At,kt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",Et=RegExp("['\u2019]","g"),It=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),St=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kt+At,"g"),Rt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",Ot].join("|"),"g"),Wt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Mt={};
|
||||
Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=true,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=false;
|
||||
var Ct={};Ct["[object Arguments]"]=Ct["[object Array]"]=Ct["[object ArrayBuffer]"]=Ct["[object DataView]"]=Ct["[object Boolean]"]=Ct["[object Date]"]=Ct["[object Float32Array]"]=Ct["[object Float64Array]"]=Ct["[object Int8Array]"]=Ct["[object Int16Array]"]=Ct["[object Int32Array]"]=Ct["[object Map]"]=Ct["[object Number]"]=Ct["[object Object]"]=Ct["[object RegExp]"]=Ct["[object Set]"]=Ct["[object String]"]=Ct["[object Symbol]"]=Ct["[object Uint8Array]"]=Ct["[object Uint8ClampedArray]"]=Ct["[object Uint16Array]"]=Ct["[object Uint32Array]"]=true,
|
||||
Ct["[object Error]"]=Ct["[object Function]"]=Ct["[object WeakMap]"]=false;var zt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O",
|
||||
"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ut={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Dt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ft={"function":true,object:true},$t={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"
|
||||
},Nt=parseFloat,Pt=parseInt,Zt=Ft[typeof exports]&&exports&&!exports.nodeType?exports:T,Tt=Ft[typeof module]&&module&&!module.nodeType?module:T,qt=Tt&&Tt.exports===Zt?Zt:T,Vt=R(Ft[typeof self]&&self),Kt=R(Ft[typeof window]&&window),Gt=R(Ft[typeof this]&&this),Jt=R(Zt&&Tt&&typeof global=="object"&&global)||Kt!==(Gt&&Gt.window)&&Kt||Vt||Gt||Function("return this")(),Yt=Z();(Kt||Vt||{})._=Yt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Yt}):Zt&&Tt?(qt&&((Tt.exports=Yt)._=Yt),
|
||||
Zt._=Yt):Jt._=Yt}).call(this);
|
||||
352
dist/mapping.fp.js
vendored
352
dist/mapping.fp.js
vendored
@@ -1,352 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["mapping"] = factory();
|
||||
else
|
||||
root["mapping"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'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',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
|
||||
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
|
||||
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
|
||||
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
|
||||
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
|
||||
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
|
||||
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
|
||||
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
|
||||
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
|
||||
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
|
||||
'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
10774
doc/README.md
10774
doc/README.md
File diff suppressed because it is too large
Load Diff
@@ -1,466 +0,0 @@
|
||||
var mapping = require('./_mapping'),
|
||||
mutateMap = mapping.mutate,
|
||||
fallbackHolder = require('./placeholder');
|
||||
|
||||
/**
|
||||
* Creates a function, with an arity of `n`, that invokes `func` with the
|
||||
* arguments it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} n The arity of the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseArity(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func.apply(undefined, arguments); }
|
||||
: function(a) { return func.apply(undefined, arguments); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
|
||||
* any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseAry(func, n) {
|
||||
return n == 2
|
||||
? function(a, b) { return func(a, b); }
|
||||
: function(a) { return func(a); };
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to clone.
|
||||
* @returns {Array} Returns the cloned array.
|
||||
*/
|
||||
function cloneArray(array) {
|
||||
var length = array ? array.length : 0,
|
||||
result = Array(length);
|
||||
|
||||
while (length--) {
|
||||
result[length] = array[length];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that clones a given object using the assignment `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The assignment function.
|
||||
* @returns {Function} Returns the new cloner function.
|
||||
*/
|
||||
function createCloner(func) {
|
||||
return function(object) {
|
||||
return func({}, object);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and uses `cloner` to clone the first
|
||||
* argument it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {Function} cloner The function to clone arguments.
|
||||
* @returns {Function} Returns the new immutable function.
|
||||
*/
|
||||
function immutWrap(func, cloner) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var result = args[0] = cloner.apply(undefined, args);
|
||||
func.apply(undefined, args);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `convert` which accepts a `util` object of methods
|
||||
* required to perform conversions.
|
||||
*
|
||||
* @param {Object} util The util object.
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||
* @param {boolean} [options.curry=true] Specify currying.
|
||||
* @param {boolean} [options.fixed=true] Specify fixed arity.
|
||||
* @param {boolean} [options.immutable=true] Specify immutable operations.
|
||||
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function baseConvert(util, name, func, options) {
|
||||
var setPlaceholder,
|
||||
isLib = typeof name == 'function',
|
||||
isObj = name === Object(name);
|
||||
|
||||
if (isObj) {
|
||||
options = func;
|
||||
func = name;
|
||||
name = undefined;
|
||||
}
|
||||
if (func == null) {
|
||||
throw new TypeError;
|
||||
}
|
||||
options || (options = {});
|
||||
|
||||
var config = {
|
||||
'cap': 'cap' in options ? options.cap : true,
|
||||
'curry': 'curry' in options ? options.curry : true,
|
||||
'fixed': 'fixed' in options ? options.fixed : true,
|
||||
'immutable': 'immutable' in options ? options.immutable : true,
|
||||
'rearg': 'rearg' in options ? options.rearg : true
|
||||
};
|
||||
|
||||
var forceCurry = ('curry' in options) && options.curry,
|
||||
forceFixed = ('fixed' in options) && options.fixed,
|
||||
forceRearg = ('rearg' in options) && options.rearg,
|
||||
placeholder = isLib ? func : fallbackHolder,
|
||||
pristine = isLib ? func.runInContext() : undefined;
|
||||
|
||||
var helpers = isLib ? func : {
|
||||
'ary': util.ary,
|
||||
'assign': util.assign,
|
||||
'clone': util.clone,
|
||||
'curry': util.curry,
|
||||
'forEach': util.forEach,
|
||||
'isArray': util.isArray,
|
||||
'isFunction': util.isFunction,
|
||||
'iteratee': util.iteratee,
|
||||
'keys': util.keys,
|
||||
'rearg': util.rearg,
|
||||
'spread': util.spread,
|
||||
'toPath': util.toPath
|
||||
};
|
||||
|
||||
var ary = helpers.ary,
|
||||
assign = helpers.assign,
|
||||
clone = helpers.clone,
|
||||
curry = helpers.curry,
|
||||
each = helpers.forEach,
|
||||
isArray = helpers.isArray,
|
||||
isFunction = helpers.isFunction,
|
||||
keys = helpers.keys,
|
||||
rearg = helpers.rearg,
|
||||
spread = helpers.spread,
|
||||
toPath = helpers.toPath;
|
||||
|
||||
var aryMethodKeys = keys(mapping.aryMethod);
|
||||
|
||||
var wrappers = {
|
||||
'castArray': function(castArray) {
|
||||
return function() {
|
||||
var value = arguments[0];
|
||||
return isArray(value)
|
||||
? castArray(cloneArray(value))
|
||||
: castArray.apply(undefined, arguments);
|
||||
};
|
||||
},
|
||||
'iteratee': function(iteratee) {
|
||||
return function() {
|
||||
var func = arguments[0],
|
||||
arity = arguments[1],
|
||||
result = iteratee(func, arity),
|
||||
length = result.length;
|
||||
|
||||
if (config.cap && typeof arity == 'number') {
|
||||
arity = arity > 2 ? (arity - 2) : 1;
|
||||
return (length && length <= arity) ? result : baseAry(result, arity);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
},
|
||||
'mixin': function(mixin) {
|
||||
return function(source) {
|
||||
var func = this;
|
||||
if (!isFunction(func)) {
|
||||
return mixin(func, Object(source));
|
||||
}
|
||||
var 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;
|
||||
};
|
||||
},
|
||||
'runInContext': function(runInContext) {
|
||||
return function(context) {
|
||||
return baseConvert(util, runInContext(context), options);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a clone of `object` by `path`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to clone.
|
||||
* @param {Array|string} path The path to clone by.
|
||||
* @returns {Object} Returns the cloned object.
|
||||
*/
|
||||
function cloneByPath(object, path) {
|
||||
path = toPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
lastIndex = length - 1,
|
||||
result = clone(Object(object)),
|
||||
nested = result;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = path[index],
|
||||
value = nested[key];
|
||||
|
||||
if (value != null) {
|
||||
nested[path[index]] = clone(index == lastIndex ? value : Object(value));
|
||||
}
|
||||
nested = nested[key];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function convertLib(options) {
|
||||
return _.runInContext.convert(options)(undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a converter function for `func` of `name`.
|
||||
*
|
||||
* @param {string} name The name of the function to convert.
|
||||
* @param {Function} func The function to convert.
|
||||
* @returns {Function} Returns the new converter function.
|
||||
*/
|
||||
function createConverter(name, func) {
|
||||
var oldOptions = options;
|
||||
return function(options) {
|
||||
var newUtil = isLib ? pristine : helpers,
|
||||
newFunc = isLib ? pristine[name] : func,
|
||||
newOptions = assign(assign({}, oldOptions), options);
|
||||
|
||||
return baseConvert(newUtil, name, newFunc, newOptions);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
|
||||
* arguments, ignoring any additional arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap iteratee arguments for.
|
||||
* @param {number} n The arity cap.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeAry(func, n) {
|
||||
return overArg(func, function(func) {
|
||||
return typeof func == 'function' ? baseAry(func, n) : func;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke its iteratee with arguments
|
||||
* arranged according to the specified `indexes` where the argument value at
|
||||
* the first index is provided as the first argument, the argument value at
|
||||
* the second index is provided as the second argument, and so on.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to rearrange iteratee arguments for.
|
||||
* @param {number[]} indexes The arranged argument indexes.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function iterateeRearg(func, indexes) {
|
||||
return overArg(func, function(func) {
|
||||
var n = indexes.length;
|
||||
return baseArity(rearg(baseAry(func, n), indexes), n);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with its first argument passed
|
||||
* thru `transform`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...Function} transform The functions to transform the first argument.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function overArg(func, transform) {
|
||||
return function() {
|
||||
var length = arguments.length;
|
||||
if (!length) {
|
||||
return func();
|
||||
}
|
||||
var args = Array(length);
|
||||
while (length--) {
|
||||
args[length] = arguments[length];
|
||||
}
|
||||
var index = config.rearg ? 0 : (length - 1);
|
||||
args[index] = transform(args[index]);
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and applys the conversions
|
||||
* rules by `name`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} func The function to wrap.
|
||||
* @returns {Function} Returns the converted function.
|
||||
*/
|
||||
function wrap(name, func) {
|
||||
name = mapping.aliasToReal[name] || name;
|
||||
|
||||
var result,
|
||||
wrapped = func,
|
||||
wrapper = wrappers[name];
|
||||
|
||||
if (wrapper) {
|
||||
wrapped = wrapper(func);
|
||||
}
|
||||
else if (config.immutable) {
|
||||
if (mutateMap.array[name]) {
|
||||
wrapped = immutWrap(func, cloneArray);
|
||||
}
|
||||
else if (mutateMap.object[name]) {
|
||||
wrapped = immutWrap(func, createCloner(func));
|
||||
}
|
||||
else if (mutateMap.set[name]) {
|
||||
wrapped = immutWrap(func, cloneByPath);
|
||||
}
|
||||
}
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(otherName) {
|
||||
if (name == otherName) {
|
||||
var aryN = !isLib && mapping.iterateeAry[name],
|
||||
reargIndexes = mapping.iterateeRearg[name],
|
||||
spreadStart = mapping.methodSpread[name];
|
||||
|
||||
result = wrapped;
|
||||
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||
result = spreadStart === undefined
|
||||
? ary(result, aryKey)
|
||||
: spread(result, spreadStart);
|
||||
}
|
||||
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
|
||||
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
|
||||
}
|
||||
if (config.cap) {
|
||||
if (reargIndexes) {
|
||||
result = iterateeRearg(result, reargIndexes);
|
||||
} else if (aryN) {
|
||||
result = iterateeAry(result, aryN);
|
||||
}
|
||||
}
|
||||
if (forceCurry || (config.curry && aryKey > 1)) {
|
||||
forceCurry && console.log(forceCurry, name);
|
||||
result = curry(result, aryKey);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return !result;
|
||||
});
|
||||
|
||||
result || (result = wrapped);
|
||||
if (result == func) {
|
||||
result = forceCurry ? curry(result, 1) : function() {
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
result.convert = createConverter(name, func);
|
||||
if (mapping.placeholder[name]) {
|
||||
setPlaceholder = true;
|
||||
result.placeholder = func.placeholder = placeholder;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (!isObj) {
|
||||
return wrap(name, func);
|
||||
}
|
||||
var _ = func;
|
||||
|
||||
// Convert methods by ary cap.
|
||||
var pairs = [];
|
||||
each(aryMethodKeys, function(aryKey) {
|
||||
each(mapping.aryMethod[aryKey], function(key) {
|
||||
var func = _[mapping.remap[key] || key];
|
||||
if (func) {
|
||||
pairs.push([key, wrap(key, func)]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Convert remaining methods.
|
||||
each(keys(_), function(key) {
|
||||
var func = _[key];
|
||||
if (typeof func == 'function') {
|
||||
var length = pairs.length;
|
||||
while (length--) {
|
||||
if (pairs[length][0] == key) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
func.convert = createConverter(key, func);
|
||||
pairs.push([key, func]);
|
||||
}
|
||||
});
|
||||
|
||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||
each(pairs, function(pair) {
|
||||
_[pair[0]] = pair[1];
|
||||
});
|
||||
|
||||
_.convert = convertLib;
|
||||
if (setPlaceholder) {
|
||||
_.placeholder = placeholder;
|
||||
}
|
||||
// Assign aliases.
|
||||
each(keys(_), function(key) {
|
||||
each(mapping.realToAlias[key] || [], function(alias) {
|
||||
_[alias] = _[key];
|
||||
});
|
||||
});
|
||||
|
||||
return _;
|
||||
}
|
||||
|
||||
module.exports = baseConvert;
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert');
|
||||
|
||||
/**
|
||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied.
|
||||
*
|
||||
* @param {Function} lodash The lodash function to convert.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function} Returns the converted `lodash`.
|
||||
*/
|
||||
function browserConvert(lodash, options) {
|
||||
return baseConvert(lodash, lodash, options);
|
||||
}
|
||||
|
||||
if (typeof _ == 'function') {
|
||||
_ = browserConvert(_.runInContext());
|
||||
}
|
||||
module.exports = browserConvert;
|
||||
290
fp/_mapping.js
290
fp/_mapping.js
@@ -1,290 +0,0 @@
|
||||
/** Used to map aliases to their real names. */
|
||||
exports.aliasToReal = {
|
||||
|
||||
// Lodash aliases.
|
||||
'each': 'forEach',
|
||||
'eachRight': 'forEachRight',
|
||||
'entries': 'toPairs',
|
||||
'entriesIn': 'toPairsIn',
|
||||
'extend': 'assignIn',
|
||||
'extendWith': 'assignInWith',
|
||||
'first': 'head',
|
||||
|
||||
// Ramda aliases.
|
||||
'__': 'placeholder',
|
||||
'all': 'every',
|
||||
'allPass': 'overEvery',
|
||||
'always': 'constant',
|
||||
'any': 'some',
|
||||
'anyPass': 'overSome',
|
||||
'apply': 'spread',
|
||||
'assoc': 'set',
|
||||
'assocPath': 'set',
|
||||
'complement': 'negate',
|
||||
'compose': 'flowRight',
|
||||
'contains': 'includes',
|
||||
'dissoc': 'unset',
|
||||
'dissocPath': 'unset',
|
||||
'equals': 'isEqual',
|
||||
'identical': 'eq',
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'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',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
'whereEq': 'filter',
|
||||
'zipObj': 'zipObject'
|
||||
};
|
||||
|
||||
/** Used to map ary to method names. */
|
||||
exports.aryMethod = {
|
||||
'1': [
|
||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||
'uniqueId', 'words'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||
'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
|
||||
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
|
||||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
|
||||
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast',
|
||||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
|
||||
'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
|
||||
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
|
||||
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
|
||||
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
|
||||
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
|
||||
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
|
||||
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
|
||||
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
|
||||
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
|
||||
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
|
||||
'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||
],
|
||||
'4': [
|
||||
'fill', 'setWith', 'updateWith'
|
||||
]
|
||||
};
|
||||
|
||||
/** Used to map ary to rearg configs. */
|
||||
exports.aryRearg = {
|
||||
'2': [1, 0],
|
||||
'3': [2, 0, 1],
|
||||
'4': [3, 2, 0, 1]
|
||||
};
|
||||
|
||||
/** Used to map method names to their iteratee ary. */
|
||||
exports.iterateeAry = {
|
||||
'dropRightWhile': 1,
|
||||
'dropWhile': 1,
|
||||
'every': 1,
|
||||
'filter': 1,
|
||||
'find': 1,
|
||||
'findIndex': 1,
|
||||
'findKey': 1,
|
||||
'findLast': 1,
|
||||
'findLastIndex': 1,
|
||||
'findLastKey': 1,
|
||||
'flatMap': 1,
|
||||
'flatMapDeep': 1,
|
||||
'flatMapDepth': 1,
|
||||
'forEach': 1,
|
||||
'forEachRight': 1,
|
||||
'forIn': 1,
|
||||
'forInRight': 1,
|
||||
'forOwn': 1,
|
||||
'forOwnRight': 1,
|
||||
'map': 1,
|
||||
'mapKeys': 1,
|
||||
'mapValues': 1,
|
||||
'partition': 1,
|
||||
'reduce': 2,
|
||||
'reduceRight': 2,
|
||||
'reject': 1,
|
||||
'remove': 1,
|
||||
'some': 1,
|
||||
'takeRightWhile': 1,
|
||||
'takeWhile': 1,
|
||||
'times': 1,
|
||||
'transform': 2
|
||||
};
|
||||
|
||||
/** Used to map method names to iteratee rearg configs. */
|
||||
exports.iterateeRearg = {
|
||||
'mapKeys': [1]
|
||||
};
|
||||
|
||||
/** Used to map method names to rearg configs. */
|
||||
exports.methodRearg = {
|
||||
'assignInWith': [1, 2, 0],
|
||||
'assignWith': [1, 2, 0],
|
||||
'getOr': [2, 1, 0],
|
||||
'isEqualWith': [1, 2, 0],
|
||||
'isMatchWith': [2, 1, 0],
|
||||
'mergeWith': [1, 2, 0],
|
||||
'padChars': [2, 1, 0],
|
||||
'padCharsEnd': [2, 1, 0],
|
||||
'padCharsStart': [2, 1, 0],
|
||||
'pullAllBy': [2, 1, 0],
|
||||
'pullAllWith': [2, 1, 0],
|
||||
'setWith': [3, 1, 2, 0],
|
||||
'sortedIndexBy': [2, 1, 0],
|
||||
'sortedLastIndexBy': [2, 1, 0],
|
||||
'updateWith': [3, 1, 2, 0],
|
||||
'zipWith': [1, 2, 0]
|
||||
};
|
||||
|
||||
/** Used to map method names to spread configs. */
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
exports.mutate = {
|
||||
'array': {
|
||||
'fill': true,
|
||||
'pull': true,
|
||||
'pullAll': true,
|
||||
'pullAllBy': true,
|
||||
'pullAllWith': true,
|
||||
'pullAt': true,
|
||||
'remove': true,
|
||||
'reverse': true
|
||||
},
|
||||
'object': {
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'assignInWith': true,
|
||||
'assignWith': true,
|
||||
'defaults': true,
|
||||
'defaultsDeep': true,
|
||||
'merge': true,
|
||||
'mergeWith': true
|
||||
},
|
||||
'set': {
|
||||
'set': true,
|
||||
'setWith': true,
|
||||
'unset': true,
|
||||
'update': true,
|
||||
'updateWith': true
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to track methods with placeholder support */
|
||||
exports.placeholder = {
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'curry': true,
|
||||
'curryRight': true,
|
||||
'partial': true,
|
||||
'partialRight': true
|
||||
};
|
||||
|
||||
/** Used to map real names to their aliases. */
|
||||
exports.realToAlias = (function() {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
object = exports.aliasToReal,
|
||||
result = {};
|
||||
|
||||
for (var key in object) {
|
||||
var value = object[key];
|
||||
if (hasOwnProperty.call(result, value)) {
|
||||
result[value].push(key);
|
||||
} else {
|
||||
result[value] = [key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}());
|
||||
|
||||
/** Used to map method names to other names. */
|
||||
exports.remap = {
|
||||
'curryN': 'curry',
|
||||
'curryRightN': 'curryRight',
|
||||
'getOr': 'get',
|
||||
'invokeArgs': 'invoke',
|
||||
'invokeArgsMap': 'invokeMap',
|
||||
'padChars': 'pad',
|
||||
'padCharsEnd': 'padEnd',
|
||||
'padCharsStart': 'padStart',
|
||||
'restFrom': 'rest',
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
exports.skipFixed = {
|
||||
'castArray': true,
|
||||
'flow': true,
|
||||
'flowRight': true,
|
||||
'iteratee': true,
|
||||
'mixin': true,
|
||||
'runInContext': true
|
||||
};
|
||||
|
||||
/** Used to track methods that skip rearranging arguments. */
|
||||
exports.skipRearg = {
|
||||
'add': true,
|
||||
'assign': true,
|
||||
'assignIn': true,
|
||||
'bind': true,
|
||||
'bindKey': true,
|
||||
'concat': true,
|
||||
'difference': true,
|
||||
'divide': true,
|
||||
'eq': true,
|
||||
'gt': true,
|
||||
'gte': true,
|
||||
'isEqual': true,
|
||||
'lt': true,
|
||||
'lte': true,
|
||||
'matchesProperty': true,
|
||||
'merge': true,
|
||||
'multiply': true,
|
||||
'overArgs': true,
|
||||
'partial': true,
|
||||
'partialRight': true,
|
||||
'random': true,
|
||||
'range': true,
|
||||
'rangeRight': true,
|
||||
'subtract': true,
|
||||
'without': true,
|
||||
'zip': true,
|
||||
'zipObject': true
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* The default argument placeholder value for methods.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
module.exports = {};
|
||||
@@ -1,71 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
glob = require('glob'),
|
||||
path = require('path');
|
||||
|
||||
var minify = require('../common/minify.js');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a [fs.copy](https://github.com/jprichardson/node-fs-extra#copy)
|
||||
* function with `srcPath` and `destPath` partially applied.
|
||||
*
|
||||
* @memberOf file
|
||||
* @param {string} srcPath The path of the file to copy.
|
||||
* @param {string} destPath The path to copy the file to.
|
||||
* @returns {Function} Returns the partially applied function.
|
||||
*/
|
||||
function copy(srcPath, destPath) {
|
||||
return _.partial(fs.copy, srcPath, destPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object of compiled template and base name pairs that match `pattern`.
|
||||
*
|
||||
* @memberOf file
|
||||
* @param {string} pattern The glob pattern to be match.
|
||||
* @returns {Object} Returns the object of compiled templates.
|
||||
*/
|
||||
function globTemplate(pattern) {
|
||||
return _.transform(glob.sync(pattern), function(result, filePath) {
|
||||
var key = path.basename(filePath, path.extname(filePath));
|
||||
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
|
||||
}, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a `minify` function with `srcPath` and `destPath` partially applied.
|
||||
*
|
||||
* @memberOf file
|
||||
* @param {string} srcPath The path of the file to minify.
|
||||
* @param {string} destPath The path to write the file to.
|
||||
* @returns {Function} Returns the partially applied function.
|
||||
*/
|
||||
function min(srcPath, destPath) {
|
||||
return _.partial(minify, srcPath, destPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
|
||||
* function with `filePath` and `data` partially applied.
|
||||
*
|
||||
* @memberOf file
|
||||
* @param {string} destPath The path to write the file to.
|
||||
* @param {string} data The data to write to the file.
|
||||
* @returns {Function} Returns the partially applied function.
|
||||
*/
|
||||
function write(destPath, data) {
|
||||
return _.partial(fs.writeFile, destPath, data);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
module.exports = {
|
||||
'copy': copy,
|
||||
'globTemplate': globTemplate,
|
||||
'min': min,
|
||||
'write': write
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _mapping = require('../../fp/_mapping'),
|
||||
util = require('./util'),
|
||||
Hash = util.Hash;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
module.exports = new Hash(_mapping);
|
||||
@@ -1,39 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
uglify = require('uglify-js');
|
||||
|
||||
var 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`. For
|
||||
* example, a `srcPath` of `path/to/foo.js` would have a `destPath` of `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');
|
||||
}
|
||||
var output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
|
||||
fs.writeFile(destPath, output.code, 'utf-8', callback);
|
||||
}
|
||||
|
||||
module.exports = minify;
|
||||
@@ -1,23 +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': {
|
||||
'pure_getters': true,
|
||||
'unsafe': true,
|
||||
'warnings': false
|
||||
},
|
||||
'mangle': {
|
||||
'except': ['define']
|
||||
},
|
||||
'output': {
|
||||
'ascii_only': true,
|
||||
'comments': /^!|@cc_on|@license|@preserve/i,
|
||||
'max_line_len': 500
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a hash object. If a `properties` object is provided, its own
|
||||
* enumerable properties are assigned to the created object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @param {Object} [properties] The properties to assign to the object.
|
||||
* @returns {Object} Returns the new hash object.
|
||||
*/
|
||||
function Hash(properties) {
|
||||
return _.transform(properties, function(result, value, key) {
|
||||
result[key] = (_.isPlainObject(value) && !(value instanceof Hash))
|
||||
? new Hash(value)
|
||||
: value;
|
||||
}, this);
|
||||
}
|
||||
|
||||
Hash.prototype = Object.create(null);
|
||||
|
||||
module.exports = {
|
||||
'Hash': Hash
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
path = require('path'),
|
||||
webpack = require('webpack');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist'),
|
||||
fpPath = path.join(basePath, 'fp'),
|
||||
filename = 'lodash.fp.js';
|
||||
|
||||
var fpConfig = {
|
||||
'entry': path.join(fpPath, '_convertBrowser.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': filename,
|
||||
'library': 'fp',
|
||||
'libraryTarget': 'umd'
|
||||
},
|
||||
'plugins': [
|
||||
new webpack.optimize.OccurenceOrderPlugin,
|
||||
new webpack.optimize.DedupePlugin
|
||||
]
|
||||
};
|
||||
|
||||
var mappingConfig = {
|
||||
'entry': path.join(fpPath, '_mapping.js'),
|
||||
'output': {
|
||||
'path': distPath,
|
||||
'filename': 'mapping.fp.js',
|
||||
'library': 'mapping',
|
||||
'libraryTarget': 'umd'
|
||||
}
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build() {
|
||||
async.series([
|
||||
_.partial(webpack, mappingConfig),
|
||||
_.partial(webpack, fpConfig),
|
||||
file.min(path.join(distPath, filename))
|
||||
], onComplete);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,65 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file'),
|
||||
mapping = require('../common/mapping');
|
||||
|
||||
var templatePath = path.join(__dirname, 'template/doc'),
|
||||
template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
var argNames = ['a', 'b', 'c', 'd'];
|
||||
|
||||
var templateData = {
|
||||
'mapping': mapping,
|
||||
'toArgOrder': toArgOrder,
|
||||
'toFuncList': toFuncList
|
||||
};
|
||||
|
||||
function toArgOrder(array) {
|
||||
var reordered = [];
|
||||
_.each(array, function(newIndex, index) {
|
||||
reordered[newIndex] = argNames[index];
|
||||
});
|
||||
return '`(' + reordered.join(', ') + ')`';
|
||||
}
|
||||
|
||||
function toFuncList(array) {
|
||||
var chunks = _.chunk(array.slice().sort(), 5),
|
||||
lastChunk = _.last(chunks),
|
||||
last = lastChunk ? lastChunk.pop() : undefined;
|
||||
|
||||
chunks = _.reject(chunks, _.isEmpty);
|
||||
lastChunk = _.last(chunks);
|
||||
|
||||
var result = '`' + _.map(chunks, function(chunk) {
|
||||
return chunk.join('`, `') + '`';
|
||||
}).join(',\n`');
|
||||
|
||||
if (last == null) {
|
||||
return result;
|
||||
}
|
||||
if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
|
||||
result += ',';
|
||||
}
|
||||
result += ' &';
|
||||
result += _.size(lastChunk) < 5 ? ' ' : '\n';
|
||||
return result + '`' + last + '`';
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
target = path.resolve(target);
|
||||
fs.writeFile(target, template.wiki(templateData), onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,120 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
glob = require('glob'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file'),
|
||||
mapping = require('../common/mapping');
|
||||
|
||||
var templatePath = path.join(__dirname, 'template/modules'),
|
||||
template = file.globTemplate(path.join(templatePath, '*.jst'));
|
||||
|
||||
var aryMethods = _.union(
|
||||
mapping.aryMethod[1],
|
||||
mapping.aryMethod[2],
|
||||
mapping.aryMethod[3],
|
||||
mapping.aryMethod[4]
|
||||
);
|
||||
|
||||
var categories = [
|
||||
'array',
|
||||
'collection',
|
||||
'date',
|
||||
'function',
|
||||
'lang',
|
||||
'math',
|
||||
'number',
|
||||
'object',
|
||||
'seq',
|
||||
'string',
|
||||
'util'
|
||||
];
|
||||
|
||||
var ignored = [
|
||||
'_*.js',
|
||||
'core.js',
|
||||
'core.min.js',
|
||||
'fp.js',
|
||||
'index.js',
|
||||
'lodash.js',
|
||||
'lodash.min.js'
|
||||
];
|
||||
|
||||
function isAlias(funcName) {
|
||||
return _.has(mapping.aliasToReal, funcName);
|
||||
}
|
||||
|
||||
function isCategory(funcName) {
|
||||
return _.includes(categories, funcName);
|
||||
}
|
||||
|
||||
function isThru(funcName) {
|
||||
return !_.includes(aryMethods, funcName);
|
||||
}
|
||||
|
||||
function getTemplate(moduleName) {
|
||||
var data = {
|
||||
'name': _.result(mapping.aliasToReal, moduleName, moduleName),
|
||||
'mapping': mapping
|
||||
};
|
||||
|
||||
if (isAlias(moduleName)) {
|
||||
return template.alias(data);
|
||||
}
|
||||
if (isCategory(moduleName)) {
|
||||
return template.category(data);
|
||||
}
|
||||
if (isThru(moduleName)) {
|
||||
return template.thru(data);
|
||||
}
|
||||
return template.module(data);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
target = path.resolve(target);
|
||||
|
||||
var fpPath = path.join(target, 'fp');
|
||||
|
||||
// Glob existing lodash module paths.
|
||||
var modulePaths = glob.sync(path.join(target, '*.js'), {
|
||||
'nodir': true,
|
||||
'ignore': ignored.map(function(filename) {
|
||||
return path.join(target, filename);
|
||||
})
|
||||
});
|
||||
|
||||
// Add FP alias and remapped module paths.
|
||||
_.each([mapping.aliasToReal, mapping.remap], function(data) {
|
||||
_.forOwn(data, function(realName, alias) {
|
||||
var modulePath = path.join(target, alias + '.js');
|
||||
if (!_.includes(modulePaths, modulePath)) {
|
||||
modulePaths.push(modulePath);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var actions = modulePaths.map(function(modulePath) {
|
||||
var moduleName = path.basename(modulePath, '.js');
|
||||
return file.write(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
||||
});
|
||||
|
||||
actions.unshift(file.copy(path.join(__dirname, '../../fp'), fpPath));
|
||||
actions.push(file.write(path.join(fpPath, '_falseOptions.js'), template._falseOptions()));
|
||||
actions.push(file.write(path.join(fpPath, '_util.js'), template._util()));
|
||||
actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
|
||||
actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
|
||||
|
||||
async.series(actions, onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,227 +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='path/to/lodash.js'></script>
|
||||
<script src='path/to/lodash.fp.js'></script>
|
||||
<script>
|
||||
// Loading `lodash.fp.js` converts `_` to its fp variant.
|
||||
_.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
|
||||
// Use `noConflict` to restore the pre-fp variant.
|
||||
var fp = _.noConflict();
|
||||
|
||||
_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
|
||||
// → { 'a: 1, 'b': 2 }
|
||||
</script>
|
||||
```
|
||||
|
||||
In Node.js:
|
||||
```js
|
||||
// Load the fp build.
|
||||
var fp = require('lodash/fp');
|
||||
|
||||
// Load a method category.
|
||||
var object = require('lodash/fp/object');
|
||||
|
||||
// Load a single method for smaller builds with browserify/rollup/webpack.
|
||||
var extend = require('lodash/fp/extend');
|
||||
```
|
||||
|
||||
## Mapping
|
||||
|
||||
Immutable auto-curried iteratee-first data-last methods sound great, but what
|
||||
does that really mean for each method? Below is a breakdown of the mapping used
|
||||
to convert each method.
|
||||
|
||||
#### Capped Iteratee Arguments
|
||||
|
||||
Iteratee arguments are capped to avoid gotchas with variadic iteratees.
|
||||
```js
|
||||
// The `lodash/map` iteratee receives three arguments:
|
||||
// (value, index|key, collection)
|
||||
_.map(['6', '8', '10'], parseInt);
|
||||
// → [6, NaN, 2]
|
||||
|
||||
// The `lodash/fp/map` iteratee is capped at one argument:
|
||||
// (value)
|
||||
fp.map(parseInt)(['6', '8', '10']);
|
||||
// → [6, 8, 10]
|
||||
```
|
||||
|
||||
Methods that cap iteratees to one argument:<br>
|
||||
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 1)))) %>
|
||||
|
||||
Methods that cap iteratees to two arguments:<br>
|
||||
<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 2)))) %>
|
||||
|
||||
The iteratee of `mapKeys` is invoked with one argument: (key)
|
||||
|
||||
#### Fixed Arity
|
||||
|
||||
Methods have fixed arities to support auto-currying.
|
||||
```js
|
||||
// `lodash/padStart` accepts an optional `chars` param.
|
||||
_.padStart('a', 3, '-')
|
||||
// → '--a'
|
||||
|
||||
// `lodash/fp/padStart` does not.
|
||||
fp.padStart(3)('a');
|
||||
// → ' a'
|
||||
fp.padCharsStart('-')(3)('a');
|
||||
// → '--a'
|
||||
```
|
||||
|
||||
Methods with a fixed arity of one:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[1], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of two:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[2], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of three:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[3], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
Methods with a fixed arity of four:<br>
|
||||
<%= toFuncList(_.difference(mapping.aryMethod[4], _.keys(mapping.skipFixed))) %>
|
||||
|
||||
#### Rearranged Arguments
|
||||
|
||||
Method arguments are rearranged to make composition easier.
|
||||
```js
|
||||
// `lodash/filter` is data-first iteratee-last:
|
||||
// (collection, iteratee)
|
||||
var compact = _.partial(_.filter, _, Boolean);
|
||||
compact(['a', null, 'c']);
|
||||
// → ['a', 'c']
|
||||
|
||||
// `lodash/fp/filter` is iteratee-first data-last:
|
||||
// (iteratee, collection)
|
||||
var compact = fp.filter(Boolean);
|
||||
compact(['a', null, 'c']);
|
||||
// → ['a', 'c']
|
||||
```
|
||||
|
||||
##### Most methods follow these rules
|
||||
|
||||
A fixed arity of two has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[2]) %>
|
||||
|
||||
A fixed arity of three has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[3]) %>
|
||||
|
||||
A fixed arity of four has an argument order of:<br>
|
||||
<%= toArgOrder(mapping.aryRearg[4]) %>
|
||||
|
||||
##### Exceptions to the rules
|
||||
|
||||
Methods that accept an array of arguments as their second parameter:<br>
|
||||
<%= toFuncList(_.keys(mapping.methodSpread)) %>
|
||||
|
||||
Methods with unchanged argument orders:<br>
|
||||
<%= toFuncList(_.keys(mapping.skipRearg)) %>
|
||||
|
||||
Methods with custom argument orders:<br>
|
||||
<%= _.map(_.keys(mapping.methodRearg), function(methodName) {
|
||||
var orders = mapping.methodRearg[methodName];
|
||||
return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
|
||||
}).join('\n') %>
|
||||
|
||||
#### New Methods
|
||||
|
||||
Not all variadic methods have corresponding new method variants. Feel free to
|
||||
[request](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md#feature-requests)
|
||||
any additions.
|
||||
|
||||
Methods created to accommodate Lodash’s variadic methods:<br>
|
||||
<%= toFuncList(_.keys(mapping.remap)) %>
|
||||
|
||||
#### Aliases
|
||||
|
||||
There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
|
||||
<%= _.map(_.keys(mapping.aliasToReal).sort(), function(alias) {
|
||||
var realName = mapping.aliasToReal[alias];
|
||||
return ' * `_.' + alias + '` is an alias of `_.' + realName + '`';
|
||||
}).join('\n') %>
|
||||
|
||||
## Placeholders
|
||||
|
||||
The placeholder argument, which defaults to `_`, may be used to fill in method
|
||||
arguments in a different order. Placeholders are filled by the first available
|
||||
arguments of the curried returned function.
|
||||
```js
|
||||
// The equivalent of `2 > 5`.
|
||||
_.gt(2)(5);
|
||||
// → false
|
||||
|
||||
// The equivalent of `_.gt(5, 2)` or `5 > 2`.
|
||||
_.gt(_, 2)(5);
|
||||
// → true
|
||||
```
|
||||
|
||||
## Chaining
|
||||
|
||||
The `lodash/fp` module **does not** convert chain sequence methods. See
|
||||
[Izaak Schroeder’s article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
|
||||
on using functional composition as an alternative to method chaining.
|
||||
|
||||
## Convert
|
||||
|
||||
Although `lodash/fp` & its method modules come pre-converted, there are times
|
||||
when you may want to customize the conversion. That’s when the `convert` method
|
||||
comes in handy.
|
||||
```js
|
||||
// Every option is `true` by default.
|
||||
var _fp = fp.convert({
|
||||
// Specify capping iteratee arguments.
|
||||
'cap': true,
|
||||
// Specify currying.
|
||||
'curry': true,
|
||||
// Specify fixed arity.
|
||||
'fixed': true,
|
||||
// Specify immutable operations.
|
||||
'immutable': true,
|
||||
// Specify rearranging arguments.
|
||||
'rearg': true
|
||||
});
|
||||
|
||||
// The `convert` method is available on each method too.
|
||||
var mapValuesWithKey = fp.mapValues.convert({ 'cap': false });
|
||||
|
||||
// Here’s an example of disabling iteratee argument caps to access the `key` param.
|
||||
mapValuesWithKey(function(value, key) {
|
||||
return key == 'a' ? -1 : value;
|
||||
})({ 'a': 1, 'b': 1 });
|
||||
// => { 'a': -1, 'b': 1 }
|
||||
```
|
||||
|
||||
Manual conversions are also possible with the `convert` module.
|
||||
```js
|
||||
var convert = require('lodash/fp/convert');
|
||||
|
||||
// Convert by name.
|
||||
var assign = convert('assign', require('lodash.assign'));
|
||||
|
||||
// Convert by object.
|
||||
var fp = convert({
|
||||
'assign': require('lodash.assign'),
|
||||
'chunk': require('lodash.chunk')
|
||||
});
|
||||
|
||||
// Convert by `lodash` instance.
|
||||
var fp = convert(lodash.runInContext());
|
||||
```
|
||||
|
||||
## 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'),
|
||||
'spread': require('../spread'),
|
||||
'toPath': require('../toPath')
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('./<%= name %>');
|
||||
@@ -1,2 +0,0 @@
|
||||
var convert = require('./convert');
|
||||
module.exports = convert(require('../<%= name %>'));
|
||||
@@ -1,18 +0,0 @@
|
||||
var baseConvert = require('./_baseConvert'),
|
||||
util = require('./_util');
|
||||
|
||||
/**
|
||||
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
|
||||
* version with conversion `options` applied. If `name` is an object its methods
|
||||
* will be converted.
|
||||
*
|
||||
* @param {string} name The name of the function to wrap.
|
||||
* @param {Function} [func] The function to wrap.
|
||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||
* @returns {Function|Object} Returns the converted function or object.
|
||||
*/
|
||||
function convert(name, func, options) {
|
||||
return baseConvert(util, name, func, options);
|
||||
}
|
||||
|
||||
module.exports = convert;
|
||||
@@ -1,2 +0,0 @@
|
||||
var _ = require('./lodash.min').runInContext();
|
||||
module.exports = require('./fp/_baseConvert')(_, _);
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,5 +0,0 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -1,30 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var async = require('async'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist'),
|
||||
filename = 'lodash.js';
|
||||
|
||||
var baseLodash = path.join(basePath, filename),
|
||||
distLodash = path.join(distPath, filename);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build() {
|
||||
async.series([
|
||||
file.copy(baseLodash, distLodash),
|
||||
file.min(distLodash)
|
||||
], onComplete);
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -1,60 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
docdown = require('docdown'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
docPath = path.join(basePath, 'doc'),
|
||||
readmePath = path.join(docPath, 'README.md');
|
||||
|
||||
var pkg = require('../../package.json'),
|
||||
version = pkg.version;
|
||||
|
||||
var config = {
|
||||
'base': {
|
||||
'entryLinks': [
|
||||
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
|
||||
'print("[Ⓝ](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' +
|
||||
'} %>'
|
||||
],
|
||||
'path': path.join(basePath, 'lodash.js'),
|
||||
'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
|
||||
'toc': 'categories',
|
||||
'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
|
||||
},
|
||||
'github': {
|
||||
'hash': 'github'
|
||||
},
|
||||
'site': {
|
||||
'tocLink': '#docs'
|
||||
}
|
||||
};
|
||||
|
||||
function postprocess(string) {
|
||||
// Fix docdown bugs.
|
||||
return string
|
||||
// Repair the default value of `chars`.
|
||||
// See https://github.com/eslint/doctrine/issues/157 for more details.
|
||||
.replace(/\bchars=''/g, "chars=' '")
|
||||
// Wrap symbol property identifiers in brackets.
|
||||
.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(type) {
|
||||
var options = _.defaults({}, config.base, config[type]),
|
||||
markdown = docdown(options);
|
||||
|
||||
fs.writeFile(readmePath, postprocess(markdown), onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
@@ -1,34 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash'),
|
||||
async = require('async'),
|
||||
path = require('path');
|
||||
|
||||
var file = require('../common/file');
|
||||
|
||||
var basePath = path.join(__dirname, '..', '..'),
|
||||
distPath = path.join(basePath, 'dist');
|
||||
|
||||
var filePairs = [
|
||||
[path.join(distPath, 'lodash.core.js'), 'core.js'],
|
||||
[path.join(distPath, 'lodash.core.min.js'), 'core.min.js'],
|
||||
[path.join(distPath, 'lodash.min.js'), 'lodash.min.js']
|
||||
];
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
function onComplete(error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function build(target) {
|
||||
var actions = _.map(filePairs, function(pair) {
|
||||
return file.copy(pair[0], path.join(target, pair[1]));
|
||||
});
|
||||
|
||||
async.series(actions, onComplete);
|
||||
}
|
||||
|
||||
build(_.last(process.argv));
|
||||
88
package.json
88
package.json
@@ -1,54 +1,50 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "4.12.0",
|
||||
"version": "5.0.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"main": "lodash.js",
|
||||
"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",
|
||||
"pretest": "npm run build",
|
||||
"style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test",
|
||||
"style:fp": "jscs fp/*.js lib/**/*.js",
|
||||
"style:main": "jscs lodash.js",
|
||||
"style:perf": "jscs perf/*.js perf/**/*.js",
|
||||
"style:test": "jscs test/*.js test/**/*.js",
|
||||
"test": "npm run test:main && npm run test:fp",
|
||||
"test:doc": "markdown-doctest",
|
||||
"test:fp": "node test/test-fp",
|
||||
"test:main": "node test/test",
|
||||
"validate": "npm run style && npm run test"
|
||||
"prepare": "husky install",
|
||||
"lint": "eslint ./src/**/*.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^1.5.2",
|
||||
"benchmark": "^2.1.0",
|
||||
"chalk": "^1.1.3",
|
||||
"codecov.io": "~0.1.6",
|
||||
"coveralls": "^2.11.9",
|
||||
"curl-amd": "~0.8.12",
|
||||
"docdown": "~0.5.1",
|
||||
"dojo": "^1.11.1",
|
||||
"ecstatic": "^1.4.0",
|
||||
"fs-extra": "~0.30.0",
|
||||
"glob": "^7.0.3",
|
||||
"istanbul": "0.4.3",
|
||||
"jquery": "^2.2.3",
|
||||
"jscs": "^3.0.1",
|
||||
"lodash": "4.11.2",
|
||||
"markdown-doctest": "^0.4.0",
|
||||
"platform": "^1.3.1",
|
||||
"qunit-extras": "^2.0.0",
|
||||
"qunitjs": "~1.23.1",
|
||||
"request": "^2.69.0",
|
||||
"requirejs": "^2.2.0",
|
||||
"sauce-tunnel": "^2.4.0",
|
||||
"uglify-js": "2.6.2",
|
||||
"webpack": "^1.12.15"
|
||||
}
|
||||
"@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"
|
||||
},
|
||||
"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,131 +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 = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {string} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// Initialize controls.
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
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</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;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(otherList, 'change', eventHandler);
|
||||
});
|
||||
|
||||
// The lodash build file path.
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case null: build = 'lodash';
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// The other library file path.
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash': result = 'dist/lodash.min.js'; break;
|
||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||
case null: other = 'underscore';
|
||||
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
|
||||
default: return other;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
ui.urlParams = { 'build': build, 'other': other };
|
||||
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
@@ -1,69 +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: 2em;
|
||||
}
|
||||
#perf-toolbar {
|
||||
background-color: #EEE;
|
||||
color: #5E740B;
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
font-size: small;
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="perf-toolbar"></div>
|
||||
<script src="../lodash.js"></script>
|
||||
<script src="../node_modules/platform/platform.js"></script>
|
||||
<script src="../node_modules/benchmark/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="./asset/perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var measured,
|
||||
perfNow,
|
||||
begin = new Date;
|
||||
|
||||
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>
|
||||
1977
perf/perf.js
1977
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