Skip to main content

repository_path_within

Function repository_path_within 

Source
pub fn repository_path_within(candidate: &str, parent: &str) -> bool
Expand description

What: Whether a repository path equals or descends from another repository path. Why: Comparison is by whole components, so cache2 is not inside cache.

In TS you’d write (pseudocode):

(candidate === parent) || candidate.startsWith(`${parent}/`)