Serializer also serializes properties in object prototype
Looks like a for loop is used for iterating the properties in the objects
for (let key in data) {
if (data[key] !== undefined) {
length++;
}
}
This also iterates the properties defined in prototypes which I don't think is an expected behaviour.
The current typescript version of msgpack is using Object.keys that does not returns those properties.
What do you think?
I'm not using prototypes in that area IIRC. So I don't have a strong opinion here. I think I've seen the JSON serializer in .NET also regarding inherited properties, which would roughly translate to the current behaviour regarding the prototype. But if most users agree that this change should be done, then I'm up for it. Maybe let's have a vote on this issue? (But the visitors volume here is generally rather low.)
One question might be whether this is a breaking change or merely a bugfix.