Skip to content

Commit

Permalink
chore: a better way of RequireAtLeastOne
Browse files Browse the repository at this point in the history
  • Loading branch information
FinleyGe committed Jul 23, 2024
1 parent f0f3731 commit b7e1eec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/service/support/permission/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export type ReqHeaderAuthType = {
authorization?: string;
};

type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> &
{
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
[K in Keys]-?: Required<Pick<T, K>> & Partial<Omit<T, K>>;
}[Keys];

type authModeType = {
Expand Down

0 comments on commit b7e1eec

Please sign in to comment.