@vitest/utils 2.1.5 → 2.2.0-beta.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/diff.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DiffOptions } from './types-Bxe-2Udy.js';
2
- export { a as DiffOptionsColor } from './types-Bxe-2Udy.js';
1
+ import { D as DiffOptions } from './types-6R1G1gkS.js';
2
+ export { a as DiffOptionsColor, S as SerializedDiffOptions } from './types-6R1G1gkS.js';
3
3
  import '@vitest/pretty-format';
4
4
 
5
5
  /**
package/dist/diff.js CHANGED
@@ -1407,6 +1407,7 @@ function getDefaultOptions() {
1407
1407
  includeChangeCounts: false,
1408
1408
  omitAnnotationLines: false,
1409
1409
  patchColor: c.yellow,
1410
+ printBasicPrototype: true,
1410
1411
  truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
1411
1412
  truncateAnnotation: "... Diff result is truncated",
1412
1413
  truncateAnnotationColor: noColor
@@ -1939,10 +1940,11 @@ ${difference}`;
1939
1940
  return difference;
1940
1941
  }
1941
1942
  function getFormatOptions(formatOptions, options) {
1942
- const { compareKeys } = normalizeDiffOptions(options);
1943
+ const { compareKeys, printBasicPrototype } = normalizeDiffOptions(options);
1943
1944
  return {
1944
1945
  ...formatOptions,
1945
- compareKeys
1946
+ compareKeys,
1947
+ printBasicPrototype
1946
1948
  };
1947
1949
  }
1948
1950
  function getObjectsDifference(a, b, formatOptions, options) {
package/dist/error.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { D as DiffOptions } from './types-Bxe-2Udy.js';
1
+ import { D as DiffOptions } from './types-6R1G1gkS.js';
2
2
  import '@vitest/pretty-format';
3
3
 
4
4
  declare function serializeValue(val: any, seen?: WeakMap<WeakKey, any>): any;
@@ -26,10 +26,26 @@ interface DiffOptions {
26
26
  includeChangeCounts?: boolean;
27
27
  omitAnnotationLines?: boolean;
28
28
  patchColor?: DiffOptionsColor;
29
+ printBasicPrototype?: boolean;
29
30
  compareKeys?: CompareKeys;
30
31
  truncateThreshold?: number;
31
32
  truncateAnnotation?: string;
32
33
  truncateAnnotationColor?: DiffOptionsColor;
33
34
  }
35
+ interface SerializedDiffOptions {
36
+ aAnnotation?: string;
37
+ aIndicator?: string;
38
+ bAnnotation?: string;
39
+ bIndicator?: string;
40
+ commonIndicator?: string;
41
+ contextLines?: number;
42
+ emptyFirstOrLastLinePlaceholder?: string;
43
+ expand?: boolean;
44
+ includeChangeCounts?: boolean;
45
+ omitAnnotationLines?: boolean;
46
+ printBasicPrototype?: boolean;
47
+ truncateThreshold?: number;
48
+ truncateAnnotation?: string;
49
+ }
34
50
 
35
- export type { DiffOptions as D, DiffOptionsColor as a };
51
+ export type { DiffOptions as D, SerializedDiffOptions as S, DiffOptionsColor as a };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/utils",
3
3
  "type": "module",
4
- "version": "2.1.5",
4
+ "version": "2.2.0-beta.1",
5
5
  "description": "Shared Vitest utility functions",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "loupe": "^3.1.2",
64
64
  "tinyrainbow": "^1.2.0",
65
- "@vitest/pretty-format": "2.1.5"
65
+ "@vitest/pretty-format": "2.2.0-beta.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@jridgewell/trace-mapping": "^0.3.25",