mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
fix: string json response error
This commit is contained in:
parent
b9ec0acab4
commit
aea25842ce
@ -27,7 +27,11 @@ const formatResponse = (data, mode, filter) => {
|
|||||||
let isValidJSON = false;
|
let isValidJSON = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (typeof data === 'string') {
|
||||||
|
isValidJSON = true;
|
||||||
|
} else {
|
||||||
isValidJSON = typeof JSON.parse(JSON.stringify(data)) === 'object';
|
isValidJSON = typeof JSON.parse(JSON.stringify(data)) === 'object';
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error parsing JSON: ', error.message);
|
console.log('Error parsing JSON: ', error.message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user