New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removal of _.omit in v5.0.0? #2930
Comments
Hi @billyjanitsch! The My guidance would be to be explicit. Your code should really know the properties it's consuming. Using the Babel plugin transform-object-rest-spread/ is another great way to handle it. |
We use omit a lot and it's mostly when using objects as maps. We also require immutability, but I guess we can clone and then delete or use object spread even though it's not stage 4 yet. |
@billyjanitsch - Out of curiosity, are you passing |
I'm currently using |
unset mutates whereas omit doesn't. unset also doesn't take multiple paths (at least in v4, haven't checked if this was changed for v5) |
Sad too hear this, since I'm looking for 'omit' then find this lib. This is all about utilities, don't know why you would deprecate this useful & handy function. |
But I didn't come to Please excuse my ignorance, is the implementation not as simple as something like:
This seems quite a loss to the library. Other language libraries seem to handle this just fine: https://laravel.com/docs/5.6/collections#method-except |
the problem isn't the complexity of the algorithm, it's the poor performance of it. This should be explained in the related comments |
Seems to me the performance is |
Sorry folks, this design choice is not up for debate. |
I noticed that
_.omit
has been removed in master, slated for v5.0.0. I couldn't find any discussion of the decision; I'm just wondering why you've chosen to remove it.FWIW, it's one of my most frequently used Lodash methods. The roadmap suggests using
_.pick
instead, but it's not clear how that supports my typical use case: I want to remove keysx
andy
, but I don't know the structure of the rest of the object, so I don't know which remaining keys to pick. Maybe I'm missing something?Cheers.
The text was updated successfully, but these errors were encountered: