Skip to content

Commit 9e51596

Browse files
committed
fix: Correctly infer optional enum arrays
1 parent 67d35d5 commit 9e51596

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/runtime/src/utils/type-utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ export type Simplify<T, D extends number = 6> = D extends 0
1616
: { [K in keyof T]: Simplify<T[K], _Depth[D]> } & {}
1717
: T;
1818

19-
export type WrapType<T, Optional = false, Array = false> = Optional extends true
20-
? T | null
21-
: Array extends true
22-
? T[]
19+
export type WrapType<T, Optional = false, Array = false> = Array extends true
20+
? Optional extends true
21+
? T[] | null
22+
: T[]
23+
: Optional extends true
24+
? T | null
2325
: T;
2426

2527
type TypeMap = {

0 commit comments

Comments
 (0)