decord/source/__polyfill/12xxx/module_12972.js
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

42 lines
1.2 KiB
JavaScript

// Module ID: 12972
// Function ID: 12973
// Dependencies: [12960, 12932]
// Exports: parseSampleRate
// Module 12972
import _mod12932 from "module_12932" /* 12932 */;
import _mod12960 from "module_12960" /* 12960 */;
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 (_mod12960.DEBUG_BUILD) {
const logger = _mod12932.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) + ".");
}
}
};