@cronn/lib-file-snapshots 0.15.0 → 0.16.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/index.d.ts CHANGED
@@ -67,10 +67,16 @@ interface TextSerializerOptions {
67
67
  * Custom normalizers to apply before serialization
68
68
  */
69
69
  normalizers?: Array<TextNormalizer>;
70
+ /**
71
+ * File extension used for storing the text file
72
+ *
73
+ * @default "txt"
74
+ */
75
+ fileExtension?: string;
70
76
  }
71
77
  type TextNormalizer = (value: string) => string;
72
78
  declare class TextSerializer implements SnapshotSerializer {
73
- readonly fileExtension = "txt";
79
+ readonly fileExtension: string;
74
80
  private readonly normalizers;
75
81
  constructor(options?: TextSerializerOptions);
76
82
  canSerialize(value: unknown): value is string;
package/dist/index.js CHANGED
@@ -214,10 +214,11 @@ var JsonSerializer = class {
214
214
 
215
215
  // src/serializers/text-serializer.ts
216
216
  var TextSerializer = class {
217
- fileExtension = "txt";
217
+ fileExtension;
218
218
  normalizers;
219
219
  constructor(options = {}) {
220
220
  this.normalizers = options.normalizers ?? [];
221
+ this.fileExtension = options.fileExtension ?? "txt";
221
222
  }
222
223
  canSerialize(value) {
223
224
  return isString(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronn/lib-file-snapshots",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "The library agnostic core for testing file snapshots",
5
5
  "keywords": [
6
6
  "file snapshots"
@@ -33,15 +33,15 @@
33
33
  ],
34
34
  "devDependencies": {
35
35
  "@trivago/prettier-plugin-sort-imports": "5.2.2",
36
- "@types/node": "22.18.1",
36
+ "@types/node": "22.18.6",
37
37
  "@vitest/coverage-istanbul": "3.2.4",
38
- "eslint": "9.35.0",
38
+ "eslint": "9.36.0",
39
39
  "eslint-config-prettier": "10.1.8",
40
40
  "eslint-plugin-unused-imports": "4.2.0",
41
41
  "prettier": "3.6.2",
42
42
  "tsup": "8.5.0",
43
43
  "typescript": "5.9.2",
44
- "typescript-eslint": "8.42.0",
44
+ "typescript-eslint": "8.44.0",
45
45
  "vitest": "3.2.4",
46
46
  "@cronn/shared-configs": "0.0.0"
47
47
  },