2
0

🐛 (webhook) Fix variable list parsing in custom body

Closes #687
This commit is contained in:
Baptiste Arnaud
2023-08-18 15:57:52 +02:00
parent a4f7f8fae7
commit ed77f5d124
8 changed files with 36 additions and 25 deletions

View File

@@ -0,0 +1,12 @@
import { isNotDefined } from './utils'
export const safeStringify = (val: unknown): string | null => {
if (isNotDefined(val)) return null
if (typeof val === 'string') return val
try {
return JSON.stringify(val)
} catch {
console.warn('Failed to safely stringify variable value', val)
return null
}
}