MCPcopy Create free account
hub / github.com/Effect-TS/effect / findMessage

Function findMessage

packages/effect/src/SchemaIssue.ts:1193–1209  ·  view source on GitHub ↗
(issue: Issue)

Source from the content-addressed store, hash-verified

1191}
1192
1193function findMessage(issue: Issue): string | undefined {
1194 if (issue._tag === "Pointer") return
1195 if (issue._tag === "Encoding") return findMessage(issue.issue)
1196 const annotations = issue._tag === "Filter"
1197 ? issue.filter.annotations
1198 : "annotations" in issue
1199 ? issue.annotations
1200 : issue.ast.annotations
1201 const message = annotations?.[
1202 issue._tag === "MissingKey"
1203 ? "messageMissingKey"
1204 : issue._tag === "UnexpectedKey"
1205 ? "messageUnexpectedKey"
1206 : "message"
1207 ]
1208 if (typeof message === "string") return message
1209}

Callers 4

defaultLeafHookFunction · 0.85
defaultCheckHookFunction · 0.85
toDefaultIssuesFunction · 0.85
formatIssueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected