MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / parseBody

Function parseBody

integrations/github/src/sources.ts:212–222  ·  view source on GitHub ↗
(body: any)

Source from the content-addressed store, hash-verified

210// Parses the body of a request
211// If it's a Buffer, it will be parsed as JSON
212function parseBody(body: any) {
213 if (Buffer.isBuffer(body)) {
214 return safeJsonParse(body.toString());
215 }
216
217 if (typeof body === "string") {
218 return safeJsonParse(body);
219 }
220
221 return body;
222}
223
224async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger) {
225 logger.debug("[inside github integration] Handling github repo event");

Callers 1

webhookHandlerFunction · 0.85

Calls 2

safeJsonParseFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…