- Propagate collapse of indexed nodes
- Further internal optimizations.
- Small optimizations.
- Added
modifyValue
which takes a default value to invokef
with if no value exists. Thanks @dashed. - Added
isMap
function to check if a value is a map.
- Getting map size is now constant time.
- Fixed edge case in remove when collapsing an ArrayNode.
hash
will attempt to usetoString
to convert values.- Return same map for many noop mutations.
- Performance tuning.
- Fixed
forEach
.
Focusing on API compatibility with ES6 Map
when possible.
- Lazily iterated over maps with
for (let [key, value] of map) { ... }
. - Added
entries
which returns a Javascript iterators to key value pairs.pairs
which did the same but built an array has been removed.
keys
andvalues
both now return Javascript iterators instead of arrays to match theMap
API.- Use
Array.from
if you really need get an array.
- Use
- Swapped the order of
hamt.set
back tohamt.set(key, value, map)
. Sorry :( - Added
.size
property to maps. - Added
hamt.forEach(f, map)
andmap.forEach(f)
where f is invoked with(value, key, map)
- Perf improvements.
- Restored
*hash
variants of functions that take a custom hash and key. - Added
isEmpty
to check is a map contains any elements. - Fixed an issue where lookups of undefined values on an array node would fail.
- Fixed
count
not working on array nodes properly.
- Rewrite in ES6.
- Combined node and amd packages.
- Both now live in the top level
hamt.js
and are generated fromlib/hamt.js
.
- Both now live in the top level
- Added chaining interface.
hamt.empty.set('a', 1).set('b', 3)...
hamt.get
returns undefined instead ofnull
if lookup fails.- Switched argument order on
hamt.modify
andhamt.set
to better support binding.- Chain versions of these method have old argument order.
- Removed
*Hash
functions since these expose too many implementation details and can easily produce undesirable behavior if not used carefully. - Changed
fold
to callf
with(accumulated, value, key)
instead of(accumulated, {value, key})
. - Aliased
map.delete
tomap.remove
. - Performance improvements and internal cleanup.
- Inline array update operations for better performances as suggested by @MichaelOstermann.
- Fixed collision nodes on unexpanded branch not being expanded on insertions further down branch. Thanks raymond-w-ko for reporting this and providing test data.
- Fix updates to collision list inserting value instead of Leaf nodes instead of into collision list.
- Reverting
fold
to fix performance degradation.
- Better
collision
update.
- Performance improvement from recompiled with Khepri V0.23.0 for inlining.
- Stop iteration earlier on
expand
- Create fewer temp arrays for
IndexNode
alter.
- Better collapsing of index nodes.
- ~1.2x performance boost overall.
- Now faster than hashtrie.
- ~15x boost to folds.
- Slightly faster gets and updates.
- Feature complete with hashtrie V0.2.0
- Initial release.