kriszyp / msgpackr

Ultra-fast MessagePack implementation with extension for record and structural cloning / msgpack.org[JavaScript/NodeJS]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade from other msgpack libs - map and set

gonenduk-dy opened this issue · comments

Hi,

Since msgpack is a well defined standard, replacing a msgpack lib with another should be an easy task - as long as the result of pack and unpack produce the same results. Sometimes, a project is made of several different stacks and languages - each with its own msgpack lib, but as long as pack and unpack produce the same results - the move to a new lib is transparent.
With msgpackr we can this by disabling some great features ot make it faster and more compact.
However, when dealing with types that are not defined in the standard, like map or set, each library has its own way of dealing with them. In msgpackr we can choose between keeping the original type or translating them to object/array.
In some older libs, like msgpack-node - which was the most popular 4 years ago, the lib ignores those types and simply replaces them with an empty object.

Can we have a flag to do the same and replace map and set with an empty object - so we will be able to replace msgpack-node (or any other lib which does the same) with this lib?

Thanks!

hey @kriszyp
The commit looks good!
When can we have it published to npm?

Ok, I published this v1.9.0.