-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Any interest / reason to not want this type added? I can make a PR if so:
type ExtractStrict<T, U extends T> = T extends U ? T : nevercontext:
- Design Meeting Notes, 4/3/2019 microsoft/TypeScript#30738
- add stricter Omit helper type microsoft/TypeScript#30825
- Add OmitStrict type for when you don't want to be permissive. #31
Seems like the TS team's reasoning for making their official Omit non-strict included the fact that Extract was also non-strict, which is something I just ran into wanting. Just like OmitStrict, ExtractStrict will get the compiler to help out during refactoring things like this, or to prevent typos in the string keys:
export type TSomeColorOptions = ExtractStrict<TColor, 'blue' | 'whitee'> // should error for typoMetadata
Metadata
Assignees
Labels
No labels