s2cfgtojson 7.0.11 → 7.0.12

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 +5 -2
  2. package/package.json +1 -1
package/Struct.mts CHANGED
@@ -129,7 +129,7 @@ export class Struct implements Record<Internal, any> {
129
129
  return patch as this;
130
130
  }
131
131
 
132
- removeNode(key: keyof this) {
132
+ removeNode(key: Exclude<keyof this, Symbol>) {
133
133
  if (this.__internal__.bpatch !== true) {
134
134
  throw new Error(
135
135
  "Cannot remove node from non-patch struct. Use fork() first.",
@@ -138,7 +138,10 @@ export class Struct implements Record<Internal, any> {
138
138
  if (this[key] instanceof Struct) {
139
139
  this[key].__internal__.removenode = true;
140
140
  } else {
141
- this[key] = REMOVE_NODE as any;
141
+ console.warn(
142
+ `Attempting to remove node on non-struct value. Old value: '${this.__internal__.rawName}.${key}' = ${this[key]}. Assigning 'empty' instead.`,
143
+ );
144
+ this[key] = "empty" as any;
142
145
  }
143
146
  return this;
144
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s2cfgtojson",
3
- "version": "7.0.11",
3
+ "version": "7.0.12",
4
4
  "description": "Converts Stalker 2 Cfg file into POJOs",
5
5
  "keywords": [
6
6
  "stalker",