feat: add customizable prettyString with renderer and connector styles (#36) (#43)

This commit is contained in:
2026-06-07 22:38:30 +02:00
committed by GitHub
parent 30b2709803
commit 6758a68522
4 changed files with 238 additions and 0 deletions

View File

@@ -11,6 +11,10 @@ All notable changes to this project are documented here. The format is based on
`moveChild`, `addChildren`, and `sortChildren`.
- Tree query extensions: `lowestCommonAncestor`, `distance`, `pathBetween`, and `contains` for
finding common ancestors, edge distances, the path between two nodes, and value membership.
- Customizable `prettyString(connectors, render)` extension: choose connector glyphs via
`TreeConnectors` (`Default` box-drawing or `Ascii`) and supply a per-node renderer that receives
the value, its depth and whether it is its parent's last child. The all-defaults call is
byte-identical to the existing no-arg `prettyString()`.
### Changed
- Rewrote the README for clarity: one consistent example tree, task-oriented sections