MCPcopy Create free account
hub / github.com/effector/effector / createLink

Function createLink

documentation/src/languages.ts:47–61  ·  view source on GitHub ↗
(item: { text: LText; link: string }, lang: string)

Source from the content-addressed store, hash-verified

45}
46
47export function createLink(item: { text: LText; link: string }, lang: string): string {
48 if (isExternal(item)) {
49 return item.link;
50 }
51
52 if (item.link.startsWith("/")) {
53 if (isLocalizedLink(item)) {
54 return item.link;
55 }
56
57 return `/${lang}${item.link}`;
58 }
59
60 return item.link;
61}
62
63export function createChangeLangLinks({ slug }: { slug: string }) {
64 return Object.entries(KNOWN_LANGUAGES).map(([name, code]) => ({

Callers 1

getLocalizedPanelSidebarFunction · 0.90

Calls 2

isExternalFunction · 0.85
isLocalizedLinkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…