as the menu loads all nodes anyways, you could also walk up the node tree to find the menu root :-)
if we find a generally useful semantics for splicePath i think it will make methods like this one more understandable, and is well testable for all the funny edge cases. though i would propose to make it work with absolute paths - the substr call in your example should give you `/main-menu/sub-item/item` as the menuRoot will not have a trainling slash hopefully.