@appsemble/utils
Version:
Utility functions used in Appsemble internally
14 lines (13 loc) • 524 B
TypeScript
/**
* Turn a string into a URL friendly variant by stripping any weird formatting.
*
* - Accents are stripped;
* - Non-alphanumeric is replaced with a hyphen;
* - The resulting string is lower case.
*
* @param input The input string to normalize.
* @param stripTrailingHyphen Strip a trailing hyphen. Disable for example when processing user
* input directly while the user is typing.
* @returns The normalized string.
*/
export declare function normalize(input: string, stripTrailingHyphen?: boolean): string;