MCPcopy Create free account
hub / github.com/codename-co/stack / useUrl

Function useUrl

packages/website/src/i18n/utils.ts:32–38  ·  view source on GitHub ↗
(lang: Lang = defaultLang)

Source from the content-addressed store, hash-verified

30};
31
32export const useUrl = (lang: Lang = defaultLang) => {
33 // return template string
34 return function url(path: string, langOverride?: Lang) {
35 const l = langOverride ?? lang;
36 return `/${l === defaultLang ? "/" : l}${path}`.replace(/^\/+/g, "/");
37 };
38};
39
40export const countryCode = (lang: Lang): Lang | string => {
41 switch (lang) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected