@lingui/format-json 4.5.0 → 4.7.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/README.md CHANGED
@@ -52,6 +52,13 @@ export type JsonFormatterOptions = {
52
52
  * @default "lingui"
53
53
  */
54
54
  style?: "lingui" | "minimal"
55
+
56
+ /**
57
+ * Indentation of output JSON
58
+ *
59
+ * @default 2
60
+ */
61
+ indentation?: number
55
62
  }
56
63
  ```
57
64
 
package/dist/json.cjs CHANGED
@@ -53,7 +53,7 @@ function formatter(options = {}) {
53
53
  if (options.style === "minimal") {
54
54
  outputCatalog = serializeMinimal(outputCatalog);
55
55
  }
56
- return JSON.stringify(outputCatalog, null, 2) + trailingNewLine;
56
+ return JSON.stringify(outputCatalog, null, options.indentation ?? 2) + trailingNewLine;
57
57
  },
58
58
  parse(content) {
59
59
  const catalog = JSON.parse(content);
package/dist/json.d.cts CHANGED
@@ -19,6 +19,12 @@ type JsonFormatterOptions = {
19
19
  * @default "lingui"
20
20
  */
21
21
  style?: "lingui" | "minimal";
22
+ /**
23
+ * Indentation of output JSON
24
+ *
25
+ * @default 2
26
+ */
27
+ indentation?: number;
22
28
  };
23
29
  declare function formatter(options?: JsonFormatterOptions): CatalogFormatter;
24
30
 
package/dist/json.d.mts CHANGED
@@ -19,6 +19,12 @@ type JsonFormatterOptions = {
19
19
  * @default "lingui"
20
20
  */
21
21
  style?: "lingui" | "minimal";
22
+ /**
23
+ * Indentation of output JSON
24
+ *
25
+ * @default 2
26
+ */
27
+ indentation?: number;
22
28
  };
23
29
  declare function formatter(options?: JsonFormatterOptions): CatalogFormatter;
24
30
 
package/dist/json.d.ts CHANGED
@@ -19,6 +19,12 @@ type JsonFormatterOptions = {
19
19
  * @default "lingui"
20
20
  */
21
21
  style?: "lingui" | "minimal";
22
+ /**
23
+ * Indentation of output JSON
24
+ *
25
+ * @default 2
26
+ */
27
+ indentation?: number;
22
28
  };
23
29
  declare function formatter(options?: JsonFormatterOptions): CatalogFormatter;
24
30
 
package/dist/json.mjs CHANGED
@@ -37,7 +37,7 @@ function formatter(options = {}) {
37
37
  if (options.style === "minimal") {
38
38
  outputCatalog = serializeMinimal(outputCatalog);
39
39
  }
40
- return JSON.stringify(outputCatalog, null, 2) + trailingNewLine;
40
+ return JSON.stringify(outputCatalog, null, options.indentation ?? 2) + trailingNewLine;
41
41
  },
42
42
  parse(content) {
43
43
  const catalog = JSON.parse(content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/format-json",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "description": "JSON format for Lingui Catalogs",
5
5
  "main": "./dist/json.cjs",
6
6
  "module": "./dist/json.mjs",
@@ -39,12 +39,12 @@
39
39
  "dist/"
40
40
  ],
41
41
  "dependencies": {
42
- "@lingui/conf": "4.5.0",
42
+ "@lingui/conf": "4.7.0",
43
43
  "ramda": "^0.28.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsd": "^0.28.0",
47
47
  "unbuild": "^2.0.0"
48
48
  },
49
- "gitHead": "62c92d1f8c60b3890bdda870f307fa780d423080"
49
+ "gitHead": "ebb6353aef59d1b1a29a10ba6ffe94eb42c51a77"
50
50
  }