Skip to content

Instantly share code, notes, and snippets.

Created Jan 1, 2018
What would you like to do?
Dissoc Type For Typescript
type Subtract<A extends string, B extends string> = {
readonly [Key in A]: (Record<B, never> & Record<string, Key>)[Key]
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