@fkui/i18next-translate 6.51.0 → 6.52.1

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/esm/index.js CHANGED
@@ -3469,10 +3469,14 @@ class Formatter {
3469
3469
  format(value, format, lng, options = {}) {
3470
3470
  if (!format) return value;
3471
3471
  if (value == null) return value;
3472
- const formats = format.split(this.formatSeparator);
3473
- if (formats.length > 1 && formats[0].indexOf('(') > 1 && !formats[0].includes(')') && formats.find(f => f.includes(')'))) {
3474
- const lastIndex = formats.findIndex(f => f.includes(')'));
3475
- formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
3472
+ const rawFormats = format.split(this.formatSeparator);
3473
+ const formats = [];
3474
+ for (let i = 0; i < rawFormats.length; i++) {
3475
+ let f = rawFormats[i];
3476
+ while (f.indexOf('(') > -1 && !f.includes(')') && i + 1 < rawFormats.length) {
3477
+ f = `${f}${this.formatSeparator}${rawFormats[++i]}`;
3478
+ }
3479
+ formats.push(f);
3476
3480
  }
3477
3481
  const result = formats.reduce((mem, f) => {
3478
3482
  const {