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

Function strip

packages/console/app/src/lib/language.ts:197–205  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

195}
196
197export function strip(pathname: string) {
198 const locale = fromPathname(pathname)
199 if (!locale) return fix(pathname)
200
201 const next = fix(pathname).slice(locale.length + 1)
202 if (!next) return "/"
203 if (next.startsWith("/")) return next
204 return `/${next}`
205}
206
207export function route(locale: Locale, pathname: string) {
208 const next = strip(pathname)

Callers 3

onRequestFunction · 0.90
LanguagePickerFunction · 0.90
routeFunction · 0.70

Calls 2

fromPathnameFunction · 0.85
fixFunction · 0.70

Tested by

no test coverage detected