Skip to content

Commit

Permalink
Use Constrained Key Type of TEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Oct 26, 2023
1 parent 33af267 commit 9fb6e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ export interface TPromise<T extends TSchema = TSchema> extends TSchema {
export type TRecordFromUnionLiteralString<K extends TLiteralString, T extends TSchema> = { [_ in K['const']]: T }
export type TRecordFromUnionLiteralNumber<K extends TLiteralNumber, T extends TSchema> = { [_ in K['const']]: T }
// prettier-ignore
export type TRecordFromEnumKey<K extends TSchema, T extends TSchema> = Ensure<TRecord<K, T>>
export type TRecordFromEnumKey<K extends TEnum, T extends TSchema> = Ensure<TRecord<K, T>>
// prettier-ignore
export type TRecordFromUnionRest<K extends TSchema[], T extends TSchema> = K extends [infer L, ...infer R] ? (
L extends TUnion<infer S> ? TRecordFromUnionRest<S, T> & TRecordFromUnionRest<AssertRest<R>, T> :
Expand Down

0 comments on commit 9fb6e46

Please sign in to comment.