@fkui/i18next-translate 6.50.0 → 6.52.0

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