Skip to content

Commit a9e5606

Browse files
committed
Reverted prettify from SuperStruct, caused errors.
1 parent c556ee5 commit a9e5606

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

src/lib/superStruct.ts

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import type { Prettify } from './utils.js';
2-
3-
export type SuperStructArray<
4-
T extends Record<string, unknown>,
5-
Data,
6-
ArrayData = unknown
7-
> = Prettify<{
1+
export type SuperStructArray<T extends Record<string, unknown>, Data, ArrayData = unknown> = {
82
// eslint-disable-next-line @typescript-eslint/no-explicit-any
93
[Property in keyof T]?: T extends any
104
? NonNullable<T[Property]> extends Record<string, unknown>
@@ -19,19 +13,17 @@ export type SuperStructArray<
1913
>
2014
: Data
2115
: never;
22-
}>;
16+
};
2317

24-
export type SuperStruct<T extends Record<string, unknown>, Data> = Prettify<
25-
Partial<{
26-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
27-
[Property in keyof T]: T extends any
28-
? NonNullable<T[Property]> extends Record<string, unknown>
29-
? SuperStruct<NonNullable<T[Property]>, Data>
30-
: NonNullable<T[Property]> extends (infer A)[]
31-
? NonNullable<A> extends Record<string, unknown>
32-
? SuperStruct<NonNullable<A>, Data>
33-
: Data
18+
export type SuperStruct<T extends Record<string, unknown>, Data> = Partial<{
19+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20+
[Property in keyof T]: T extends any
21+
? NonNullable<T[Property]> extends Record<string, unknown>
22+
? SuperStruct<NonNullable<T[Property]>, Data>
23+
: NonNullable<T[Property]> extends (infer A)[]
24+
? NonNullable<A> extends Record<string, unknown>
25+
? SuperStruct<NonNullable<A>, Data>
3426
: Data
35-
: never;
36-
}>
37-
>;
27+
: Data
28+
: never;
29+
}>;

0 commit comments

Comments
 (0)