@trigger.dev/integration-kit
Advanced tools
Comparing version 2.0.0-next.2 to 2.0.0-next.3
@@ -5,2 +5,4 @@ import fs from 'fs'; | ||
declare function safeParseBody(body: any): any; | ||
declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>; | ||
@@ -16,2 +18,2 @@ | ||
export { Prettify, fileFromString, omit, safeJsonParse, truncate }; | ||
export { Prettify, fileFromString, omit, safeJsonParse, safeParseBody, truncate }; |
@@ -37,2 +37,3 @@ "use strict"; | ||
safeJsonParse: () => safeJsonParse, | ||
safeParseBody: () => safeParseBody, | ||
truncate: () => truncate | ||
@@ -52,2 +53,14 @@ }); | ||
// src/webhooks.ts | ||
function safeParseBody(body) { | ||
if (Buffer.isBuffer(body)) { | ||
return safeJsonParse(body.toString()); | ||
} | ||
if (typeof body === "string") { | ||
return safeJsonParse(body); | ||
} | ||
return body; | ||
} | ||
__name(safeParseBody, "safeParseBody"); | ||
// src/omit.ts | ||
@@ -90,4 +103,5 @@ function omit(obj, keys) { | ||
safeJsonParse, | ||
safeParseBody, | ||
truncate | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@trigger.dev/integration-kit", | ||
"version": "2.0.0-next.2", | ||
"version": "2.0.0-next.3", | ||
"description": "Trigger.dev Integration Kit has helpers to make creating integrations easier", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19283
107