mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
fix(config-editor): preserve source YAML edits and empty keys
This commit is contained in:
@@ -78,7 +78,11 @@ function setStringInDoc(doc: YamlDocument, path: YamlPath, value: unknown): void
|
||||
doc.setIn(path, safe);
|
||||
return;
|
||||
}
|
||||
if (docHas(doc, path)) doc.deleteIn(path);
|
||||
// Preserve existing empty-string keys to avoid dropping template blocks/comments.
|
||||
// Only keep the key when it already exists in the YAML.
|
||||
if (docHas(doc, path)) {
|
||||
doc.setIn(path, '');
|
||||
}
|
||||
}
|
||||
|
||||
function setIntFromStringInDoc(doc: YamlDocument, path: YamlPath, value: unknown): void {
|
||||
|
||||
Reference in New Issue
Block a user