s2cfgtojson 2.3.0 → 3.0.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./types.mts";
2
2
  export * from "./enums.mts";
3
- import { DefaultEntries, Struct as IStruct, Value } from "./types.mts";
3
+ import { DefaultEntries, IStruct, Value } from "./types.mts";
4
4
 
5
5
  const TAB = " ";
6
6
  const WILDCARD = "_wildcard";
package/Struct.test.mts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { describe, test, expect } from "vitest";
2
- import { createDynamicClassInstance, ERank, pad, Struct } from "./Struct.mjs";
2
+ import {
3
+ createDynamicClassInstance,
4
+ ERank,
5
+ pad,
6
+ IStruct,
7
+ Struct,
8
+ } from "./Struct.mjs";
3
9
  import fs from "node:fs";
4
10
 
5
11
  class ChimeraHPFix extends Struct {
@@ -196,7 +202,7 @@ struct.end`;
196
202
  N5 = .1f
197
203
  N6 = -2.22f
198
204
  struct.end`;
199
- const str = Struct.fromString<Struct & { [key: `N${number}`]: number }>(
205
+ const str = Struct.fromString<IStruct & { [key: `N${number}`]: number }>(
200
206
  dynamicItemGeneratorText,
201
207
  );
202
208
  expect(str[0].N1).toBe(0.1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s2cfgtojson",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "description": "Converts Stalker 2 Cfg file into POJOs",
5
5
  "keywords": [
6
6
  "stalker",
package/types.mts CHANGED
@@ -68,7 +68,7 @@ import {
68
68
  } from "./enums.mjs";
69
69
 
70
70
  export type Internal = "__internal__";
71
- export type Struct = {
71
+ export type IStruct = {
72
72
  [k in Internal]: DefaultEntries;
73
73
  };
74
74
 
@@ -87,8 +87,8 @@ export type Value = string | boolean | number;
87
87
 
88
88
  export type Entries = Record<string | number, Value>;
89
89
 
90
- export type GetTsType<E extends Struct> = {
91
- [key in Exclude<keyof E, Internal>]: E[key] extends Struct
90
+ export type GetTsType<E extends IStruct> = {
91
+ [key in Exclude<keyof E, Internal>]: E[key] extends IStruct
92
92
  ? GetTsType<E[key]>
93
93
  : E[key];
94
94
  };
@@ -96,9 +96,9 @@ type RKey<In> = Exclude<keyof In, keyof DefaultEntries>;
96
96
 
97
97
  export type GetStructType<In> =
98
98
  In extends Array<any>
99
- ? Struct & { [key in number]: GetStructType<In[key]> }
99
+ ? IStruct & { [key in number]: GetStructType<In[key]> }
100
100
  : In extends Record<any, any>
101
- ? Struct & { [key in RKey<In>]: GetStructType<In[key]> }
101
+ ? IStruct & { [key in RKey<In>]: GetStructType<In[key]> }
102
102
  : In extends string
103
103
  ? In
104
104
  : In extends number