MCPcopy Create free account
hub / github.com/anomalyco/opencode / parseLocale

Function parseLocale

packages/console/app/src/lib/language.ts:178–182  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

176}
177
178export function parseLocale(value: unknown): Locale | null {
179 if (typeof value !== "string") return null
180 if ((LOCALES as readonly string[]).includes(value)) return value as Locale
181 return null
182}
183
184export function fromPathname(pathname: string) {
185 return parseLocale(fix(pathname).split("/")[1])

Callers 6

handlerFunction · 0.90
initialFunction · 0.90
initialFunction · 0.90
fromPathnameFunction · 0.70
localeFromCookieHeaderFunction · 0.70
localeFromRequestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected