Skip to content

Commit

Permalink
refactor: remove intersection with keys-of-union
Browse files Browse the repository at this point in the history
  • Loading branch information
som-sm committed Jan 20, 2025
1 parent 21079e0 commit db0ce32
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/set-optional.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export type SetOptional<BaseType, Keys extends keyof BaseType> =
// Pick just the keys that are readonly from the base type.
Except<BaseType, Keys> &
// Pick the keys that should be mutable from the base type and make them mutable.
Partial<HomomorphicPick<BaseType, Keys & KeysOfUnion<BaseType>>>
Partial<HomomorphicPick<BaseType, Keys>>
>
: never;
2 changes: 1 addition & 1 deletion source/set-readonly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ export type SetReadonly<BaseType, Keys extends keyof BaseType> =
BaseType extends unknown
? Simplify<
Except<BaseType, Keys> &
Readonly<HomomorphicPick<BaseType, Keys & KeysOfUnion<BaseType>>>
Readonly<HomomorphicPick<BaseType, Keys>>
>
: never;
2 changes: 1 addition & 1 deletion source/set-required.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type SetRequired<BaseType, Keys extends keyof BaseType> =
// Pick just the keys that are optional from the base type.
Except<BaseType, Keys> &
// Pick the keys that should be required from the base type and make them required.
Required<HomomorphicPick<BaseType, Keys & KeysOfUnion<BaseType>>>
Required<HomomorphicPick<BaseType, Keys>>
>;

/**
Expand Down

0 comments on commit db0ce32

Please sign in to comment.