mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
fix: address PR review feedback for JSON fallback
- Simplify escapeXml() using 'str == null' check (type narrowing) - Add validation for extracted JSON before passing to specToXml() - Prevents runtime errors when JSON doesn't match SpecOutput schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,10 +14,10 @@ export { specOutputSchema } from '@automaker/types';
|
||||
* Handles undefined/null values by converting them to empty strings
|
||||
*/
|
||||
function escapeXml(str: string | undefined | null): string {
|
||||
if (str === undefined || str === null) {
|
||||
if (str == null) {
|
||||
return '';
|
||||
}
|
||||
return String(str)
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
|
||||
Reference in New Issue
Block a user