stringifyForLogs more usual case first
This commit is contained in:
parent
b531922459
commit
ee511d3762
@ -77,14 +77,14 @@ function setErrorHeader(err, statusCode, res) {
|
|||||||
*/
|
*/
|
||||||
function stringifyForLogs(object) {
|
function stringifyForLogs(object) {
|
||||||
Object.keys(object).map(key => {
|
Object.keys(object).map(key => {
|
||||||
if (typeof object[key] === 'object') {
|
if(typeof object[key] === 'string') {
|
||||||
|
object[key] = object[key].replace(/[^a-zA-Z0-9]/g, ' ');
|
||||||
|
} else if (typeof object[key] === 'object') {
|
||||||
stringifyForLogs(object[key]);
|
stringifyForLogs(object[key]);
|
||||||
} else if (object[key] instanceof Array) {
|
} else if (object[key] instanceof Array) {
|
||||||
for (let element of object[key]) {
|
for (let element of object[key]) {
|
||||||
stringifyForLogs(element);
|
stringifyForLogs(element);
|
||||||
}
|
}
|
||||||
} else if(typeof object[key] === 'string') {
|
|
||||||
object[key] = object[key].replace(/[^a-zA-Z0-9]/g, ' ');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user