super-utils-plus
Version:
A superior alternative to Lodash with improved performance, TypeScript support, and developer experience
46 lines (45 loc) • 1.04 kB
TypeScript
/**
* Converts the first character of string to upper case and the remaining to lower case.
*
* @param string - The string to capitalize
* @returns The capitalized string
*
* @example
* ```ts
* capitalize('FRED');
* // => 'Fred'
*
* capitalize('fred');
* // => 'Fred'
* ```
*/
export declare function capitalize(string: string): string;
/**
* Converts the first character of string to upper case, leaving the rest unchanged.
*
* @param string - The string to capitalize
* @returns The capitalized string
*
* @example
* ```ts
* capitalizeFirst('fred');
* // => 'Fred'
*
* capitalizeFirst('FRED');
* // => 'FRED'
* ```
*/
export declare function capitalizeFirst(string: string): string;
/**
* Converts the first character of each word in the string to upper case.
*
* @param string - The string to convert
* @returns The title cased string
*
* @example
* ```ts
* titleCase('fred, barney, and pebbles');
* // => 'Fred, Barney, And Pebbles'
* ```
*/
export declare function titleCase(string: string): string;