mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 08:23:12 +09:00
Allow removing properties with set-prop
Implement removal of properties in ConfigGroup.setProp, set_instance_config_prop, and the set-prop clusterioctl command.
This commit is contained in:
1 parent
dea3a30cae
commit
0e21060ea3
4 files changed
+24
-11
No files matched your search
@@ -448,7 +448,11 @@ class ConfigGroup {
|
||||
let prev = this._fields.get(name);
|
||||
let updated = {...prev || {}};
|
||||
|
||||
updated[prop] = value;
|
||||
if (value !== undefined) {
|
||||
updated[prop] = value;
|
||||
} else {
|
||||
delete updated[prop];
|
||||
}
|
||||
this._fields.set(name, updated);
|
||||
if (this._config && !isDeepStrictEqual(updated, prev)) {
|
||||
this._config.emit("fieldChanged", this, name, prev);
|
||||
|
||||
Reference in new issue
Block a user