@depup/vitest__pretty-format 4.1.1-depup.0 → 4.1.3-depup.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 +3 -9
- package/changes.json +3 -8
- package/dist/index.d.ts +59 -1
- package/dist/index.js +10 -7
- package/package.json +5 -10
package/README.md
CHANGED
|
@@ -13,16 +13,10 @@ npm install @depup/vitest__pretty-format
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@vitest/pretty-format](https://www.npmjs.com/package/@vitest/pretty-format) @ 4.1.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [@vitest/pretty-format](https://www.npmjs.com/package/@vitest/pretty-format) @ 4.1.3 |
|
|
17
|
+
| Processed | 2026-04-07 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
20
|
-
|
|
21
|
-
## Dependency Changes
|
|
22
|
-
|
|
23
|
-
| Dependency | From | To |
|
|
24
|
-
|------------|------|-----|
|
|
25
|
-
| tinyrainbow | ^3.0.3 | ^3.1.0 |
|
|
19
|
+
| Deps updated | 0 |
|
|
26
20
|
|
|
27
21
|
---
|
|
28
22
|
|
package/changes.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -46,19 +46,78 @@ interface Options extends Omit<RequiredOptions, "compareKeys" | "theme"> {
|
|
|
46
46
|
theme: Theme;
|
|
47
47
|
}
|
|
48
48
|
interface PrettyFormatOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Call `toJSON` on objects before formatting them.
|
|
51
|
+
* Ignored after the formatter has already called `toJSON` once for a value.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
49
54
|
callToJSON?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to escape special characters in regular expressions.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
50
59
|
escapeRegex?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to escape special characters in strings.
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
51
64
|
escapeString?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether to highlight syntax using terminal colors.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
52
69
|
highlight?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Number of spaces to use for each level of indentation.
|
|
72
|
+
* @default 2
|
|
73
|
+
*/
|
|
53
74
|
indent?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Maximum depth to recurse into nested values.
|
|
77
|
+
* @default Infinity
|
|
78
|
+
*/
|
|
54
79
|
maxDepth?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Maximum number of items to print in arrays, sets, maps, and similar collections.
|
|
82
|
+
* @default Infinity
|
|
83
|
+
*/
|
|
55
84
|
maxWidth?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Approximate per-depth-level budget for output length.
|
|
87
|
+
* When the accumulated output at any single depth level exceeds this value,
|
|
88
|
+
* further nesting is collapsed. This is a heuristic safety valve, not a hard
|
|
89
|
+
* limit — total output can reach up to roughly `maxDepth × maxOutputLength`.
|
|
90
|
+
* @default 1_000_000
|
|
91
|
+
*/
|
|
56
92
|
maxOutputLength?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Whether to minimize added whitespace, including indentation and line breaks.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
57
97
|
min?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether to print `Object` / `Array` prefixes for plain objects and arrays.
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
58
102
|
printBasicPrototype?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Whether to include the function name when formatting functions.
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
59
107
|
printFunctionName?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to include shadow-root contents when formatting DOM nodes.
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
60
112
|
printShadowRoot?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Compare function used when sorting object keys. Set to `null` to disable sorting.
|
|
115
|
+
*/
|
|
61
116
|
compareKeys?: CompareKeys;
|
|
117
|
+
/**
|
|
118
|
+
* Plugins used to serialize application-specific data types.
|
|
119
|
+
* @default []
|
|
120
|
+
*/
|
|
62
121
|
plugins?: Plugins;
|
|
63
122
|
}
|
|
64
123
|
type OptionsReceived = PrettyFormatOptions;
|
|
@@ -79,7 +138,6 @@ interface Config {
|
|
|
79
138
|
spacingInner: string;
|
|
80
139
|
spacingOuter: string;
|
|
81
140
|
maxOutputLength: number;
|
|
82
|
-
outputLength: number;
|
|
83
141
|
}
|
|
84
142
|
type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
85
143
|
type Test = (arg0: any) => boolean;
|
package/dist/index.js
CHANGED
|
@@ -933,12 +933,15 @@ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
|
933
933
|
result = printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
//
|
|
937
|
-
//
|
|
938
|
-
//
|
|
939
|
-
//
|
|
940
|
-
|
|
941
|
-
|
|
936
|
+
// Per-depth output budget (inspired by Node's util.inspect).
|
|
937
|
+
// Each depth level tracks output independently, so nested results
|
|
938
|
+
// don't inflate a single counter (which would undercount by ~Nx for
|
|
939
|
+
// N levels of nesting). Nodes at the same depth produce disjoint spans
|
|
940
|
+
// in the output string, so each bucket accurately reflects output at
|
|
941
|
+
// that level. Total output is bounded by maxDepth × maxOutputLength.
|
|
942
|
+
config._outputLengthPerDepth[depth] ??= 0;
|
|
943
|
+
config._outputLengthPerDepth[depth] += result.length;
|
|
944
|
+
if (config._outputLengthPerDepth[depth] > config.maxOutputLength) {
|
|
942
945
|
config.maxDepth = 0;
|
|
943
946
|
}
|
|
944
947
|
return result;
|
|
@@ -1026,7 +1029,7 @@ function getConfig(options) {
|
|
|
1026
1029
|
spacingInner: options?.min ? " " : "\n",
|
|
1027
1030
|
spacingOuter: options?.min ? "" : "\n",
|
|
1028
1031
|
maxOutputLength: options?.maxOutputLength ?? DEFAULT_OPTIONS.maxOutputLength,
|
|
1029
|
-
|
|
1032
|
+
_outputLengthPerDepth: []
|
|
1030
1033
|
};
|
|
1031
1034
|
}
|
|
1032
1035
|
function createIndent(indent) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/vitest__pretty-format",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.3-depup.0",
|
|
5
5
|
"description": "Fork of pretty-format with support for ESM (with updated dependencies)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -56,16 +56,11 @@
|
|
|
56
56
|
"dev": "rollup -c --watch"
|
|
57
57
|
},
|
|
58
58
|
"depup": {
|
|
59
|
-
"changes": {
|
|
60
|
-
|
|
61
|
-
"from": "^3.0.3",
|
|
62
|
-
"to": "^3.1.0"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"depsUpdated": 1,
|
|
59
|
+
"changes": {},
|
|
60
|
+
"depsUpdated": 0,
|
|
66
61
|
"originalPackage": "@vitest/pretty-format",
|
|
67
|
-
"originalVersion": "4.1.
|
|
68
|
-
"processedAt": "2026-
|
|
62
|
+
"originalVersion": "4.1.3",
|
|
63
|
+
"processedAt": "2026-04-07T12:27:12.074Z",
|
|
69
64
|
"smokeTest": "passed"
|
|
70
65
|
}
|
|
71
66
|
}
|