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 {
1414 }
1515
1616 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 ) {
1818 DEBUG_BUILD &&
1919 logger . warn (
2020 `[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 {
2424 return undefined ;
2525 }
2626
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-
3327 return rate ;
3428}
You can’t perform that action at this time.
0 commit comments