Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Dec 19, 2024
1 parent d28bf64 commit a1635c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/@types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U,
export type Writeable<T> = { -readonly [P in keyof T]: T[P] };

/**
* Returns a union type of the keys of the input object type whose values are assignable to the given type.
* Returns a union type of the keys of the input Object type whose values are assignable to the given Item type.
* Based on https://stackoverflow.com/a/57862073
*/
export type Assignable<Obj, Item> = {
[Key in keyof Obj]: Obj[Key] extends Item ? Key : never;
}[keyof Obj];
export type Assignable<Object, Item> = {
[Key in keyof Object]: Object[Key] extends Item ? Key : never;
}[keyof Object];

0 comments on commit a1635c5

Please sign in to comment.