@discord/intl 0.7.1-rc.0 → 0.7.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/format.js CHANGED
@@ -37,16 +37,16 @@ exports.FormatBuilder = FormatBuilder;
37
37
  function bindFormatValuesWithBuilder(builder, nodes, locales, formatters, formatConfig, values = {}, currentPluralValue, originalMessage) {
38
38
  var _a, _b;
39
39
  // Hot path for static messages that are just parsed as a single string element.
40
- if (nodes.length === 1 && typeof nodes[0][0] === 'string') {
41
- builder.pushLiteralText(nodes[0][0]);
40
+ if (nodes.length === 1 && typeof nodes[0] === 'string') {
41
+ builder.pushLiteralText(nodes[0]);
42
42
  return;
43
43
  }
44
44
  for (const node of nodes) {
45
- const nodeType = node[intl_ast_1.AstNodeIndices.Type];
46
- if (typeof nodeType === 'string') {
47
- builder.pushLiteralText(nodeType);
45
+ if (typeof node === 'string') {
46
+ builder.pushLiteralText(node);
48
47
  continue;
49
48
  }
49
+ const nodeType = node[intl_ast_1.AstNodeIndices.Type];
50
50
  switch (nodeType) {
51
51
  case intl_ast_1.FormatJsNodeType.Pound:
52
52
  // Replace `#` in plural rules with the actual numeric value. Only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discord/intl",
3
- "version": "0.7.1-rc.0",
3
+ "version": "0.7.1",
4
4
  "license": "MIT",
5
5
  "description": "Client runtime for managing messages and translations in a React project.",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "@formatjs/intl": "^2.10.1",
20
20
  "@intrnl/xxhash64": "^0.1.2",
21
21
  "intl-messageformat": "^10.5.11",
22
- "@discord/intl-ast": "0.7.1-rc.0"
22
+ "@discord/intl-ast": "0.7.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@swc/cli": "^0.3.12",
package/src/format.ts CHANGED
@@ -56,17 +56,17 @@ export function bindFormatValuesWithBuilder<T, Builder extends FormatBuilder<T>>
56
56
  originalMessage?: string,
57
57
  ) {
58
58
  // Hot path for static messages that are just parsed as a single string element.
59
- if (nodes.length === 1 && typeof nodes[0][0] === 'string') {
60
- builder.pushLiteralText(nodes[0][0]);
59
+ if (nodes.length === 1 && typeof nodes[0] === 'string') {
60
+ builder.pushLiteralText(nodes[0]);
61
61
  return;
62
62
  }
63
63
 
64
64
  for (const node of nodes) {
65
- const nodeType = node[AstNodeIndices.Type];
66
- if (typeof nodeType === 'string') {
67
- builder.pushLiteralText(nodeType);
65
+ if (typeof node === 'string') {
66
+ builder.pushLiteralText(node);
68
67
  continue;
69
68
  }
69
+ const nodeType = node[AstNodeIndices.Type];
70
70
  switch (nodeType) {
71
71
  case FormatJsNodeType.Pound:
72
72
  // Replace `#` in plural rules with the actual numeric value. Only