File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export function parseSampleRate(sampleRate: unknown): number | undefined {
14
14
}
15
15
16
16
const rate = typeof sampleRate === 'string' ? parseFloat ( sampleRate ) : sampleRate ;
17
- if ( typeof rate !== 'number' || isNaN ( rate ) ) {
17
+ if ( typeof rate !== 'number' || isNaN ( rate ) || rate < 0 || rate > 1 ) {
18
18
DEBUG_BUILD &&
19
19
logger . warn (
20
20
`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${ JSON . stringify (
@@ -24,11 +24,5 @@ export function parseSampleRate(sampleRate: unknown): number | undefined {
24
24
return undefined ;
25
25
}
26
26
27
- if ( rate < 0 || rate > 1 ) {
28
- DEBUG_BUILD &&
29
- logger . warn ( `[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${ rate } .` ) ;
30
- return undefined ;
31
- }
32
-
33
27
return rate ;
34
28
}
You can’t perform that action at this time.
0 commit comments