@formatjs/cli 6.2.6 → 6.2.8

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.
Files changed (2) hide show
  1. package/bin/formatjs +31 -2
  2. package/package.json +2 -2
package/bin/formatjs CHANGED
@@ -3619,6 +3619,27 @@ var require_number = __commonJS({
3619
3619
  case "scale":
3620
3620
  result.scale = parseFloat(token.options[0]);
3621
3621
  continue;
3622
+ case "rounding-mode-floor":
3623
+ result.roundingMode = "floor";
3624
+ continue;
3625
+ case "rounding-mode-ceiling":
3626
+ result.roundingMode = "ceil";
3627
+ continue;
3628
+ case "rounding-mode-down":
3629
+ result.roundingMode = "trunc";
3630
+ continue;
3631
+ case "rounding-mode-up":
3632
+ result.roundingMode = "expand";
3633
+ continue;
3634
+ case "rounding-mode-half-even":
3635
+ result.roundingMode = "halfEven";
3636
+ continue;
3637
+ case "rounding-mode-half-down":
3638
+ result.roundingMode = "halfTrunc";
3639
+ continue;
3640
+ case "rounding-mode-half-up":
3641
+ result.roundingMode = "halfExpand";
3642
+ continue;
3622
3643
  case "integer-width":
3623
3644
  if (token.options.length > 1) {
3624
3645
  throw new RangeError("integer-width stems only accept a single optional option");
@@ -198202,13 +198223,15 @@ function calculateLineColFromOffset(text, start) {
198202
198223
  async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
198203
198224
  let messages = [];
198204
198225
  let meta;
198226
+ const onMsgExtracted = opts.onMsgExtracted;
198227
+ const onMetaExtracted = opts.onMetaExtracted;
198205
198228
  opts = {
198206
198229
  ...opts,
198207
198230
  additionalComponentNames: [
198208
198231
  "$formatMessage",
198209
198232
  ...opts.additionalComponentNames || []
198210
198233
  ],
198211
- onMsgExtracted(_, msgs) {
198234
+ onMsgExtracted(filePath, msgs) {
198212
198235
  if (opts.extractSourceLocation) {
198213
198236
  msgs = msgs.map((msg) => ({
198214
198237
  ...msg,
@@ -198216,9 +198239,15 @@ async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
198216
198239
  }));
198217
198240
  }
198218
198241
  messages = messages.concat(msgs);
198242
+ if (onMsgExtracted) {
198243
+ onMsgExtracted(filePath, msgs);
198244
+ }
198219
198245
  },
198220
- onMetaExtracted(_, m) {
198246
+ onMetaExtracted(filePath, m) {
198221
198247
  meta = m;
198248
+ if (onMetaExtracted) {
198249
+ onMetaExtracted(filePath, m);
198250
+ }
198222
198251
  }
198223
198252
  };
198224
198253
  if (!opts.overrideIdFn && idInterpolationPattern) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/cli",
3
- "version": "6.2.6",
3
+ "version": "6.2.8",
4
4
  "description": "A CLI for formatjs.",
5
5
  "keywords": [
6
6
  "intl",
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/formatjs/formatjs/issues"
34
34
  },
35
35
  "devDependencies": {
36
- "@formatjs/cli-lib": "6.3.5"
36
+ "@formatjs/cli-lib": "6.3.7"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "vue": "^3.3.4"