Skip to content

Commit 2f15f61

Browse files
committed
remove redundant any cast
1 parent abc8f4b commit 2f15f61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/tracing/src/hubextensions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
SamplingContext,
88
TransactionContext,
99
} from '@sentry/types';
10-
import { dynamicRequire, isDebugBuild, isNodeEnv, loadModule, logger } from '@sentry/utils';
10+
import { dynamicRequire, isDebugBuild, isNaN, isNodeEnv, loadModule, logger } from '@sentry/utils';
1111

1212
import { registerErrorInstrumentation } from './errors';
1313
import { IdleTransaction } from './idletransaction';
@@ -130,7 +130,7 @@ function sample<T extends Transaction>(transaction: T, options: Options, samplin
130130
function isValidSampleRate(rate: unknown): boolean {
131131
// we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
132132
// eslint-disable-next-line @typescript-eslint/no-explicit-any
133-
if (isNaN(rate as any) || !(typeof rate === 'number' || typeof rate === 'boolean')) {
133+
if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {
134134
isDebugBuild() &&
135135
logger.warn(
136136
`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(

0 commit comments

Comments
 (0)