decord/source/__polyfill/12xxx/module_12930.js
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

42 lines
1.2 KiB
JavaScript

// Module ID: 12930
// Function ID: 12931
// Dependencies: [12918, 12890]
// Exports: parseSampleRate
// Module 12930
import _mod12890 from "module_12890" /* 12890 */;
import _mod12918 from "module_12918" /* 12918 */;
require = arg1;
const dependencyMap = arg6;
export const parseSampleRate = function parseSampleRate(flag) {
if (typeof flag === "boolean") {
const _Number = Number;
return Number(flag);
} else {
let parsed = flag;
if (typeof flag === "string") {
const _parseFloat = parseFloat;
parsed = parseFloat(flag);
}
if (typeof parsed === "number") {
const _isNaN = isNaN;
if (!isNaN(parsed)) {
if (parsed >= 0) {
if (parsed <= 1) {
return parsed;
}
}
}
}
if (_mod12918.DEBUG_BUILD) {
const logger = _mod12890.logger;
const _JSON = JSON;
const json = JSON.stringify(flag);
const _JSON2 = JSON;
const _HermesInternal = HermesInternal;
logger.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got " + json + " of type " + JSON.stringify(typeof flag) + ".");
}
}
};