1.0.2 • Published 1 year ago

@dopt/mercator v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@dopt/mercator

A Map implementation that allows for objects as keys without key equality constraints. In practice this means

const map = new Mercator();
map.set([1,2], 'a');
map.get([1,2]);
> 'a'

whereas a standard Map would have the following behavior

const map = new Map();
map.set([1,2], 'a');
map.get([1,2]);
> undefined

Standard maps use a key equality SameValueZero algorithm. Mercator instead calls JSON.stringify on the key and uses it as the key for its underlying map.

Great for in memory data structures where the key is naturally a composite (like an array or an object).

1.0.2

1 year ago

1.0.1

1 year ago

0.0.1

1 year ago

1.0.0

1 year ago

0.0.0

1 year ago