(data)
| 22 | } |
| 23 | |
| 24 | function validateReviewResultShape(data) { |
| 25 | if (!data || typeof data !== "object" || Array.isArray(data)) { |
| 26 | return "Expected a top-level JSON object."; |
| 27 | } |
| 28 | if (typeof data.verdict !== "string" || !data.verdict.trim()) { |
| 29 | return "Missing string `verdict`."; |
| 30 | } |
| 31 | if (typeof data.summary !== "string" || !data.summary.trim()) { |
| 32 | return "Missing string `summary`."; |
| 33 | } |
| 34 | if (!Array.isArray(data.findings)) { |
| 35 | return "Missing array `findings`."; |
| 36 | } |
| 37 | if (!Array.isArray(data.next_steps)) { |
| 38 | return "Missing array `next_steps`."; |
| 39 | } |
| 40 | return null; |
| 41 | } |
| 42 | |
| 43 | function normalizeReviewFinding(finding, index) { |
| 44 | const source = finding && typeof finding === "object" && !Array.isArray(finding) ? finding : {}; |
no outgoing calls
no test coverage detected