@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.
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/utils",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.12",
4
+ "version": "2.0.0-beta.13",
5
5
  "description": "Shared Vitest utility functions",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",