Skip to content

Instantly share code, notes, and snippets.

@TylorS

TylorS/dissoc.ts

Created Jan 1, 2018
Embed
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]
}[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