1
- import type { Client , DsnComponents , Hub } from '@sentry/types' ;
1
+ import type { Client , DsnComponents } from '@sentry/types' ;
2
2
3
3
/**
4
4
* Checks whether given url points to Sentry server
5
- * @param url url to verify
6
5
*
7
- * TODO(v8): Remove Hub fallback type
6
+ * @param url url to verify
8
7
*/
9
- export function isSentryRequestUrl ( url : string , hubOrClient : Hub | Client | undefined ) : boolean {
10
- const client =
11
- hubOrClient && isHub ( hubOrClient )
12
- ? // eslint-disable-next-line deprecation/deprecation
13
- hubOrClient . getClient ( )
14
- : hubOrClient ;
8
+ export function isSentryRequestUrl ( url : string , client : Client | undefined ) : boolean {
15
9
const dsn = client && client . getDsn ( ) ;
16
10
const tunnel = client && client . getOptions ( ) . tunnel ;
17
-
18
11
return checkDsn ( url , dsn ) || checkTunnel ( url , tunnel ) ;
19
12
}
20
13
@@ -33,8 +26,3 @@ function checkDsn(url: string, dsn: DsnComponents | undefined): boolean {
33
26
function removeTrailingSlash ( str : string ) : string {
34
27
return str [ str . length - 1 ] === '/' ? str . slice ( 0 , - 1 ) : str ;
35
28
}
36
-
37
- function isHub ( hubOrClient : Hub | Client | undefined ) : hubOrClient is Hub {
38
- // eslint-disable-next-line deprecation/deprecation
39
- return ( hubOrClient as Hub ) . getClient !== undefined ;
40
- }
0 commit comments