MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / stringifyDonationEvents

Function stringifyDonationEvents

client/src/utils/analytics-strings.ts:3–15  ·  view source on GitHub ↗
(
  paymentContext: PaymentContext,
  paymentProvider: PaymentProvider
)

Source from the content-addressed store, hash-verified

1import { PaymentContext, PaymentProvider } from '../components/Donation/types';
2
3export function stringifyDonationEvents(
4 paymentContext: PaymentContext,
5 paymentProvider: PaymentProvider
6): string {
7 const donationString = `${paymentContext} ${paymentProvider} payment ${
8 paymentProvider === 'patreon' ? 'redirection' : 'submission'
9 }`;
10
11 // return title case
12 return donationString.replace(/(^\w{1})|(\s+\w{1})/g, letter =>
13 letter.toUpperCase()
14 );
15}

Callers 2

postChargeSagaFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected