Skip to content

Commit bf84032

Browse files
committed
get rid of separate IsTuple helper just do the check inline
1 parent 0d983c4 commit bf84032

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/router-core/src/ssr/serializer/transformer.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,16 @@ type ApplyArrayValidation<
7979
? ValidateSerializable<TValue, TSerializable>
8080
: ValidateSerializableResult<TValue, TSerializable>
8181

82-
type IsTuple<T extends ReadonlyArray<unknown>> = number extends T['length']
83-
? false
84-
: true
85-
8682
type ValidateSerializableArrayCore<
8783
T extends ReadonlyArray<unknown>,
8884
TSerializable,
8985
TKind extends 'input' | 'result',
9086
> = T extends any
91-
? IsTuple<T> extends true
92-
? { [K in keyof T]: ApplyArrayValidation<T[K], TSerializable, TKind> }
93-
: T extends Array<infer U>
87+
? number extends T['length']
88+
? T extends Array<infer U>
9489
? Array<ApplyArrayValidation<U, TSerializable, TKind>>
9590
: ReadonlyArray<ApplyArrayValidation<T[number], TSerializable, TKind>>
91+
: { [K in keyof T]: ApplyArrayValidation<T[K], TSerializable, TKind> }
9692
: never
9793

9894
type ValidateSerializableArray<

0 commit comments

Comments
 (0)