-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add OmitStrict type for when you don't want to be permissive. #31
Conversation
The build is failing for reasons unrelated to my changes. I see these failures locally as well, but I'm not sure how to fix them. |
Ping @pelotom, thoughts? |
🏓 @pelotom |
Seems reasonable; if you can make CI happy I'll merge. |
@seansfkelley I'm didn't end up using ParamTypes in my codebase (yet) due to a lag in getting dependencies updated. So I'm just now upgrading to TS 3.1! Separately, there exists this ticket:
I'll have time to look at ParamTypes in like a week or two, but if somebody could take a look at that issue & pr, and help us figure out the "right" fix, I certainly would be appreciative. |
What's the status on this? I find the behaviour of |
@pelotom looks like master fixed itself (new patch version of the language automatically pulled in?) so this PR now has passing builds. Could you take a look/merge/release it? |
Thank you! |
Just ran into this, thanks for bringing back the old functionality @seansfkelley . @pelotom, why was the original behavior removed here? 761eff9 Can't tell from the commit message. |
@ekilah it’s just a different use case, where you don’t want to have to check that the properties you’re omitting are actually defined on the source type (I’ve found this to be the most common use case in practice but YMMV). In retrospect though I shouldn’t have redefined |
@pelotom 👍 agreed, but too late now 😛 I will say that after doing a find/replace in my project, there was only one place where I actually wanted |
I preferred the old behavior of
Omit
before it was made permissive, but I understand the use-cases for it. This PR re-introduces the original behavior under a different name.The benefit that a stricter type has is primarily:
Currently, permissive
Omit
acts as a "barrier" that prevents rename refactors from passing through, which means that any such refactor generates whole bunches of errors that have to be manually fixed. If the field in question is optional, this can actually introduce bugs.I'm open to bike-shedding the name, but I'd like to have both types available so I don't have to pin to an old version of the library or re-declare my own strict variants!