/**
* Function to escape from special characters in the data
* @param textvalue data from PPA account
* @returns {*} data after replacing special characters
*/
const escapeSpecialChar = (textvalue) => {
try {
if(textvalue){
textvalue = textvalue.replaceAll(/&/g, ‘&’);
textvalue = textvalue.replaceAll(/”/g, ‘"’);
textvalue = textvalue.replaceAll(/’/g, ‘'’);
textvalue = textvalue.replace(/</g, ‘<’);
textvalue = textvalue.replace(/>/g, ‘>’);
}
return textvalue;
} catch (e) {
log.error({
title: e.name,
details: e
});
return textvalue;
}
}