@lingui/core 4.2.0 → 4.2.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/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const unraw = require('unraw');
3
4
  const compileMessage = require('@lingui/message-utils/compileMessage');
4
5
 
5
6
  const isString = (s) => typeof s === "string";
@@ -109,8 +110,9 @@ function interpolate(translation, locale, locales) {
109
110
  }, "");
110
111
  };
111
112
  const result = formatMessage(translation);
112
- if (isString(result) && UNICODE_REGEX.test(result))
113
- return JSON.parse(`"${result.trim()}"`);
113
+ if (isString(result) && UNICODE_REGEX.test(result)) {
114
+ return unraw(result.trim());
115
+ }
114
116
  if (isString(result))
115
117
  return result.trim();
116
118
  return result;
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import unraw from 'unraw';
1
2
  import { compileMessage } from '@lingui/message-utils/compileMessage';
2
3
 
3
4
  const isString = (s) => typeof s === "string";
@@ -107,8 +108,9 @@ function interpolate(translation, locale, locales) {
107
108
  }, "");
108
109
  };
109
110
  const result = formatMessage(translation);
110
- if (isString(result) && UNICODE_REGEX.test(result))
111
- return JSON.parse(`"${result.trim()}"`);
111
+ if (isString(result) && UNICODE_REGEX.test(result)) {
112
+ return unraw(result.trim());
113
+ }
112
114
  if (isString(result))
113
115
  return result.trim();
114
116
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/core",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "sideEffects": false,
5
5
  "description": "I18n tools for javascript",
6
6
  "main": "./dist/index.cjs",
@@ -54,11 +54,12 @@
54
54
  ],
55
55
  "dependencies": {
56
56
  "@babel/runtime": "^7.20.13",
57
- "@lingui/message-utils": "4.2.0"
57
+ "@lingui/message-utils": "4.2.1",
58
+ "unraw": "^2.0.1"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@lingui/jest-mocks": "*",
61
62
  "unbuild": "^1.1.2"
62
63
  },
63
- "gitHead": "57aa5ce306558d0a9d29a14dd40ffa31e5d591bd"
64
+ "gitHead": "9e0cd185ec372aab1d2df937e02cec2b31e73c10"
64
65
  }