16 lines
580 B
JavaScript
16 lines
580 B
JavaScript
// Metro module 6408 (f6409).
|
|
import { DEBUG_BUILD } from "./Module6396";
|
|
import { logger } from "./consoleSandbox_6368";
|
|
export function parseSampleRate(a0) {
|
|
if (typeof a0 === "boolean") {
|
|
return Number(a0);
|
|
}
|
|
const r2 = typeof a0 === "string" ? parseFloat(a0) : a0;
|
|
if (typeof r2 === "number" && !isNaN(r2) && !(r2 < 0) && !(r2 > 1)) {
|
|
return r2;
|
|
}
|
|
if (DEBUG_BUILD) {
|
|
logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a0)} of type ${JSON.stringify(typeof a0)}.`);
|
|
}
|
|
}
|