intl-messageformat 9.9.3 → 9.10.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/index.js CHANGED
@@ -7,7 +7,7 @@ See the accompanying LICENSE file for terms.
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  var tslib_1 = require("tslib");
9
9
  var core_1 = require("./src/core");
10
- tslib_1.__exportStar(require("./src/formatters"), exports);
11
- tslib_1.__exportStar(require("./src/core"), exports);
12
- tslib_1.__exportStar(require("./src/error"), exports);
10
+ (0, tslib_1.__exportStar)(require("./src/formatters"), exports);
11
+ (0, tslib_1.__exportStar)(require("./src/core"), exports);
12
+ (0, tslib_1.__exportStar)(require("./src/error"), exports);
13
13
  exports.default = core_1.IntlMessageFormat;
@@ -1,8 +1,5 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __require = typeof require !== "undefined" ? require : (x) => {
4
- throw new Error('Dynamic require of "' + x + '" is not supported');
5
- };
6
3
  var __publicField = (obj, key, value) => {
7
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
5
  return value;
@@ -480,8 +477,8 @@ function parseNumberSkeleton(tokens) {
480
477
 
481
478
  // bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/parser.js
482
479
  var _a;
483
- var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*");
484
- var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$");
480
+ var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
481
+ var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
485
482
  function createLocation(start, end) {
486
483
  return { start, end };
487
484
  }
@@ -648,7 +645,7 @@ var Parser = function() {
648
645
  return {
649
646
  val: {
650
647
  type: TYPE.literal,
651
- value: "<" + tagName + "/>",
648
+ value: "<".concat(tagName, "/>"),
652
649
  location: createLocation(startPosition, this.clonePosition())
653
650
  },
654
651
  err: null
@@ -1141,7 +1138,7 @@ var Parser = function() {
1141
1138
  }
1142
1139
  var code = codePointAt(this.message, offset);
1143
1140
  if (code === void 0) {
1144
- throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary");
1141
+ throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
1145
1142
  }
1146
1143
  return code;
1147
1144
  };
@@ -1191,7 +1188,7 @@ var Parser = function() {
1191
1188
  };
1192
1189
  Parser2.prototype.bumpTo = function(targetOffset) {
1193
1190
  if (this.offset() > targetOffset) {
1194
- throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset());
1191
+ throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
1195
1192
  }
1196
1193
  targetOffset = Math.min(targetOffset, this.message.length);
1197
1194
  while (true) {
@@ -1200,7 +1197,7 @@ var Parser = function() {
1200
1197
  break;
1201
1198
  }
1202
1199
  if (offset > targetOffset) {
1203
- throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary");
1200
+ throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
1204
1201
  }
1205
1202
  this.bump();
1206
1203
  if (this.isEOF()) {
@@ -3,9 +3,6 @@ var IntlMessageFormat = (function() {
3
3
  var __markAsModule = function(target) {
4
4
  return __defProp(target, "__esModule", { value: true });
5
5
  };
6
- var __require = typeof require !== "undefined" ? require : function(x) {
7
- throw new Error('Dynamic require of "' + x + '" is not supported');
8
- };
9
6
  var __export = function(target, all) {
10
7
  __markAsModule(target);
11
8
  for (var name in all)
@@ -549,8 +546,8 @@ var IntlMessageFormat = (function() {
549
546
 
550
547
  // bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/parser.js
551
548
  var _a;
552
- var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*");
553
- var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$");
549
+ var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
550
+ var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
554
551
  function createLocation(start, end) {
555
552
  return { start: start, end: end };
556
553
  }
@@ -717,7 +714,7 @@ var IntlMessageFormat = (function() {
717
714
  return {
718
715
  val: {
719
716
  type: TYPE.literal,
720
- value: "<" + tagName + "/>",
717
+ value: "<".concat(tagName, "/>"),
721
718
  location: createLocation(startPosition, this.clonePosition())
722
719
  },
723
720
  err: null
@@ -1210,7 +1207,7 @@ var IntlMessageFormat = (function() {
1210
1207
  }
1211
1208
  var code = codePointAt(this.message, offset);
1212
1209
  if (code === void 0) {
1213
- throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary");
1210
+ throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
1214
1211
  }
1215
1212
  return code;
1216
1213
  };
@@ -1260,7 +1257,7 @@ var IntlMessageFormat = (function() {
1260
1257
  };
1261
1258
  Parser2.prototype.bumpTo = function(targetOffset) {
1262
1259
  if (this.offset() > targetOffset) {
1263
- throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset());
1260
+ throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
1264
1261
  }
1265
1262
  targetOffset = Math.min(targetOffset, this.message.length);
1266
1263
  while (true) {
@@ -1269,7 +1266,7 @@ var IntlMessageFormat = (function() {
1269
1266
  break;
1270
1267
  }
1271
1268
  if (offset > targetOffset) {
1272
- throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary");
1269
+ throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
1273
1270
  }
1274
1271
  this.bump();
1275
1272
  if (this.isEOF()) {
@@ -1428,28 +1425,28 @@ var IntlMessageFormat = (function() {
1428
1425
  return _this;
1429
1426
  }
1430
1427
  FormatError2.prototype.toString = function() {
1431
- return "[formatjs Error: " + this.code + "] " + this.message;
1428
+ return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
1432
1429
  };
1433
1430
  return FormatError2;
1434
1431
  }(Error);
1435
1432
  var InvalidValueError = function(_super) {
1436
1433
  __extends(InvalidValueError2, _super);
1437
1434
  function InvalidValueError2(variableId, value, options, originalMessage) {
1438
- return _super.call(this, 'Invalid values for "' + variableId + '": "' + value + '". Options are "' + Object.keys(options).join('", "') + '"', ErrorCode.INVALID_VALUE, originalMessage) || this;
1435
+ return _super.call(this, 'Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options).join('", "'), '"'), ErrorCode.INVALID_VALUE, originalMessage) || this;
1439
1436
  }
1440
1437
  return InvalidValueError2;
1441
1438
  }(FormatError);
1442
1439
  var InvalidValueTypeError = function(_super) {
1443
1440
  __extends(InvalidValueTypeError2, _super);
1444
1441
  function InvalidValueTypeError2(value, type, originalMessage) {
1445
- return _super.call(this, 'Value for "' + value + '" must be of type ' + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
1442
+ return _super.call(this, 'Value for "'.concat(value, '" must be of type ').concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
1446
1443
  }
1447
1444
  return InvalidValueTypeError2;
1448
1445
  }(FormatError);
1449
1446
  var MissingValueError = function(_super) {
1450
1447
  __extends(MissingValueError2, _super);
1451
1448
  function MissingValueError2(variableId, originalMessage) {
1452
- return _super.call(this, 'The intl string context variable "' + variableId + '" was not provided to the string "' + originalMessage + '"', ErrorCode.MISSING_VALUE, originalMessage) || this;
1449
+ return _super.call(this, 'The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), ErrorCode.MISSING_VALUE, originalMessage) || this;
1453
1450
  }
1454
1451
  return MissingValueError2;
1455
1452
  }(FormatError);
@@ -1576,7 +1573,7 @@ var IntlMessageFormat = (function() {
1576
1573
  continue;
1577
1574
  }
1578
1575
  if (isPluralElement(el)) {
1579
- var opt = el.options["=" + value];
1576
+ var opt = el.options["=".concat(value)];
1580
1577
  if (!opt) {
1581
1578
  if (!Intl.PluralRules) {
1582
1579
  throw new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', ErrorCode.MISSING_INTL_API, originalMessage);
@@ -1642,7 +1639,7 @@ var IntlMessageFormat = (function() {
1642
1639
  for (var _i = 0; _i < arguments.length; _i++) {
1643
1640
  args[_i] = arguments[_i];
1644
1641
  }
1645
- return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args)))();
1642
+ return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
1646
1643
  }, {
1647
1644
  cache: createFastMemoizeCache(cache.number),
1648
1645
  strategy: strategies.variadic
@@ -1653,7 +1650,7 @@ var IntlMessageFormat = (function() {
1653
1650
  for (var _i = 0; _i < arguments.length; _i++) {
1654
1651
  args[_i] = arguments[_i];
1655
1652
  }
1656
- return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args)))();
1653
+ return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
1657
1654
  }, {
1658
1655
  cache: createFastMemoizeCache(cache.dateTime),
1659
1656
  strategy: strategies.variadic
@@ -1664,7 +1661,7 @@ var IntlMessageFormat = (function() {
1664
1661
  for (var _i = 0; _i < arguments.length; _i++) {
1665
1662
  args[_i] = arguments[_i];
1666
1663
  }
1667
- return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args)))();
1664
+ return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))();
1668
1665
  }, {
1669
1666
  cache: createFastMemoizeCache(cache.pluralRules),
1670
1667
  strategy: strategies.variadic
package/lib/src/core.js CHANGED
@@ -53,7 +53,7 @@ function createDefaultFormatters(cache) {
53
53
  for (var _i = 0; _i < arguments.length; _i++) {
54
54
  args[_i] = arguments[_i];
55
55
  }
56
- return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
56
+ return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
57
57
  }, {
58
58
  cache: createFastMemoizeCache(cache.number),
59
59
  strategy: strategies.variadic,
@@ -64,7 +64,7 @@ function createDefaultFormatters(cache) {
64
64
  for (var _i = 0; _i < arguments.length; _i++) {
65
65
  args[_i] = arguments[_i];
66
66
  }
67
- return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
67
+ return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
68
68
  }, {
69
69
  cache: createFastMemoizeCache(cache.dateTime),
70
70
  strategy: strategies.variadic,
@@ -75,7 +75,7 @@ function createDefaultFormatters(cache) {
75
75
  for (var _i = 0; _i < arguments.length; _i++) {
76
76
  args[_i] = arguments[_i];
77
77
  }
78
- return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
78
+ return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
79
79
  }, {
80
80
  cache: createFastMemoizeCache(cache.pluralRules),
81
81
  strategy: strategies.variadic,
package/lib/src/error.js CHANGED
@@ -17,7 +17,7 @@ var FormatError = /** @class */ (function (_super) {
17
17
  return _this;
18
18
  }
19
19
  FormatError.prototype.toString = function () {
20
- return "[formatjs Error: " + this.code + "] " + this.message;
20
+ return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
21
21
  };
22
22
  return FormatError;
23
23
  }(Error));
@@ -25,7 +25,7 @@ export { FormatError };
25
25
  var InvalidValueError = /** @class */ (function (_super) {
26
26
  __extends(InvalidValueError, _super);
27
27
  function InvalidValueError(variableId, value, options, originalMessage) {
28
- return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
28
+ return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
29
29
  }
30
30
  return InvalidValueError;
31
31
  }(FormatError));
@@ -33,7 +33,7 @@ export { InvalidValueError };
33
33
  var InvalidValueTypeError = /** @class */ (function (_super) {
34
34
  __extends(InvalidValueTypeError, _super);
35
35
  function InvalidValueTypeError(value, type, originalMessage) {
36
- return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
36
+ return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
37
37
  }
38
38
  return InvalidValueTypeError;
39
39
  }(FormatError));
@@ -41,7 +41,7 @@ export { InvalidValueTypeError };
41
41
  var MissingValueError = /** @class */ (function (_super) {
42
42
  __extends(MissingValueError, _super);
43
43
  function MissingValueError(variableId, originalMessage) {
44
- return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
44
+ return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
45
45
  }
46
46
  return MissingValueError;
47
47
  }(FormatError));
@@ -1,16 +1,17 @@
1
+ import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
1
2
  import { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
3
  export interface Formats {
3
- number: Record<string, Intl.NumberFormatOptions>;
4
+ number: Record<string, NumberFormatOptions>;
4
5
  date: Record<string, Intl.DateTimeFormatOptions>;
5
6
  time: Record<string, Intl.DateTimeFormatOptions>;
6
7
  }
7
8
  export interface FormatterCache {
8
- number: Record<string, Intl.NumberFormat>;
9
+ number: Record<string, NumberFormatOptions>;
9
10
  dateTime: Record<string, Intl.DateTimeFormat>;
10
11
  pluralRules: Record<string, Intl.PluralRules>;
11
12
  }
12
13
  export interface Formatters {
13
- getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat;
14
+ getNumberFormat(locals?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat;
14
15
  getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat;
15
16
  getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules;
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-messageformat/src/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,oBAAoB,EAGrB,MAAM,oCAAoC,CAAA;AAS3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,UAAU;IACzB,eAAe,CACb,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,GACvD,IAAI,CAAC,YAAY,CAAA;IACpB,iBA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}
158
158
  if (isPluralElement(el)) {
159
- var opt = el.options["=" + value];
159
+ var opt = el.options["=".concat(value)];
160
160
  if (!opt) {
161
161
  if (!Intl.PluralRules) {
162
162
  throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-messageformat",
3
- "version": "9.9.3",
3
+ "version": "9.10.0",
4
4
  "description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -31,8 +31,9 @@
31
31
  "module": "lib/index.js",
32
32
  "types": "index.d.ts",
33
33
  "dependencies": {
34
+ "@formatjs/ecma402-abstract": "1.11.0",
34
35
  "@formatjs/fast-memoize": "1.2.0",
35
- "@formatjs/icu-messageformat-parser": "2.0.13",
36
+ "@formatjs/icu-messageformat-parser": "2.0.15",
36
37
  "tslib": "^2.1.0"
37
38
  },
38
39
  "sideEffects": false,
package/src/core.js CHANGED
@@ -8,15 +8,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.IntlMessageFormat = void 0;
9
9
  var tslib_1 = require("tslib");
10
10
  var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
11
- var fast_memoize_1 = tslib_1.__importStar(require("@formatjs/fast-memoize"));
11
+ var fast_memoize_1 = (0, tslib_1.__importStar)(require("@formatjs/fast-memoize"));
12
12
  var formatters_1 = require("./formatters");
13
13
  // -- MessageFormat --------------------------------------------------------
14
14
  function mergeConfig(c1, c2) {
15
15
  if (!c2) {
16
16
  return c1;
17
17
  }
18
- return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {
19
- all[k] = tslib_1.__assign(tslib_1.__assign({}, c1[k]), (c2[k] || {}));
18
+ return (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {
19
+ all[k] = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, c1[k]), (c2[k] || {}));
20
20
  return all;
21
21
  }, {}));
22
22
  }
@@ -27,7 +27,7 @@ function mergeConfigs(defaultConfig, configs) {
27
27
  return Object.keys(defaultConfig).reduce(function (all, k) {
28
28
  all[k] = mergeConfig(defaultConfig[k], configs[k]);
29
29
  return all;
30
- }, tslib_1.__assign({}, defaultConfig));
30
+ }, (0, tslib_1.__assign)({}, defaultConfig));
31
31
  }
32
32
  function createFastMemoizeCache(store) {
33
33
  return {
@@ -50,35 +50,35 @@ function createDefaultFormatters(cache) {
50
50
  pluralRules: {},
51
51
  }; }
52
52
  return {
53
- getNumberFormat: fast_memoize_1.default(function () {
53
+ getNumberFormat: (0, fast_memoize_1.default)(function () {
54
54
  var _a;
55
55
  var args = [];
56
56
  for (var _i = 0; _i < arguments.length; _i++) {
57
57
  args[_i] = arguments[_i];
58
58
  }
59
- return new ((_a = Intl.NumberFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
59
+ return new ((_a = Intl.NumberFormat).bind.apply(_a, (0, tslib_1.__spreadArray)([void 0], args, false)))();
60
60
  }, {
61
61
  cache: createFastMemoizeCache(cache.number),
62
62
  strategy: fast_memoize_1.strategies.variadic,
63
63
  }),
64
- getDateTimeFormat: fast_memoize_1.default(function () {
64
+ getDateTimeFormat: (0, fast_memoize_1.default)(function () {
65
65
  var _a;
66
66
  var args = [];
67
67
  for (var _i = 0; _i < arguments.length; _i++) {
68
68
  args[_i] = arguments[_i];
69
69
  }
70
- return new ((_a = Intl.DateTimeFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
70
+ return new ((_a = Intl.DateTimeFormat).bind.apply(_a, (0, tslib_1.__spreadArray)([void 0], args, false)))();
71
71
  }, {
72
72
  cache: createFastMemoizeCache(cache.dateTime),
73
73
  strategy: fast_memoize_1.strategies.variadic,
74
74
  }),
75
- getPluralRules: fast_memoize_1.default(function () {
75
+ getPluralRules: (0, fast_memoize_1.default)(function () {
76
76
  var _a;
77
77
  var args = [];
78
78
  for (var _i = 0; _i < arguments.length; _i++) {
79
79
  args[_i] = arguments[_i];
80
80
  }
81
- return new ((_a = Intl.PluralRules).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
81
+ return new ((_a = Intl.PluralRules).bind.apply(_a, (0, tslib_1.__spreadArray)([void 0], args, false)))();
82
82
  }, {
83
83
  cache: createFastMemoizeCache(cache.pluralRules),
84
84
  strategy: fast_memoize_1.strategies.variadic,
@@ -117,7 +117,7 @@ var IntlMessageFormat = /** @class */ (function () {
117
117
  return result;
118
118
  };
119
119
  this.formatToParts = function (values) {
120
- return formatters_1.formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);
120
+ return (0, formatters_1.formatToParts)(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);
121
121
  };
122
122
  this.resolvedOptions = function () { return ({
123
123
  locale: Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],
package/src/error.js CHANGED
@@ -12,7 +12,7 @@ var ErrorCode;
12
12
  ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API";
13
13
  })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
14
14
  var FormatError = /** @class */ (function (_super) {
15
- tslib_1.__extends(FormatError, _super);
15
+ (0, tslib_1.__extends)(FormatError, _super);
16
16
  function FormatError(msg, code, originalMessage) {
17
17
  var _this = _super.call(this, msg) || this;
18
18
  _this.code = code;
@@ -20,31 +20,31 @@ var FormatError = /** @class */ (function (_super) {
20
20
  return _this;
21
21
  }
22
22
  FormatError.prototype.toString = function () {
23
- return "[formatjs Error: " + this.code + "] " + this.message;
23
+ return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
24
24
  };
25
25
  return FormatError;
26
26
  }(Error));
27
27
  exports.FormatError = FormatError;
28
28
  var InvalidValueError = /** @class */ (function (_super) {
29
- tslib_1.__extends(InvalidValueError, _super);
29
+ (0, tslib_1.__extends)(InvalidValueError, _super);
30
30
  function InvalidValueError(variableId, value, options, originalMessage) {
31
- return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
31
+ return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
32
32
  }
33
33
  return InvalidValueError;
34
34
  }(FormatError));
35
35
  exports.InvalidValueError = InvalidValueError;
36
36
  var InvalidValueTypeError = /** @class */ (function (_super) {
37
- tslib_1.__extends(InvalidValueTypeError, _super);
37
+ (0, tslib_1.__extends)(InvalidValueTypeError, _super);
38
38
  function InvalidValueTypeError(value, type, originalMessage) {
39
- return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
39
+ return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
40
40
  }
41
41
  return InvalidValueTypeError;
42
42
  }(FormatError));
43
43
  exports.InvalidValueTypeError = InvalidValueTypeError;
44
44
  var MissingValueError = /** @class */ (function (_super) {
45
- tslib_1.__extends(MissingValueError, _super);
45
+ (0, tslib_1.__extends)(MissingValueError, _super);
46
46
  function MissingValueError(variableId, originalMessage) {
47
- return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
47
+ return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
48
48
  }
49
49
  return MissingValueError;
50
50
  }(FormatError));
@@ -1,16 +1,17 @@
1
+ import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
1
2
  import { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
3
  export interface Formats {
3
- number: Record<string, Intl.NumberFormatOptions>;
4
+ number: Record<string, NumberFormatOptions>;
4
5
  date: Record<string, Intl.DateTimeFormatOptions>;
5
6
  time: Record<string, Intl.DateTimeFormatOptions>;
6
7
  }
7
8
  export interface FormatterCache {
8
- number: Record<string, Intl.NumberFormat>;
9
+ number: Record<string, NumberFormatOptions>;
9
10
  dateTime: Record<string, Intl.DateTimeFormat>;
10
11
  pluralRules: Record<string, Intl.PluralRules>;
11
12
  }
12
13
  export interface Formatters {
13
- getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat;
14
+ getNumberFormat(locals?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat;
14
15
  getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat;
15
16
  getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules;
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-messageformat/src/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,oBAAoB,EAGrB,MAAM,oCAAoC,CAAA;AAS3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,C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K,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACtE,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KACrB,CAAC,CAAA"}
package/src/formatters.js CHANGED
@@ -34,7 +34,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
34
34
  // For debugging
35
35
  originalMessage) {
36
36
  // Hot path for straight simple msg translations
37
- if (els.length === 1 && icu_messageformat_parser_1.isLiteralElement(els[0])) {
37
+ if (els.length === 1 && (0, icu_messageformat_parser_1.isLiteralElement)(els[0])) {
38
38
  return [
39
39
  {
40
40
  type: PART_TYPE.literal,
@@ -46,7 +46,7 @@ originalMessage) {
46
46
  for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {
47
47
  var el = els_1[_i];
48
48
  // Exit early for string parts.
49
- if (icu_messageformat_parser_1.isLiteralElement(el)) {
49
+ if ((0, icu_messageformat_parser_1.isLiteralElement)(el)) {
50
50
  result.push({
51
51
  type: PART_TYPE.literal,
52
52
  value: el.value,
@@ -55,7 +55,7 @@ originalMessage) {
55
55
  }
56
56
  // TODO: should this part be literal type?
57
57
  // Replace `#` in plural rules with the actual numeric value.
58
- if (icu_messageformat_parser_1.isPoundElement(el)) {
58
+ if ((0, icu_messageformat_parser_1.isPoundElement)(el)) {
59
59
  if (typeof currentPluralValue === 'number') {
60
60
  result.push({
61
61
  type: PART_TYPE.literal,
@@ -70,7 +70,7 @@ originalMessage) {
70
70
  throw new error_1.MissingValueError(varName, originalMessage);
71
71
  }
72
72
  var value = values[varName];
73
- if (icu_messageformat_parser_1.isArgumentElement(el)) {
73
+ if ((0, icu_messageformat_parser_1.isArgumentElement)(el)) {
74
74
  if (!value || typeof value === 'string' || typeof value === 'number') {
75
75
  value =
76
76
  typeof value === 'string' || typeof value === 'number'
@@ -86,10 +86,10 @@ originalMessage) {
86
86
  // Recursively format plural and select parts' option — which can be a
87
87
  // nested pattern structure. The choosing of the option to use is
88
88
  // abstracted-by and delegated-to the part helper object.
89
- if (icu_messageformat_parser_1.isDateElement(el)) {
89
+ if ((0, icu_messageformat_parser_1.isDateElement)(el)) {
90
90
  var style = typeof el.style === 'string'
91
91
  ? formats.date[el.style]
92
- : icu_messageformat_parser_1.isDateTimeSkeleton(el.style)
92
+ : (0, icu_messageformat_parser_1.isDateTimeSkeleton)(el.style)
93
93
  ? el.style.parsedOptions
94
94
  : undefined;
95
95
  result.push({
@@ -100,10 +100,10 @@ originalMessage) {
100
100
  });
101
101
  continue;
102
102
  }
103
- if (icu_messageformat_parser_1.isTimeElement(el)) {
103
+ if ((0, icu_messageformat_parser_1.isTimeElement)(el)) {
104
104
  var style = typeof el.style === 'string'
105
105
  ? formats.time[el.style]
106
- : icu_messageformat_parser_1.isDateTimeSkeleton(el.style)
106
+ : (0, icu_messageformat_parser_1.isDateTimeSkeleton)(el.style)
107
107
  ? el.style.parsedOptions
108
108
  : undefined;
109
109
  result.push({
@@ -114,10 +114,10 @@ originalMessage) {
114
114
  });
115
115
  continue;
116
116
  }
117
- if (icu_messageformat_parser_1.isNumberElement(el)) {
117
+ if ((0, icu_messageformat_parser_1.isNumberElement)(el)) {
118
118
  var style = typeof el.style === 'string'
119
119
  ? formats.number[el.style]
120
- : icu_messageformat_parser_1.isNumberSkeleton(el.style)
120
+ : (0, icu_messageformat_parser_1.isNumberSkeleton)(el.style)
121
121
  ? el.style.parsedOptions
122
122
  : undefined;
123
123
  if (style && style.scale) {
@@ -133,7 +133,7 @@ originalMessage) {
133
133
  });
134
134
  continue;
135
135
  }
136
- if (icu_messageformat_parser_1.isTagElement(el)) {
136
+ if ((0, icu_messageformat_parser_1.isTagElement)(el)) {
137
137
  var children = el.children, value_1 = el.value;
138
138
  var formatFn = values[value_1];
139
139
  if (!isFormatXMLElementFn(formatFn)) {
@@ -151,7 +151,7 @@ originalMessage) {
151
151
  };
152
152
  }));
153
153
  }
154
- if (icu_messageformat_parser_1.isSelectElement(el)) {
154
+ if ((0, icu_messageformat_parser_1.isSelectElement)(el)) {
155
155
  var opt = el.options[value] || el.options.other;
156
156
  if (!opt) {
157
157
  throw new error_1.InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
@@ -159,8 +159,8 @@ originalMessage) {
159
159
  result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
160
160
  continue;
161
161
  }
162
- if (icu_messageformat_parser_1.isPluralElement(el)) {
163
- var opt = el.options["=" + value];
162
+ if ((0, icu_messageformat_parser_1.isPluralElement)(el)) {
163
+ var opt = el.options["=".concat(value)];
164
164
  if (!opt) {
165
165
  if (!Intl.PluralRules) {
166
166
  throw new error_1.FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", error_1.ErrorCode.MISSING_INTL_API, originalMessage);