Created
January 1, 2018 17:15
-
-
Save TylorS/182bb6d11f1e2819f83aa5207e2a6332 to your computer and use it in GitHub Desktop.
Dissoc Type For Typescript
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 Subtract<A extends string, B extends string> = { | |
readonly [Key in A]: (Record<B, never> & Record<string, Key>)[Key] | |
}[A] | |
type Dissoc<A, B extends string> = Readonly<Pick<A, Subtract<keyof A, B>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment