decord/source/__polyfill/12xxx/module_12988.js
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

42 lines
1.2 KiB
JavaScript

// Module ID: 12988
// Function ID: 12989
// Dependencies: [12976, 12948]
// Exports: parseSampleRate
// Module 12988
import _mod12948 from "module_12948" /* 12948 */;
import _mod12976 from "module_12976" /* 12976 */;
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 (_mod12976.DEBUG_BUILD) {
const logger = _mod12948.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) + ".");
}
}
};