MCPcopy Create free account
hub / github.com/arktypeio/arktype / configuredMessageOf

Function configuredMessageOf

ark/schema/shared/errors.ts:1168–1176  ·  view source on GitHub ↗
(
	error: ArkError
)

Source from the content-addressed store, hash-verified

1166 * key's too
1167 */
1168export 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

Callers 5

configOfFunction · 0.90
isCustomFunction · 0.85
unconfiguredFunction · 0.85
sharedMessageOfFunction · 0.85
writeTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected