stringzy
Version:
A versatile string manipulation library providing a range of text utilities for JavaScript and Node.js applications.
26 lines (25 loc) • 806 B
TypeScript
/**
* Converts a given string into camelCase format.
*
* This function normalizes the input by:
* - Converting it to lowercase
* - Removing special characters (except alphanumeric and underscores)
* - Replacing underscores and multiple spaces with single spaces
* - Capitalizing each word except the first
* - Removing all spaces to form a camelCased result
*
* If the input is `null` or `undefined`, an empty string is returned.
*
* @param {string} text - The input string to convert.
* @returns {string} The camelCased version of the input string.
*
* @example
* camelCase("Hello world"); // "helloWorld"
*
* @example
* camelCase(" convert_to-camel case!! "); // "convertToCamelCase"
*
* @example
* camelCase(""); // ""
*/
export declare function camelCase(text: string): string;