@primer/primitives
Version:
Typography, spacing, and color primitives for Primer design system
11 lines (10 loc) • 386 B
JavaScript
/**
* upperCaseFirstCharacter
* @scope custom implementation should only be used within `name path to ...` transformer
* @description changes first letter to uppercase but keeps the rest of the word as is
* @param string
* @returns string
*/
export const upperCaseFirstCharacter = ([firstLetter, ...restOfWord]) => {
return firstLetter.toUpperCase() + restOfWord.join('');
};