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.
Files changed (2) hide show
  1. package/Struct.mts +14 -5
  2. 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
- export type GetStructType<In extends Record<string | number, any>> = Struct<{
12
- [key in Exclude<keyof In, keyof DefaultEntries>]: In[key] extends In
13
- ? GetStructType<In[key]>
14
- : In[key];
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s2cfgtojson",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Converts Stalker 2 Cfg file into a POJO",
5
5
  "keywords": [
6
6
  "stalker",