Skip to content

Instantly share code, notes, and snippets.

View brother-donkey's full-sized avatar

Will Bjorn brother-donkey

  • Seattle, WA
View GitHub Profile
@brother-donkey
brother-donkey / require-at-least-one.ts
Last active October 13, 2025 02:24
One property required, while others are optional
type RequireAtLeastOne<T> = {
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
}[keyof T];