Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
// Module ID: 12966
|
|
// Function ID: 12967
|
|
// Dependencies: [12954, 12926]
|
|
// Exports: parseSampleRate
|
|
|
|
// Module 12966
|
|
import _mod12926 from "module_12926" /* 12926 */;
|
|
import _mod12954 from "module_12954" /* 12954 */;
|
|
|
|
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 (_mod12954.DEBUG_BUILD) {
|
|
const logger = _mod12926.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) + ".");
|
|
}
|
|
}
|
|
};
|