(body: any)
| 5 | |
| 6 | // If it's a Buffer, it will be parsed as JSON |
| 7 | export function safeParseBody(body: any) { |
| 8 | if (Buffer.isBuffer(body)) { |
| 9 | return safeJsonParse(body.toString()); |
| 10 | } |
| 11 | |
| 12 | if (typeof body === "string") { |
| 13 | return safeJsonParse(body); |
| 14 | } |
| 15 | |
| 16 | return body; |
| 17 | } |
| 18 | |
| 19 | export const registerJobNamespace = (webhookKey: string) => `job:webhook.register.${webhookKey}`; |
no test coverage detected
searching dependent graphs…