type-fest
type-fest copied to clipboard
Writable doesn't only strip readonly from the keys
Hi! I encounter a weird bug, and I am not sure if I am using it wrong or it's broken somehow.
I am encountering an issue where the Writable
doesn't only strip the readonly
but it also changes the object's type structure. I expect that Writable simply removes readonly
from the first level of keys in the object.
I like the @utility-types approach to it, it seems simpler with a very similar result. Would you be open to have the same implementation here?
Thanks!
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- The funding will be given to active contributors.
- Thank you in advance for helping prioritize & fund our backlog.
Are you on the latest type-fest
version?
it seems simpler with a very similar result. Would you be open to have the same implementation here?
It's simpler because it doesn't accept an optional type parameter for what keys it should apply to.
I think we could add an overload when that parameter is not passed and use the simple handling.
Are you on the latest
type-fest
version?
Just double checked and yes I am. I have 4.5.0
and typescript 5.2.2
I think we could add an overload when that parameter is not passed and use the simple handling.
Yeah, it could be an idea 🚀. I tried it by passing each key as an optional type parameter and it worked as expected.
I think we could add an overload when that parameter is not passed and use the simple handling.
I think the core reason is we wrap the result with Simplify
, so we need to consider whether we should remove Simplify
even if we used overload.
Or create another type to do this.