Closed Beraliv closed 1 year ago
cc @gvergnaud @ecyrbe let me know what you think, I do agree this type can be simpler, but it has a lot of gaps that I'm happy to fix (I can do it for all deep types that are implemented)
If you're happy with this change, I will update all of them:
@Beraliv Thanks for fixing all of these edge cases, that looks great! What do you think about generalizing the PartialDeep function into a TransformDeep
one taking a mapper function to run on every object level?
Pushed a few commits to your branch with a proof of concept of this. It's lacking doc comments as well as unit tests, but if you find it interesting I'll let you take it from there :)
@Beraliv Thanks for fixing all of these edge cases, that looks great! What do you think about generalizing the PartialDeep function into a
TransformDeep
one taking a mapper function to run on every object level?Pushed a few commits to your branch with a proof of concept of this. It's lacking doc comments as well as unit tests, but if you find it interesting I'll let you take it from there :)
Absolutely, let me have a look at it later today and I will try to play with it this week
Fixed the remaining things, added doc and reformatted tests. I don't think we need to care too much about intersections with primitive types until we have an explicit feature request for this
Summary
Align type gaps for different structures:
Why
There are a lot of gaps in the implementation, I've covered all of them with tests
Let me know what happens with types that are extended (e.g. Error can be extended and usually people do that so I didn't include it in the list)