123456789101112131415161718192021222324252627282930313233343536373839 |
- import type {Frame} from 'sentry/types';
- import {getFileExtension} from 'sentry/utils/fileExtension';
- const fileNameBlocklist = ['@webkit-masked-url'];
- export function isFrameFilenamePathlike(frame: Frame): boolean {
- let filename = frame.absPath ?? '';
- try {
- filename = new URL(filename).pathname.split('/').reverse()[0];
- } catch {
- // do nothing
- }
- return (
- // If all filenames are anonymous, we do not want to show this alert
- (frame.filename === '<anonymous>' && frame.inApp) ||
- // If all function names are on the blocklist, we do not want to show this alert
- fileNameBlocklist.includes(frame.function ?? '') ||
- // If all absolute paths do not have a file extension, we do not want to show this alert
- (!!frame.absPath && !getFileExtension(filename))
- );
- }
- // Maps the SDK name to the url token for docs
- export const sourceMapSdkDocsMap: Record<string, string> = {
- 'sentry.javascript.browser': 'javascript',
- 'sentry.javascript.node': 'node',
- 'sentry.javascript.react': 'react',
- 'sentry.javascript.angular': 'angular',
- 'sentry.javascript.angular-ivy': 'angular',
- 'sentry.javascript.ember': 'ember',
- 'sentry.javascript.gatsby': 'gatsby',
- 'sentry.javascript.vue': 'vue',
- 'sentry.javascript.nextjs': 'nextjs',
- 'sentry.javascript.remix': 'remix',
- 'sentry.javascript.svelte': 'svelte',
- 'sentry.javascript.sveltekit': 'sveltekit',
- 'sentry.javascript.react-native': 'react-native',
- 'sentry.javascript.atro': 'astro',
- };
|