mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-20 12:48:41 +01:00
fix: condition
This commit is contained in:
parent
236bc48d98
commit
582e8e5eac
@ -27,11 +27,8 @@ const formatResponse = (data, mode, filter) => {
|
|||||||
let isValidJSON = false;
|
let isValidJSON = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (typeof data === 'string') {
|
isValidJSON =
|
||||||
isValidJSON = true;
|
typeof JSON.parse(JSON.stringify(data)) === 'object' || typeof JSON.parse(JSON.stringify(data)) === 'string';
|
||||||
} else {
|
|
||||||
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