Closed dayongkr closed 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
es-toolkit | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 29, 2024 2:05am |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.77%. Comparing base (
b9966aa
) to head (8258b85
).
I Improved performance by preparing all cases of criterion before comparing.
At now, we don't need to use isKey
(heavy function) each criterion.
N: length of collection, K: length of criteria O(NK) -> 0
And also we convert deep path to nested path at once. Before code converted each collection items.
N: length of collection, K: length of criteria O(NK) -> O(K)
Thanks for your great work!
After merging this PR, I am going to implement compat/sortBy based on compat/orderBy!
Description
compat/orderby
missed including these testcases(https://github.com/lodash/lodash/blob/6a2cc1dfcf7634fea70d1bc5bd22db453df67b42/test/sortBy-methods.spec.js) and hidden case(only implemented). And it also missed some of feature, so I added.! Important
Currently, we had a bug that makes by below code:
Before the changes, it checked the key is not a deep path only with the first element of the collection. So if the first element is different with others, then throw the TypeError like this:
So I changed the logic of checking keys similar with lodash(slower but safer).
Benchmarks
The performance result is changed, you can check result by a comment.