mavoweb / treecle

WIP. A toolbox for hierarchical JS objects.
https://treecle.mavo.io
MIT License
6 stars 0 forks source link

Function for getting arbitrary familial relationships #31

Open LeaVerou opened 5 months ago

LeaVerou commented 5 months ago

Currently we have methods for getting parents, children, ancestors (walkUp(), closest()), descendants (find(), walk()). While the use cases for other relationships are more niche, they do exist (e.g. in Mavo we have things like getCousin() because we need it for finding the same note across repetitions of its parent item).

We definitely don't want to add functions like getCousin()! But I do wonder if there is something more general that might make sense here.