Skip to content

v2.1.0

Latest

Choose a tag to compare

@hexsprite hexsprite released this 04 Oct 04:29
08f5cb4

2.1.0 (2026-10-04)

Features

  • add IntervalTree.fromJSON for exact serialize round trips (bfe9bbe)
  • export ArrayIntervalCollection as reference implementation (c4ccdf6)
  • widen IntervalCollection to the full API (54cf430)

Bug Fixes

  • add exports map so require() resolves the cjs build (8619f02)
  • align ArrayIntervalCollection hash and constructor with IntervalTree (d72a67b)
  • correct chop assertion message (05a2fd3)
  • default invariant checks off and read flag at runtime (ccef5d9)
  • guard searchByLengthStartingAt against non-positive minLength (e7e6639)
  • keep same-start intervals sorted by end so equals/first/last are order-independent (29d5cad)
  • make empty chop ranges a no-op and validate chopAll ranges up front (a81addd)
  • make verify() read-only and check every invariant (fe229e1)
  • require a gap between intervals in a clean tree (53ab6ce)
  • return the largest-end interval from last() and document canonical order (b7ae950)
  • sort searchByLengthStartingAt results after clipping to startingAt (686140c)
  • stop chopAll from mutating the caller's ranges (5875f5d)
  • verify strict ordering of left child (a927b23)

Performance Improvements

  • copy augmentation fields in Node.clone instead of recomputing (6a06086)
  • early-exit contains() and overlaps() (802dd09)
  • faster add, remove, chop, chopAll, and removeEnveloped (5–12% in the bundled benchmarks): the tree core now tracks its own size and reports insert/remove results without module-level state (03c9d74)