Skip to content

Commit 64738db

Browse files
authored
ref(profiling): Improve generic profiling type (#17056)
This allows us to avoid `any` here, and makes more sense overall IMHO.
1 parent 87cd836 commit 64738db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/profiling.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { Profiler, ProfilingIntegration } from './types-hoist/profiling';
44
import { debug } from './utils/debug-logger';
55

66
function isProfilingIntegrationWithProfiler(
7-
integration: ProfilingIntegration<any> | undefined,
8-
): integration is ProfilingIntegration<any> {
7+
integration: ProfilingIntegration | undefined,
8+
): integration is ProfilingIntegration {
99
return (
1010
!!integration &&
1111
typeof integration['_profiler'] !== 'undefined' &&
@@ -25,7 +25,7 @@ function startProfiler(): void {
2525
return;
2626
}
2727

28-
const integration = client.getIntegrationByName<ProfilingIntegration<any>>('ProfilingIntegration');
28+
const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration');
2929

3030
if (!integration) {
3131
DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');
@@ -51,7 +51,7 @@ function stopProfiler(): void {
5151
return;
5252
}
5353

54-
const integration = client.getIntegrationByName<ProfilingIntegration<any>>('ProfilingIntegration');
54+
const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration');
5555
if (!integration) {
5656
DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');
5757
return;

packages/core/src/types-hoist/profiling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface ContinuousProfiler<T extends Client> {
99
stop(): void;
1010
}
1111

12-
export interface ProfilingIntegration<T extends Client> extends Integration {
12+
export interface ProfilingIntegration<T extends Client = Client> extends Integration {
1313
_profiler: ContinuousProfiler<T>;
1414
}
1515

0 commit comments

Comments
 (0)