Skip to content

Commit 65bd52a

Browse files
authored
optimize recursive type definition (#36)
1 parent da372fa commit 65bd52a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ export type ValueOfFieldState<State> = (
6969
: never
7070
)
7171

72-
/** Value Array of given Field. */
73-
// workaround for recursive type reference: https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
74-
// not needed for [email protected]+: https://github.com/microsoft/TypeScript/pull/33050
75-
export interface ValueArrayOf<Field> extends Array<ValueOf<Field>> {}
76-
7772
/** Value of object-fields. */
7873
export type ValueOfObjectFields<Fields> = {
7974
[FieldKey in keyof Fields]: ValueOf<Fields[FieldKey]>
@@ -82,7 +77,7 @@ export type ValueOfObjectFields<Fields> = {
8277
/** Value of array-fields. */
8378
export type ValueOfArrayFields<Fields> = (
8479
Fields extends Array<infer Field>
85-
? ValueArrayOf<Field>
80+
? Array<ValueOf<Field>>
8681
: never
8782
)
8883

0 commit comments

Comments
 (0)