react-i18next 16.1.2 → 16.1.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 16.1.3
2
+
3
+ - fix: ensure invalid identifiers are quoted in the props object [1874](https://github.com/i18next/react-i18next/pull/1874)
4
+
1
5
  ### 16.1.2
2
6
 
3
7
  - missing.js extensions for Icu imports
@@ -1 +1 @@
1
- {"type":"module","version":"16.1.2"}
1
+ {"type":"module","version":"16.1.3"}
package/icu.macro.js CHANGED
@@ -364,7 +364,12 @@ function jsxElementToDeclaration(jsxElement, t) {
364
364
  propValue = t.nullLiteral();
365
365
  }
366
366
 
367
- propsProperties.push(t.objectProperty(t.identifier(propName), propValue));
367
+ // Use string literal for keys that aren't valid identifiers (e.g., contain hyphens)
368
+ const propKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propName)
369
+ ? t.identifier(propName)
370
+ : t.stringLiteral(propName);
371
+
372
+ propsProperties.push(t.objectProperty(propKey, propValue));
368
373
  }
369
374
  });
370
375
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-i18next",
3
- "version": "16.1.2",
3
+ "version": "16.1.3",
4
4
  "description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "types": "./index.d.mts",