update: comment

This commit is contained in:
Pooja Belaramani 2024-12-27 16:10:57 +05:30
parent b6b4b7362f
commit 767db75730

View File

@ -366,12 +366,10 @@ const parseDataFromResponse = (response, disableParsingResponseJson = false) =>
// Filter out ZWNBSP character
// https://gist.github.com/antic183/619f42b559b78028d1fe9e7ae8a1352d
// a quoated string is also a vaild json but we want to show it as a quoated string only (parsing removes the quoates)
// If the response is a string and starts and ends with double quotes, it's a stringified JSON and should not be parsed
data = data.replace(/^\uFEFF/, '');
if ( !disableParsingResponseJson && ! (typeof data === 'string' && data.startsWith("\"") && data.endsWith("\""))) {
data = JSON.parse(data);
} {
data = JSON.parse(data);
}
} catch {
console.log('Failed to parse response data as JSON');