generaltranslation
Version:
A language toolkit for AI developers
10 lines (9 loc) • 439 B
TypeScript
/**
* Given an unindexed ICU string, extracts all the _gt_ variables and an indexed mapping of the variable to the values
*
* extractVars('Hello {_gt_, select, other {World}}') => { _gt_1: 'World' }
*
* @param {string} icuString - The ICU string to extract variables from.
* @returns {Record<string, string>} A mapping of the variable to the value.
*/
export declare function extractVars(icuString: string): Record<string, string>;