cbor-x
cbor-x copied to clipboard
Bug in value sharing extension, discards revived state by Object.assign
https://github.com/kriszyp/cbor-x/blob/0b5e8807622619c6a7a062f7e771478ecfd52f83/decode.js#L1015-L1017
After an extension's decode returns an object with it's prototype set or a class instance, that state is discarded due to the Object.assign that occurs just after.
So e.g. [ ClassInstance, ClassInstance ] becomes [ Object, Object ]
Maybe the object should be re-read and then passed to decode a second time to revive a 'new' object in this case instead?