@vitest/utils 2.0.0-beta.11 → 2.0.0-beta.13
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/source-map.d.ts +1 -0
- package/dist/source-map.js +7 -1
- package/package.json +1 -1
package/dist/source-map.d.ts
CHANGED
@@ -104,6 +104,7 @@ declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): Gene
|
|
104
104
|
interface StackTraceParserOptions {
|
105
105
|
ignoreStackEntries?: (RegExp | string)[];
|
106
106
|
getSourceMap?: (file: string) => unknown;
|
107
|
+
getFileName?: (id: string) => string;
|
107
108
|
frameFilter?: (error: Error, frame: ParsedStack) => boolean | void;
|
108
109
|
}
|
109
110
|
declare function parseSingleFFOrSafariStack(raw: string): ParsedStack | null;
|
package/dist/source-map.js
CHANGED
@@ -774,7 +774,10 @@ const stackIgnorePatterns = [
|
|
774
774
|
"/node_modules/tinypool/",
|
775
775
|
"/node_modules/tinyspy/",
|
776
776
|
// browser related deps
|
777
|
-
"/deps/",
|
777
|
+
"/deps/chunk-",
|
778
|
+
"/deps/@vitest",
|
779
|
+
"/deps/loupe",
|
780
|
+
"/deps/chai",
|
778
781
|
/node:\w+/,
|
779
782
|
/__vitest_test__/,
|
780
783
|
/__vitest_browser__/,
|
@@ -886,6 +889,9 @@ function parseStacktrace(stack, options = {}) {
|
|
886
889
|
}
|
887
890
|
return stacks.map((stack2) => {
|
888
891
|
var _a;
|
892
|
+
if (options.getFileName) {
|
893
|
+
stack2.file = options.getFileName(stack2.file);
|
894
|
+
}
|
889
895
|
const map = (_a = options.getSourceMap) == null ? void 0 : _a.call(options, stack2.file);
|
890
896
|
if (!map || typeof map !== "object" || !map.version) {
|
891
897
|
return stack2;
|