( error: ArkError )
| 1166 | * key's too |
| 1167 | */ |
| 1168 | export const configuredMessageOf = ( |
| 1169 | error: ArkError |
| 1170 | ): MessageConfig<never> | undefined => { |
| 1171 | const message = error.meta?.message |
| 1172 | if (message !== undefined || error.code !== "required") return message |
| 1173 | const ofValue = error.valueMeta?.message |
| 1174 | // a writer reads the context of an error of its value, which a key has none of |
| 1175 | return typeof ofValue === "string" ? ofValue : undefined |
| 1176 | } |
| 1177 | |
| 1178 | // a written error's line of a summary: its message alone at the root or |
| 1179 | // where it lists its errors, and after its path anywhere else |
no outgoing calls
no test coverage detected