Closed KubqoA closed 2 years ago
I agree this is interesting. I'll get to doing a full review in a day or two. In the meantime, can you add yourself to the contributors in the packages/cbor/package.json
file, please?
Thanks! Added myself to the contributors and also added a few more tests.
Hi, sorry to bother you, just wanted to ask if you had any time to look at the changes? Thanks :)
Made the changes, also found some eslint
errors in my code, so fixed those as well. Hope everything is good now :),
oh and thanks for your time to review this :+1:
This PR adds a Decoder option to prevent the decoder from parsing maps with duplicate keys, which is one of the valid ways to handle duplicate map keys as described in the CBOR RFC.
Citing from CBOR RFC 8949: 3.1 Major types, Major type 5
5.6. Specifying Keys for Maps
I believe this package chose the third option, although not documented, but in my use of CBOR I found it quite useful to have an option to not accept maps with duplicate keys. I decided to implement it via a Decoder option as to not break backwards compatibility.