**feat(util): add DeleteKey function and update antigravity executor for Claude model compatibility**

This commit is contained in:
Luis Pater
2025-12-05 01:55:45 +08:00
parent a7eeb06f3d
commit d6352dd4d4
2 changed files with 28 additions and 0 deletions

View File

@@ -79,6 +79,15 @@ func RenameKey(jsonStr, oldKeyPath, newKeyPath string) (string, error) {
return finalJson, nil
}
func DeleteKey(jsonStr, keyName string) string {
paths := make([]string, 0)
Walk(gjson.Parse(jsonStr), "", keyName, &paths)
for _, p := range paths {
jsonStr, _ = sjson.Delete(jsonStr, p)
}
return jsonStr
}
// FixJSON converts non-standard JSON that uses single quotes for strings into
// RFC 8259-compliant JSON by converting those single-quoted strings to
// double-quoted strings with proper escaping.