mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
adding quotes in text response
This commit is contained in:
@@ -27,14 +27,13 @@ const formatResponse = (data, mode, filter) => {
|
||||
let isValidJSON = false;
|
||||
|
||||
try {
|
||||
isValidJSON =
|
||||
typeof JSON.parse(JSON.stringify(data)) === 'object' || typeof JSON.parse(JSON.stringify(data)) === 'string';
|
||||
isValidJSON = typeof JSON.parse(JSON.stringify(data)) === 'object'
|
||||
} catch (error) {
|
||||
console.log('Error parsing JSON: ', error.message);
|
||||
}
|
||||
|
||||
if (!isValidJSON && typeof data === 'string') {
|
||||
return data;
|
||||
return JSON.stringify(data);
|
||||
}
|
||||
|
||||
if (filter) {
|
||||
|
||||
Reference in New Issue
Block a user