diff --git a/src/entities/var-dump/lib/normalize-var-dump-event.ts b/src/entities/var-dump/lib/normalize-var-dump-event.ts index e7365113..6b172770 100644 --- a/src/entities/var-dump/lib/normalize-var-dump-event.ts +++ b/src/entities/var-dump/lib/normalize-var-dump-event.ts @@ -2,16 +2,24 @@ import type { ServerEvent, NormalizedEvent } from "~/src/shared/types"; import { EVENT_TYPES } from "~/src/shared/types"; import type { VarDump } from "../types"; -export const normalizeVarDumpEvent = (event: ServerEvent): NormalizedEvent => ({ - id: event.uuid, - type: EVENT_TYPES.VAR_DUMP, - labels: [EVENT_TYPES.VAR_DUMP], - origin: { - file: event.payload.context.source.file, - name: event.payload.context.source.name, - line_number: event.payload.context.source.line, - }, - serverName: "", - date: event.timestamp ? new Date(event.timestamp * 1000) : null, - payload: event.payload -}) +export const normalizeVarDumpEvent = (event: ServerEvent): NormalizedEvent => { + const normalizedEvent: NormalizedEvent = { + id: event.uuid, + type: EVENT_TYPES.VAR_DUMP, + labels: [EVENT_TYPES.VAR_DUMP], + origin: { + file: event.payload.context.source.file, + name: event.payload.context.source.name, + line_number: event.payload.context.source.line, + }, + serverName: "", + date: event.timestamp ? new Date(event.timestamp * 1000) : null, + payload: event.payload + } + + if (event.payload?.payload?.label != null) { + normalizedEvent.labels.push(`label: ${event.payload.payload.label}`); + } + + return normalizedEvent; +} diff --git a/src/entities/var-dump/types.ts b/src/entities/var-dump/types.ts index a509c1b9..4f166f53 100644 --- a/src/entities/var-dump/types.ts +++ b/src/entities/var-dump/types.ts @@ -1,5 +1,6 @@ export interface VarDump { payload: { + label: string | null, type: string, value: string | number | boolean },