Skip to content

Instantly share code, notes, and snippets.

@Jtosbornex
Created December 29, 2020 18:20
Show Gist options
  • Save Jtosbornex/1f2160e5abe723ccca2ecaf3f9ac7e45 to your computer and use it in GitHub Desktop.
Save Jtosbornex/1f2160e5abe723ccca2ecaf3f9ac7e45 to your computer and use it in GitHub Desktop.
Typescirpt PickOne Property from Object
export type PickOne<T> = { [P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>> }[keyof T];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment