( query: ReferralQuery, )
| 35 | // The `cid` + `userid` pair an invite link (/join) carries and forwards to |
| 36 | // the signup funnel. |
| 37 | export 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 | |
| 50 | export const formatReferralLadderMonths = (months: number): string => { |
| 51 | if (months % 12 === 0) { |
no test coverage detected