@lingui/format-csv 5.9.2 → 6.0.0-next.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/package.json +15 -10
- package/dist/csv.cjs +0 -46
- package/dist/csv.d.cts +0 -5
- package/dist/csv.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/format-csv",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-next.0",
|
|
4
4
|
"description": "CSV format for Lingui Catalogs",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/csv.mjs"
|
|
8
|
+
},
|
|
8
9
|
"sideEffects": false,
|
|
9
10
|
"license": "MIT",
|
|
10
11
|
"keywords": [
|
|
@@ -20,8 +21,8 @@
|
|
|
20
21
|
"multilingual"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
|
-
"build": "
|
|
24
|
-
"
|
|
24
|
+
"build": "unbuild",
|
|
25
|
+
"check-types": "tsc --noEmit"
|
|
25
26
|
},
|
|
26
27
|
"homepage": "https://lingui.dev",
|
|
27
28
|
"repository": {
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"url": "https://github.com/lingui/js-lingui/issues"
|
|
34
35
|
},
|
|
35
36
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.19.0"
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"LICENSE",
|
|
@@ -41,11 +42,15 @@
|
|
|
41
42
|
"dist/"
|
|
42
43
|
],
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@lingui/conf": "
|
|
45
|
+
"@lingui/conf": "6.0.0-next.0",
|
|
45
46
|
"papaparse": "^5.4.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"unbuild": "
|
|
49
|
+
"unbuild": "3.6.1",
|
|
50
|
+
"vitest": "4.0.18"
|
|
51
|
+
},
|
|
52
|
+
"unbuild": {
|
|
53
|
+
"declaration": "node16"
|
|
49
54
|
},
|
|
50
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a9576050487a4f7dfbc88db20814d5a1bb861c8c"
|
|
51
56
|
}
|
package/dist/csv.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Papa = require('papaparse');
|
|
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
|
-
|
|
9
|
-
const serialize = (catalog) => {
|
|
10
|
-
const rawArr = Object.keys(catalog).map((key) => [
|
|
11
|
-
key,
|
|
12
|
-
catalog[key].translation
|
|
13
|
-
]);
|
|
14
|
-
return Papa__default.unparse(rawArr);
|
|
15
|
-
};
|
|
16
|
-
const deserialize = (raw) => {
|
|
17
|
-
const rawCatalog = Papa__default.parse(raw);
|
|
18
|
-
const messages = {};
|
|
19
|
-
if (rawCatalog.errors.length) {
|
|
20
|
-
throw new Error(
|
|
21
|
-
rawCatalog.errors.map((err) => JSON.stringify(err)).join(";")
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
rawCatalog.data.forEach(([key, translation]) => {
|
|
25
|
-
messages[key] = {
|
|
26
|
-
translation,
|
|
27
|
-
obsolete: false,
|
|
28
|
-
message: null,
|
|
29
|
-
origin: []
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
return messages;
|
|
33
|
-
};
|
|
34
|
-
function formatter() {
|
|
35
|
-
return {
|
|
36
|
-
catalogExtension: ".csv",
|
|
37
|
-
parse(content) {
|
|
38
|
-
return deserialize(content);
|
|
39
|
-
},
|
|
40
|
-
serialize(catalog) {
|
|
41
|
-
return serialize(catalog);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.formatter = formatter;
|
package/dist/csv.d.cts
DELETED