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.
- package/Struct.mts +5 -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
|
-
|
|
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
|
}
|