UNPKG

@cc-heart/utils

Version:

🔧 javascript common tools collection

20 lines (17 loc) • 584 B
'use strict'; /** * 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)); exports.capitalize = capitalize; exports.unCapitalize = unCapitalize;