s2cfgtojson 1.0.3 → 1.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 +5 -2
- package/package.json +1 -1
package/Struct.mts
CHANGED
|
@@ -163,7 +163,7 @@ export abstract class Struct<T extends Entries = {}> {
|
|
|
163
163
|
Struct.parseStructName(match[1].trim()) || `UnnamedStruct${index}`;
|
|
164
164
|
|
|
165
165
|
const dummy = new (Struct.createDynamicClass(name))();
|
|
166
|
-
dummy._id = match[1];
|
|
166
|
+
dummy._id = match[1].trim();
|
|
167
167
|
if (match[3]) {
|
|
168
168
|
const refs = match[3]
|
|
169
169
|
.split(";")
|
|
@@ -190,7 +190,10 @@ export abstract class Struct<T extends Entries = {}> {
|
|
|
190
190
|
throw new Error(`Invalid key-value pair: ${line}`);
|
|
191
191
|
}
|
|
192
192
|
const key = match[1].trim();
|
|
193
|
-
|
|
193
|
+
let value: string | number = match[3].trim();
|
|
194
|
+
try {
|
|
195
|
+
value = JSON.parse(value);
|
|
196
|
+
} catch (e) {}
|
|
194
197
|
Struct.addEntry(parent, key, value, index);
|
|
195
198
|
};
|
|
196
199
|
let index = 0;
|