Created
September 16, 2023 13:01
-
-
Save vjau/f136c9ff37591cc853faf5a43025db7a to your computer and use it in GitHub Desktop.
Utility Typescript Type to know when exactOptionalPropertyTypes is set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type _Intersect = {a?:number} & {a:number|undefined}; | |
//state of exactOptionalPropertyTypes | |
type IsExactOptional = _Intersect["a"] extends Exclude<_Intersect["a"], undefined> ? true : false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment