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

Function configureLocale

ark/schema/shared/render.ts:37–50  ·  view source on GitHub ↗
(
	locale: Locale<string> | LocaleSelector | undefined,
	base: ResolvedConfig
)

Source from the content-addressed store, hash-verified

35 * passed, returning it if it isn't a function
36 */
37const configureLocale = (
38 locale: Locale<string> | LocaleSelector | undefined,
39 base: ResolvedConfig
40): Locale.Resolved => {
41 defaultLocale = base.locale
42 if (typeof locale === "function") {
43 selector = locale
44 configured = defaultLocale
45 } else {
46 selector = undefined
47 configured = locale === undefined ? defaultLocale : normalizeLocale(locale)
48 }
49 return configured
50}
51
52// a standalone runtime's locale is en's info alone, so it writes en even beside arktype
53const isStandalone = (config: ResolvedConfig): boolean =>

Callers 2

resolveGlobalConfigFunction · 0.90
render.tsFile · 0.70

Calls 1

normalizeLocaleFunction · 0.85

Tested by

no test coverage detected