hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
356 stars 73 forks source link

empty maps parsed as objects, not maps #186

Closed janmazak closed 7 months ago

janmazak commented 8 months ago

It seems that CBOR a0 is parsed as an empty object, not a Map. Subsequent validations like data instanceof Map thus do not work. It would be more appropriate to parse it as new Map().

Wind4Greg commented 7 months ago

Also seeing this problem arise.

hildjj commented 7 months ago

I can add an option to always produce maps.

janmazak commented 7 months ago

That would be great. Thanks.

hildjj commented 7 months ago

Please review #189