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

Function writeKeywordExpected

ark/schema/shared/locale.ts:257–268  ·  view source on GitHub ↗
(
	error: Locale.ExpectedContext | MissingBasis,
	locale: Locale.Resolved
)

Source from the content-addressed store, hash-verified

255
256/** a locale's phrase for a keyword, if it has one, as expected text */
257export const writeKeywordExpected = (
258 error: Locale.ExpectedContext | MissingBasis,
259 locale: Locale.Resolved
260): string | undefined => {
261 const phrase = keywordPhraseOf(error, locale)
262 return (
263 typeof phrase !== "object" ? phrase
264 : phrase.expected === undefined ? phrase.noun
265 : typeof phrase.expected === "string" ? phrase.expected
266 : phrase.expected(error, locale)
267 )
268}
269
270/** renders a missing value where expected text goes */
271export const describeMissing = (

Callers 3

phrases.test.tsFile · 0.90
localeExpectedFunction · 0.90
de.tsFile · 0.85

Calls 1

keywordPhraseOfFunction · 0.85

Tested by

no test coverage detected