UNPKG

@alessiofrittoli/web-utils

Version:
87 lines (85 loc) 2.76 kB
/** * Make first letter uppercase. * * @param input The input string to convert. * @returns The processed string. */ declare const ucFirst: (input: string) => string; /** * Make first letter lowercase. * * @param input The input string to convert. * @returns The processed string. */ declare const lcFirst: (input: string) => string; /** * Convert string to camelCase. * * @param input The input string to convert. * @returns The converted string to camelCase. */ declare const toCamelCase: (input: string) => string; /** * Convert string to kebab-case string. * * @param input The input string to convert. * @returns The converted string to kebab-case. */ declare const toKebabCase: (input: string) => string; /** * Stringify value. * * @param input The value to stringify. * @returns The stringified `input`. */ declare const stringifyValue: (input?: any) => string; /** * Parse stringified value. * * @param input The value to parse. * @returns The parsed `input`. */ declare const parseValue: <T>(input?: string) => T | undefined; /** * Add leading character to a string. * * The given `input` won't be modified if it already contains the given `character`. * * @param input The string to process. * @param character The character to add. * @param search ( Optional ) A custom search expression. Default `character`. * * @returns The given string with leading character. */ declare const addLeadingCharacter: (input: string, character: string, search?: string | RegExp) => string; /** * Remove leading character from a string. * * @param input The string to process. * @param character The character to remove. * * @returns The given string with leading character removed. */ declare const removeLeadingCharacter: (input: string, character: string | RegExp) => string; /** * Add trailing character to a string. * * The given `input` won't be modified if it already contains the given `character`. * * @param input The string to process. * @param character The character to add. * @param search ( Optional ) A custom search expression. Default `character`. * * @returns The given string with trailing character. */ declare const addTrailingCharacter: (input: string, character: string, search?: string | RegExp) => string; /** * Remove trailing character from a string. * * @param input The string to process. * @param character The character to remove. * * @returns The given string with trailing character removed. */ declare const removeTrailingCharacter: (input: string, character: string | RegExp) => string; export { addLeadingCharacter, addTrailingCharacter, lcFirst, parseValue, removeLeadingCharacter, removeTrailingCharacter, stringifyValue, toCamelCase, toKebabCase, ucFirst };