/**
 * Capitalize first word of the string
 *
 * @param {string} word String
 */
export function capitalize(word: string) {
  return typeof word === 'string' ? word.replace(/^\w/, (w) => w.toUpperCase()) : '';
}

/**
 * Capitalize all words of a string
 *
 * @param {string} words String containing the words
 */
export function capitalizeWords(words: string) {
  return typeof words === 'string' ? words.replace(/(?:^|\s)\S/g, (w) => w.toUpperCase()) : '';
}

/**
 * Capitalize all characters of a string
 *
 * @param {string} words String containing the words
 */
export function uppercase(words: string): string {
  return typeof words === 'string' ? words.toUpperCase() : '';
}
