decord/source/__polyfill/12xxx/module_12968.js
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

55 lines
1.8 KiB
JavaScript

// Module ID: 12968
// Function ID: 12969
// Dependencies: [12931, 12954, 12926, 12941]
// Exports: setMeasurement, timedEventsToMeasurements
// Module 12968
import spanTimeInputToSeconds from "spanTimeInputToSeconds" /* 12931 */;
import _mod12941 from "module_12941" /* 12941 */;
import _mod12954 from "module_12954" /* 12954 */;
require = arg1;
const dependencyMap = arg6;
export const setMeasurement = function setMeasurement(arg0, arg1, arg2) {
let activeSpan = arg3;
if (arg3 === undefined) {
activeSpan = spanTimeInputToSeconds.getActiveSpan();
}
let rootSpan = activeSpan;
if (activeSpan) {
rootSpan = spanTimeInputToSeconds.getRootSpan(activeSpan);
}
if (rootSpan) {
if (_mod12954.DEBUG_BUILD) {
const logger = tmp9(12926).logger;
const _HermesInternal = HermesInternal;
logger.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
const obj2 = {};
obj2[_mod12941.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] = arg1;
obj2[_mod12941.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] = arg2;
rootSpan.addEvent(arg0, obj2);
}
};
export const timedEventsToMeasurements = function timedEventsToMeasurements(arr) {
if (arr) {
if (0 !== arr.length) {
let obj = {};
const item = arr.forEach((attributes) => {
const tmp = attributes.attributes || {};
const tmp2 = tmp[_mod12941.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[_mod12941.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];
let tmp4 = typeof tmp2 === "string";
if (typeof tmp2 === "string") {
tmp4 = typeof tmp3 === "number";
}
if (tmp4) {
obj = { value: tmp3, unit: tmp2 };
obj[attributes.name] = obj;
}
});
return obj;
}
}
};