MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / normalize

Function normalize

packages/deno/test/normalize.ts:21–31  ·  view source on GitHub ↗
(event: EventOrSession | undefined)

Source from the content-addressed store, hash-verified

19}
20
21export function normalize(event: EventOrSession | undefined): EventOrSession | undefined {
22 if (event === undefined) {
23 return undefined;
24 }
25
26 if (eventIsSession(event)) {
27 return normalizeSession(event as Session);
28 } else {
29 return normalizeEvent(event as Event);
30 }
31}
32
33export function eventIsSession(data: EventOrSession): boolean {
34 return !!(data as Session)?.sid;

Callers 2

getNormalizedEventFunction · 0.70
constructorMethod · 0.50

Calls 3

eventIsSessionFunction · 0.85
normalizeSessionFunction · 0.85
normalizeEventFunction · 0.70

Tested by

no test coverage detected