mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-10 17:04:36 +00:00
fix: invalid json checking
This commit is contained in:
14773
package-lock.json
generated
14773
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
export const isValidJson = (str: string) => {
|
||||
try {
|
||||
str = typeof str !== 'string' ? JSON.stringify(str) : str
|
||||
JSON.parse(str)
|
||||
} catch (e) {
|
||||
throw new Error('Invalid JSON response.')
|
||||
|
||||
Reference in New Issue
Block a user