@lingui/format-csv 4.4.2 → 4.6.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/dist/csv.cjs +6 -2
- package/dist/csv.d.cts +5 -0
- package/dist/csv.d.mts +5 -0
- package/package.json +4 -4
package/dist/csv.cjs
CHANGED
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
const Papa = require('papaparse');
|
|
4
4
|
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
6
|
+
|
|
7
|
+
const Papa__default = /*#__PURE__*/_interopDefaultCompat(Papa);
|
|
8
|
+
|
|
5
9
|
const serialize = (catalog) => {
|
|
6
10
|
const rawArr = Object.keys(catalog).map((key) => [
|
|
7
11
|
key,
|
|
8
12
|
catalog[key].translation
|
|
9
13
|
]);
|
|
10
|
-
return
|
|
14
|
+
return Papa__default.unparse(rawArr);
|
|
11
15
|
};
|
|
12
16
|
const deserialize = (raw) => {
|
|
13
|
-
const rawCatalog =
|
|
17
|
+
const rawCatalog = Papa__default.parse(raw);
|
|
14
18
|
const messages = {};
|
|
15
19
|
if (rawCatalog.errors.length) {
|
|
16
20
|
throw new Error(
|
package/dist/csv.d.cts
ADDED
package/dist/csv.d.mts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/format-csv",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "CSV format for Lingui Catalogs",
|
|
5
5
|
"main": "./dist/csv.cjs",
|
|
6
6
|
"module": "./dist/csv.mjs",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dist/"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lingui/conf": "4.
|
|
42
|
+
"@lingui/conf": "4.6.0",
|
|
43
43
|
"papaparse": "^5.4.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsd": "^0.28.0",
|
|
47
|
-
"unbuild": "
|
|
47
|
+
"unbuild": "2.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2afa0efb2d0cd1d47adc76e1eec9f5e57e34ae18"
|
|
50
50
|
}
|