1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix: parse empty string in res to empty {}

This commit is contained in:
Saad Jutt
2022-02-22 17:09:47 +05:00
parent 872e73b5f0
commit d3c91e143a

View File

@@ -12,6 +12,8 @@ export const getValidJson = (str: string | object): object => {
if (typeof str === 'object') return str
if (str === '') return {}
return JSON.parse(str)
} catch (e) {
if (e instanceof JsonParseArrayError) throw e