@vitest/utils 2.0.0-beta.12 → 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 +3 -0
- 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
@@ -889,6 +889,9 @@ function parseStacktrace(stack, options = {}) {
|
|
889
889
|
}
|
890
890
|
return stacks.map((stack2) => {
|
891
891
|
var _a;
|
892
|
+
if (options.getFileName) {
|
893
|
+
stack2.file = options.getFileName(stack2.file);
|
894
|
+
}
|
892
895
|
const map = (_a = options.getSourceMap) == null ? void 0 : _a.call(options, stack2.file);
|
893
896
|
if (!map || typeof map !== "object" || !map.version) {
|
894
897
|
return stack2;
|