MCPcopy Create free account
hub / github.com/dailydotdev/apps / getInviteReferral

Function getInviteReferral

packages/shared/src/lib/referral.ts:37–48  ·  view source on GitHub ↗
(
  query: ReferralQuery,
)

Source from the content-addressed store, hash-verified

35// The `cid` + `userid` pair an invite link (/join) carries and forwards to
36// the signup funnel.
37export const getInviteReferral = (
38 query: ReferralQuery,
39): InviteReferral | null => {
40 const userId = getFirstQueryParam(query.userid);
41 const campaign = getFirstQueryParam(query.cid);
42
43 if (!userId || userId === '404' || !isReferralCampaignKey(campaign)) {
44 return null;
45 }
46
47 return { userId, campaign };
48};
49
50export const formatReferralLadderMonths = (months: number): string => {
51 if (months % 12 === 0) {

Callers 3

ReferralInviterCardFunction · 0.90
getServerSidePropsFunction · 0.90
getServerSidePropsFunction · 0.90

Calls 2

getFirstQueryParamFunction · 0.90
isReferralCampaignKeyFunction · 0.85

Tested by

no test coverage detected