MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getCommunityUrl

Function getCommunityUrl

packages/serializers/src/settings.ts:48–68  ·  view source on GitHub ↗
(
  account: Pick<
    accounts,
    | 'premium'
    | 'redirectDomain'
    | 'slackTeamId'
    | 'slackDomain'
    | 'discordDomain'
    | 'discordServerId'
  >
)

Source from the content-addressed store, hash-verified

46 * premium - https://{redirectDomain}
47 */
48export function getCommunityUrl(
49 account: Pick<
50 accounts,
51 | 'premium'
52 | 'redirectDomain'
53 | 'slackTeamId'
54 | 'slackDomain'
55 | 'discordDomain'
56 | 'discordServerId'
57 >
58) {
59 if (account.premium && account.redirectDomain) {
60 return appendProtocol(account.redirectDomain);
61 }
62 const communityType = getCommunityType(account);
63 const communityName = getCommunityName(account);
64 const linenDomain = getLinenUrl();
65 return appendProtocol(
66 `${linenDomain}/${communityMapping[communityType]}/${communityName}`
67 );
68}
69
70export function serializeSettings(account: accounts): Settings {
71 const communityType = getCommunityType(account);

Callers 1

sendEmailNotificationFunction · 0.90

Calls 4

appendProtocolFunction · 0.90
getLinenUrlFunction · 0.90
getCommunityTypeFunction · 0.85
getCommunityNameFunction · 0.70

Tested by

no test coverage detected