function repErr(key, value) {
let error = {};
Object.getOwnPropertyNames(value).forEach(function (key) {
error[key] = value[key];
});
return error;
}
When I call JSON.stringify(err, repErr) i see an error too much recursion in console.
I have firefox 68 and I called debugger at each iteration and I saw that on the fourth pass it starts to add something like this to the object:
{
0: 'h',
1: 't',
2: 't',
3: 'p',
// and etc
}
What is the reason and can it be fixed?