UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

15 lines (13 loc) 476 B
/** * Converts the first character of string to upper case. * * @param {string} str - The string that is to be changed * @returns {string} - The converted string. * * @example * const convertedStr1 = upperFirst('fred') // returns 'Fred' * const convertedStr2 = upperFirst('Fred') // returns 'Fred' * const convertedStr3 = upperFirst('FRED') // returns 'FRED' */ declare function upperFirst<T extends string = string>(str?: T): Capitalize<T>; export { upperFirst };