33 lines
888 B
JavaScript
33 lines
888 B
JavaScript
// Metro module 1015 (f1016).
|
|
import { severityLevelFromString } from "./Module817";
|
|
export const DEFAULT_BREADCRUMB_LEVEL = "info";
|
|
export function breadcrumbFromObject(a0) {
|
|
const r3 = {};
|
|
if (typeof a0.type === "string") {
|
|
r3.type = a0.type;
|
|
}
|
|
if (typeof a0.level === "string") {
|
|
r3.level = severityLevelFromString(a0.level);
|
|
}
|
|
if (typeof a0.event_id === "string") {
|
|
r3.event_id = a0.event_id;
|
|
}
|
|
if (typeof a0.category === "string") {
|
|
r3.category = a0.category;
|
|
}
|
|
if (typeof a0.message === "string") {
|
|
r3.message = a0.message;
|
|
}
|
|
const data = a0.data;
|
|
if (typeof data === "object" ? a0.data !== null : typeof data === "object") {
|
|
r3.data = a0.data;
|
|
}
|
|
if (typeof a0.timestamp === "string") {
|
|
const timestamp = Date.parse(a0.timestamp) / 1000;
|
|
if (!isNaN(timestamp)) {
|
|
r3.timestamp = timestamp;
|
|
}
|
|
}
|
|
return r3;
|
|
}
|