generaltranslation
Version:
A language toolkit for AI developers
13 lines (12 loc) • 461 B
TypeScript
/**
* Sanitizes string by escaping ICU syntax
*
* Sanitize arbitrary string so it does not break the following ICU message syntax:
* {_gt_, select, other {string_here}}
*
* Escapes ICU special characters by:
* 1. Doubling all single quotes (U+0027 ')
* 2. Adding a single quote before the first special character ({}<>)
* 3. Adding a single quote after the last special character ({}<>)
*/
export declare function sanitizeVar(string: string): string;