UNPKG

@puq/names

Version:

The String Names Library provides a simple names function that takes a string input and returns all possible naming convention variants, such as camelCase, snake_case, CONSTANT_CASE, and more. Perfect for tasks like code generation, formatting standardiza

13 lines 911 B
/** * Normalizes a given string by adding spaces before uppercase letters and capitalizing the first letter. * Optionally, a custom pre-input validator function can be provided to validate the input string. * * @param value - The string to be normalized. * @param preInputValidator - An optional function to validate the input string before normalization. * If not provided, a default validation is applied which checks if the string * contains only letters, underscores, dollar signs, and spaces. * @returns The normalized string with spaces before uppercase letters and the first letter capitalized. * @throws {Error} If the input string is invalid according to the provided or default validator. */ export declare function normalize(value: string, preInputValidator?: (value: string) => boolean): string; //# sourceMappingURL=normalize.d.ts.map