(parser: StackParser, event: Event)
| 84 | * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. |
| 85 | */ |
| 86 | export function addMetadataToStackFrames(parser: StackParser, event: Event): void { |
| 87 | event.exception?.values?.forEach(exception => { |
| 88 | exception.stacktrace?.frames?.forEach(frame => { |
| 89 | if (!frame.filename || frame.module_metadata) { |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | const metadata = getMetadataForUrl(parser, frame.filename); |
| 94 | |
| 95 | if (metadata) { |
| 96 | frame.module_metadata = metadata; |
| 97 | } |
| 98 | }); |
| 99 | }); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Strips metadata from stack frames. |
no test coverage detected