Feature request: Flatten __proto__
Ghost---Shadow opened this issue · comments
Souradeep Nanda commented
const a = {
__proto__: {
fun: () => 'foo',
__proto__: {
fun: () => 'bar',
},
},
};
Should flatten to
const a = {
'__proto__.fun': () => 'foo',
'__proto__.__proto__.fun': () => 'bar',
};
We can have a flag like extraKeys: ['__proto__']
Jérémy Lal commented
A very good way to shoot yourself in the foot
Souradeep Nanda commented
Jon Koops commented
I don't see a good reason to implement this, these are reserved parts of an object and should not be considered serializable. For example JSON.stringify()
also ignores these values.