(issue: Issue)
| 1459 | } |
| 1460 | |
| 1461 | function findMessage(issue: Issue): string | undefined { |
| 1462 | // A Composite's ast describes the whole schema, not the failures it groups. |
| 1463 | if (issue._tag === "Pointer" || issue._tag === "Composite") return |
| 1464 | if (issue._tag === "Encoding") return findMessage(issue.issue) |
| 1465 | const annotations = issue._tag === "Filter" |
| 1466 | ? issue.filter.annotations |
| 1467 | : "annotations" in issue |
| 1468 | ? issue.annotations |
| 1469 | : issue.ast.annotations |
| 1470 | const message = annotations?.[ |
| 1471 | issue._tag === "MissingKey" |
| 1472 | ? "messageMissingKey" |
| 1473 | : issue._tag === "UnexpectedKey" |
| 1474 | ? "messageUnexpectedKey" |
| 1475 | : "message" |
| 1476 | ] |
| 1477 | if (typeof message === "string") return message |
| 1478 | } |
no outgoing calls
no test coverage detected