MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getIsTrackPayload

Function getIsTrackPayload

apps/api/src/hooks/duplicate.hook.ts:35–55  ·  view source on GitHub ↗
(
  req: FastifyRequest<{
    Body: ITrackHandlerPayload | DeprecatedPostEventPayload;
  }>
)

Source from the content-addressed store, hash-verified

33}
34
35function getIsTrackPayload(
36 req: FastifyRequest<{
37 Body: ITrackHandlerPayload | DeprecatedPostEventPayload;
38 }>
39): req is FastifyRequest<{
40 Body: ITrackHandlerPayload;
41}> {
42 if (req.method !== 'POST') {
43 return false;
44 }
45
46 if (!req.body) {
47 return false;
48 }
49
50 if (typeof req.body !== 'object' || Array.isArray(req.body)) {
51 return false;
52 }
53
54 return 'type' in req.body;
55}

Callers 1

duplicateHookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected