(value: unknown)
| 176 | } |
| 177 | |
| 178 | export 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 | |
| 184 | export function fromPathname(pathname: string) { |
| 185 | return parseLocale(fix(pathname).split("/")[1]) |
no outgoing calls
no test coverage detected