@cc-heart/utils
Version:
🔧 javascript common tools collection
17 lines (15 loc) • 536 B
JavaScript
/**
* Capitalizes the first letter of a string.
*
* @param target - The string to be capitalized.
* @return - The capitalized string.
*/
const capitalize = (target) => (target.charAt(0).toUpperCase() + target.slice(1));
/**
* Returns a new string with the first character converted to lowercase.
*
* @param target - The string to be unCapitalized.
* @returns - The unCapitalized string.
*/
const unCapitalize = (target) => (target.charAt(0).toLowerCase() + target.slice(1));
export { capitalize, unCapitalize };