Skip to content

Commit 6bd6ff8

Browse files
export isValidSampleRate
1 parent 84a6021 commit 6bd6ff8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/core/src/tracing/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ export {
2727
} from './trace';
2828
export { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';
2929
export { setMeasurement } from './measurement';
30+
export { isValidSampleRate } from './sampling';

packages/core/src/tracing/sampling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function sampleTransaction<T extends Transaction>(
103103
/**
104104
* Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).
105105
*/
106-
function isValidSampleRate(rate: unknown): boolean {
106+
export function isValidSampleRate(rate: unknown): boolean {
107107
// we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
108108
// eslint-disable-next-line @typescript-eslint/no-explicit-any
109109
if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {

0 commit comments

Comments
 (0)