Maybe it's not that important... but it seems that these two functions do exactly the same thing.
The only difference is that getAncestor is a type guard as well.
What should be done? Options
- Modify the return type of
$findMatchingParent so that it is also a type guard, and make one function call the other, but leave both to avoid a breaking change.
- Delete one of the two functions. In case of removing
getAncestor make $findMatchingParent a type guard.