s2cfgtojson 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Struct.mts +14 -5
- package/package.json +1 -1
package/Struct.mts
CHANGED
|
@@ -8,11 +8,20 @@ export type GetTsType<In extends Struct, E = In["entries"]> = {
|
|
|
8
8
|
? GetTsType<E[key]>
|
|
9
9
|
: E[key];
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
11
|
+
type RKey<In> = Exclude<keyof In, keyof DefaultEntries>;
|
|
12
|
+
|
|
13
|
+
export type GetStructType<In> =
|
|
14
|
+
In extends Array<any>
|
|
15
|
+
? Struct<{ [key: number]: GetStructType<In[number]> }>
|
|
16
|
+
: In extends Record<any, any>
|
|
17
|
+
? Struct<{ [key in RKey<In>]: GetStructType<In[key]> }>
|
|
18
|
+
: In extends string
|
|
19
|
+
? string
|
|
20
|
+
: In extends number
|
|
21
|
+
? number
|
|
22
|
+
: In extends boolean
|
|
23
|
+
? boolean
|
|
24
|
+
: never;
|
|
16
25
|
|
|
17
26
|
/**
|
|
18
27
|
* This file is part of the Stalker 2 Modding Tools project.
|