Skip to content

Instantly share code, notes, and snippets.

View angusgibbs's full-sized avatar

Angus Gibbs angusgibbs

View GitHub Profile
@angusgibbs
angusgibbs / capitalize_name.js
Last active October 25, 2021 14:46
Example HubSpot custom code action snippets
View capitalize_name.js
/**
* Capitalizes the first letter of every part of a contact's first and last name.
*
* Examples:
* - angus -> Angus
* - ANGUS A. -> Angus A.
* - O'connor -> O'Connor
*/
const FIRSTNAME_PROP = "firstname";
const LASTNAME_PROP = "lastname";