From 8bac58e72e2c2659738b00ec336dcd52d55d5824 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 17 Jul 2025 12:31:42 +0200 Subject: [PATCH] ref(profiling): Improve generic profiling type This allows us to avoid `any` here, and makes more sense overall IMHO. --- packages/core/src/profiling.ts | 8 ++++---- packages/core/src/types-hoist/profiling.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/profiling.ts b/packages/core/src/profiling.ts index b49a30070683..407c4a07c53c 100644 --- a/packages/core/src/profiling.ts +++ b/packages/core/src/profiling.ts @@ -4,8 +4,8 @@ import type { Profiler, ProfilingIntegration } from './types-hoist/profiling'; import { debug } from './utils/debug-logger'; function isProfilingIntegrationWithProfiler( - integration: ProfilingIntegration | undefined, -): integration is ProfilingIntegration { + integration: ProfilingIntegration | undefined, +): integration is ProfilingIntegration { return ( !!integration && typeof integration['_profiler'] !== 'undefined' && @@ -25,7 +25,7 @@ function startProfiler(): void { return; } - const integration = client.getIntegrationByName>('ProfilingIntegration'); + const integration = client.getIntegrationByName('ProfilingIntegration'); if (!integration) { DEBUG_BUILD && debug.warn('ProfilingIntegration is not available'); @@ -51,7 +51,7 @@ function stopProfiler(): void { return; } - const integration = client.getIntegrationByName>('ProfilingIntegration'); + const integration = client.getIntegrationByName('ProfilingIntegration'); if (!integration) { DEBUG_BUILD && debug.warn('ProfilingIntegration is not available'); return; diff --git a/packages/core/src/types-hoist/profiling.ts b/packages/core/src/types-hoist/profiling.ts index 2c0c439450bb..2c369c0d5e57 100644 --- a/packages/core/src/types-hoist/profiling.ts +++ b/packages/core/src/types-hoist/profiling.ts @@ -9,7 +9,7 @@ export interface ContinuousProfiler { stop(): void; } -export interface ProfilingIntegration extends Integration { +export interface ProfilingIntegration extends Integration { _profiler: ContinuousProfiler; }