@vitest/utils 3.1.0-beta.2 → 3.1.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.js +1 -1
- package/dist/helpers.d.ts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/source-map.d.ts +2 -1
- package/dist/source-map.js +9 -0
- package/package.json +3 -3
package/dist/diff.js
CHANGED
@@ -1417,7 +1417,7 @@ function getDefaultOptions() {
|
|
1417
1417
|
compareKeys: undefined,
|
1418
1418
|
contextLines: DIFF_CONTEXT_DEFAULT,
|
1419
1419
|
emptyFirstOrLastLinePlaceholder: "",
|
1420
|
-
expand:
|
1420
|
+
expand: false,
|
1421
1421
|
includeChangeCounts: false,
|
1422
1422
|
omitAnnotationLines: false,
|
1423
1423
|
patchColor: c.yellow,
|
package/dist/helpers.d.ts
CHANGED
@@ -51,4 +51,5 @@ declare function isNegativeNaN(val: number): boolean;
|
|
51
51
|
*/
|
52
52
|
declare function deepMerge<T extends object = object>(target: T, ...sources: any[]): T;
|
53
53
|
|
54
|
-
export {
|
54
|
+
export { assertTypes, clone, createDefer, createSimpleStackTrace, deepClone, deepMerge, getCallLastIndex, getOwnProperties, getType, isNegativeNaN, isObject, isPrimitive, noop, notNullish, objectAttr, parseRegexp, slash, toArray };
|
55
|
+
export type { DeferPromise };
|
package/dist/index.d.ts
CHANGED
@@ -53,4 +53,5 @@ interface SafeTimers {
|
|
53
53
|
declare function getSafeTimers(): SafeTimers;
|
54
54
|
declare function setSafeTimers(): void;
|
55
55
|
|
56
|
-
export {
|
56
|
+
export { format, getSafeTimers, highlight, inspect, lineSplitRE, nanoid, objDisplay, offsetToLineNumber, positionToOffset, setSafeTimers, shuffle, stringify };
|
57
|
+
export type { SafeTimers, StringifyOptions };
|
package/dist/source-map.d.ts
CHANGED
@@ -133,4 +133,5 @@ declare function createStackString(stacks: ParsedStack[]): string;
|
|
133
133
|
declare function parseStacktrace(stack: string, options?: StackTraceParserOptions): ParsedStack[];
|
134
134
|
declare function parseErrorStacktrace(e: ErrorWithDiff, options?: StackTraceParserOptions): ParsedStack[];
|
135
135
|
|
136
|
-
export {
|
136
|
+
export { TraceMap, createStackString, eachMapping, generatedPositionFor, originalPositionFor, parseErrorStacktrace, parseSingleFFOrSafariStack, parseSingleStack, parseSingleV8Stack, parseStacktrace };
|
137
|
+
export type { EachMapping, SourceMapInput, StackTraceParserOptions };
|
package/dist/source-map.js
CHANGED
@@ -961,6 +961,15 @@ function parseErrorStacktrace(e, options = {}) {
|
|
961
961
|
}
|
962
962
|
const stackStr = e.stack || e.stackStr || "";
|
963
963
|
let stackFrames = parseStacktrace(stackStr, options);
|
964
|
+
if (!stackFrames.length) {
|
965
|
+
const e_ = e;
|
966
|
+
if (e_.fileName != null && e_.lineNumber != null && e_.columnNumber != null) {
|
967
|
+
stackFrames = parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`, options);
|
968
|
+
}
|
969
|
+
if (e_.sourceURL != null && e_.line != null && e_._column != null) {
|
970
|
+
stackFrames = parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`, options);
|
971
|
+
}
|
972
|
+
}
|
964
973
|
if (options.frameFilter) {
|
965
974
|
stackFrames = stackFrames.filter((f) => options.frameFilter(e, f) !== false);
|
966
975
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitest/utils",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.1.
|
4
|
+
"version": "3.1.1",
|
5
5
|
"description": "Shared Vitest utility functions",
|
6
6
|
"license": "MIT",
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
@@ -62,11 +62,11 @@
|
|
62
62
|
"dependencies": {
|
63
63
|
"loupe": "^3.1.3",
|
64
64
|
"tinyrainbow": "^2.0.0",
|
65
|
-
"@vitest/pretty-format": "3.1.
|
65
|
+
"@vitest/pretty-format": "3.1.1"
|
66
66
|
},
|
67
67
|
"devDependencies": {
|
68
68
|
"@jridgewell/trace-mapping": "^0.3.25",
|
69
|
-
"@types/estree": "^1.0.
|
69
|
+
"@types/estree": "^1.0.7",
|
70
70
|
"diff-sequences": "^29.6.3",
|
71
71
|
"tinyhighlight": "^0.3.2"
|
72
72
|
},
|