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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user