(pathname: string)
| 186 | } |
| 187 | |
| 188 | export function fromDocsPathname(pathname: string) { |
| 189 | const next = fix(pathname) |
| 190 | const value = next.split("/")[2]?.toLowerCase() |
| 191 | if (!value) return null |
| 192 | if (!next.startsWith("/docs/")) return null |
| 193 | if (!(value in DOCS_LOCALE)) return null |
| 194 | return DOCS_LOCALE[value as keyof typeof DOCS_LOCALE] |
| 195 | } |
| 196 | |
| 197 | export function strip(pathname: string) { |
| 198 | const locale = fromPathname(pathname) |
no test coverage detected