(value: string | undefined)
| 70 | value !== undefined && /^[\w.$<>:/@ -]{1,160}$/.test(value) ? value : undefined; |
| 71 | |
| 72 | const sourceFile = (value: string | undefined): string | undefined => { |
| 73 | if (!value) return undefined; |
| 74 | const path = URL.canParse(value) ? new URL(value).pathname : value.split(/[?#]/)[0]; |
| 75 | return path && /^\/?(?:assets\/)?[\w./-]+\.(?:js|mjs|ts|tsx)$/.test(path) ? path : undefined; |
| 76 | }; |
| 77 | |
| 78 | /** Keep error classification, source positions and correlation; omit all raw payloads. */ |
| 79 | export const minimizeSentryEvent = (event: ErrorEvent): ErrorEvent => { |
no outgoing calls
no test coverage detected