gt-react 10.19.18 → 10.19.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/macros.mjs CHANGED
@@ -4188,14 +4188,17 @@ function extractVars(icuString) {
4188
4188
  });
4189
4189
  return variables;
4190
4190
  }
4191
+ const CONTAINS_INDEXED_GT_REGEX = new RegExp(`${VAR_IDENTIFIER}\\d+`);
4191
4192
  /**
4192
4193
  * Given an indexed ICU string, condenses any select to an argument
4194
+ * Unindexed _gt_ source strings and indexed _gt_# translation strings
4195
+ * are mutually exclusive.
4193
4196
  * indexVars('Hello {_gt_1, select, other {World}}') => 'Hello {_gt_1}'
4194
4197
  * @param {string} icuString - The ICU string to condense.
4195
4198
  * @returns {string} The condensed ICU string.
4196
4199
  */
4197
4200
  function condenseVars(icuString) {
4198
- if (!icuString.includes("_gt_")) return icuString;
4201
+ if (!CONTAINS_INDEXED_GT_REGEX.test(icuString)) return icuString;
4199
4202
  function visitor(child) {
4200
4203
  child.type = import_types.TYPE.argument;
4201
4204
  Reflect.deleteProperty(child, "options");