Skip to content

Instantly share code, notes, and snippets.

@insyri
Created December 19, 2021 07:03
Show Gist options
  • Save insyri/ef885975990d2ab71524f097283e205f to your computer and use it in GitHub Desktop.
Save insyri/ef885975990d2ab71524f097283e205f to your computer and use it in GitHub Desktop.
// https://docs.microsoft.com/en-us/javascript/api/@azure/keyvault-certificates/requireatleastone
export type RequireAtLeastOne<T> = {
[K in keyof T]-?: Required<Pick<T, K>> &
Partial<Pick<T, Exclude<keyof T, K>>>;
}[keyof T];
export type ExampleOne = RequireAtLeastOne<{
optionOne: string;
optionTwo: string;
}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment