MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / getThreadUrl

Function getThreadUrl

packages/utilities/src/url.ts:42–69  ·  view source on GitHub ↗
({
  isSubDomainRouting,
  slug,
  incrementId,
  settings,
  messageId,
  LINEN_URL,
}: {
  isSubDomainRouting: boolean;
  slug?: string | null;
  incrementId: number;
  settings: {
    communityName?: string;
    redirectDomain?: string;
  };
  messageId?: string;
  LINEN_URL: string;
})

Source from the content-addressed store, hash-verified

40}
41
42export function getThreadUrl({
43 isSubDomainRouting,
44 slug,
45 incrementId,
46 settings,
47 messageId,
48 LINEN_URL,
49}: {
50 isSubDomainRouting: boolean;
51 slug?: string | null;
52 incrementId: number;
53 settings: {
54 communityName?: string;
55 redirectDomain?: string;
56 };
57 messageId?: string;
58 LINEN_URL: string;
59}) {
60 const slugLowerCase = (slug || 'topic').toLowerCase();
61 const communityName = settings?.communityName;
62 const redirectDomain = settings?.redirectDomain;
63
64 const threadLink = isSubDomainRouting
65 ? `https://${redirectDomain}/t/${incrementId}/${slugLowerCase}`
66 : `${LINEN_URL}/s/${communityName}/t/${incrementId}/${slugLowerCase}`;
67
68 return `${threadLink}${!!messageId ? `#${messageId}` : ''}`;
69}

Callers 6

parseBodyFunction · 0.90
url.test.tsFile · 0.90
HitsFunction · 0.90
onLinkClickFunction · 0.90
ActionsFunction · 0.90
selectThreadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected