-
-
Notifications
You must be signed in to change notification settings - Fork 0
Release notes
A focused follow-up to 2.4.0, all internal to the meta-utils module — the data-structure API is unchanged:
-
Descriptor factories fixed —
fromGetter(),fromSetter(), andfromAccessors()crashed with aReferenceErrorwhen called without an explicit base descriptor: the parameter shadowed thedefaultDescriptorconstant, so the default initializer read its own binding inside the temporal dead zone. They now default todefaultDescriptoras intended, matchmeta-toolkit's canonical parameter shape, and are covered by tests. -
Iterator helpers modernized (synced with
meta-toolkit) —mapIterator()andfilterIterator()accept bare iterators as well as iterables and return a lazy, single-use iterable iterator that forwardsreturn()to the source, so an early exit (e.g.breakinfor...of) closes the source iterator. They delegate to nativeIterator.prototype.map()/filter()when available. Behavior change: previously they returned a re-iterable wrapper — to iterate a mapped/filtered result more than once, materialize it withArray.from()first.
The largest release since 2.0 — ten new data structures, all zero-dependency .js + .d.ts pairs:
-
SkipList — probabilistic ordered container: expected O(log n) search/insert/remove,
floor/ceil, bounded range iteration,popFrontfor priority-queue duty; injectablerandomfor deterministic tests. -
IndexedHeap — binary min-heap with intrusive element indices: O(1)
has/findIndex, O(log n)update/removeby element (decrease-key with no scans). - PairingHeap — the merge heap with O(1) meld and decrease-key by node handle.
-
Deque — double-ended queue adapter with Array-parity aliases and Python-style
rotate(n). -
RingBuffer — array-backed deque on a circular buffer: ~5× faster than Array/list-deque on steady-state churn, O(1)
at(index), bounded keep-last-N mode. -
UnrolledList — chunked value list for bulk pipelines: ~2.6× faster than
ValueListon fill+iterate+drain. - TimerWheel — hashed timing wheel: O(1) schedule/cancel/reschedule, logical tick-driven time.
- FreeList — intrusive object pool for recycling list nodes (honestly documented: a GC-pressure tool, not a throughput tool).
-
CacheSLRU and CacheClock — scan-resistant segmented LRU and CLOCK (second chance) policies joining the cache family, which also gained
peek,evict, andsetCapacityacross all policies.
Existing structures got substantial upgrades: CacheLFU was rewritten to the exact O(1) frequency-bucket algorithm (fixing an inverted-eviction bug); SplayTree gained subtree-size augmentation — order statistics at/indexOf, has/floor/ceil, bounded range iteration, and an amortized O(log n) splitMaxTree (was O(n)) — plus a documented splay contract; lists gained stable sorting (natural merge sort, O(n) on nearly-sorted input, 5.6–35× faster than the old sort) with insertSorted/mergeSorted ordered operations; the node-based heaps went iterative (no call-stack overflow on deep spines; the skew merge is ~1.4× faster, making SkewHeap the fastest node-based heap on the raw cycle); heaps expose size, adapters accept list instances or classes and gained from() builders; caches accept options objects.
New documentation: the Choosing a data structure guide, the API conventions page (naming rules and their documented exceptions), the Backgrounder, and wiki search. Tests grew to 345 files / 6,786 assertions across Node, Bun, and Deno. Updated dev dependencies.
- 2.3.2 Updated dev dependencies.
- 2.3.1 Bugfixes. Improved TS typing tests. Updated docs. Updated dev dependencies.
- 2.3.0 Added TypeScript declarations for all modules. Added JSDoc. Removed CJS build. Bugfixes. Added missing methods.
- 2.2.6 Updated dev dependencies.
- 2.2.5 Updated dev dependencies.
- 2.2.4 Updated dev dependencies.
- 2.2.3 Updated dev dependencies.
- 2.2.2 Updated dev dependencies.
- 2.2.1 Technical release: updated deps, added more tests.
- 2.2.0 Added leftist and skew heaps.
- 2.1.1 Allowed functions to be used as nodes. Updated deps.
- 2.1.0 Added splay tree. Updated deps.
- 2.0.0 New major release.
- 1.0.1 Fixed exports. Added more methods to
MinHeap. - 1.0.0 Initial release.
Concepts
DLL: doubly linked lists
SLL: singly linked lists
Unrolled list
List utilities
Caches
Heaps
Queue, Stack, and Deque
Trees
Skip list
Timer wheel
Free list