Home / Function/ matched_path_or_any_parents() — tailwindcss Function Reference

matched_path_or_any_parents() — tailwindcss Function Reference

Architecture documentation for the matched_path_or_any_parents() function in gitignore.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  ca3cd87a_abf8_113a_8b00_c0db25a19976["matched_path_or_any_parents()"]
  714a3a15_03d5_1e35_b535_53da70bce8eb["gitignore.rs"]
  ca3cd87a_abf8_113a_8b00_c0db25a19976 -->|defined in| 714a3a15_03d5_1e35_b535_53da70bce8eb
  f30f6608_5b16_4482_3310_8c414d5a3ef4["is_empty()"]
  ca3cd87a_abf8_113a_8b00_c0db25a19976 -->|calls| f30f6608_5b16_4482_3310_8c414d5a3ef4
  2b8fe916_a84e_706b_18ef_0117dfba0273["strip()"]
  ca3cd87a_abf8_113a_8b00_c0db25a19976 -->|calls| 2b8fe916_a84e_706b_18ef_0117dfba0273
  fbe7cf76_6649_3b18_ee36_e9844d08d9a0["matched_stripped()"]
  ca3cd87a_abf8_113a_8b00_c0db25a19976 -->|calls| fbe7cf76_6649_3b18_ee36_e9844d08d9a0
  style ca3cd87a_abf8_113a_8b00_c0db25a19976 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/gitignore.rs lines 221–243

    pub fn matched_path_or_any_parents<P: AsRef<Path>>(
        &self,
        path: P,
        is_dir: bool,
    ) -> Match<&Glob> {
        if self.is_empty() {
            return Match::None;
        }
        let mut path = self.strip(path.as_ref());
        assert!(!path.has_root(), "path is expected to be under the root");

        match self.matched_stripped(path, is_dir) {
            Match::None => (), // walk up
            a_match => return a_match,
        }
        while let Some(parent) = path.parent() {
            match self.matched_stripped(parent, /* is_dir */ true) {
                Match::None => path = parent, // walk up
                a_match => return a_match,
            }
        }
        Match::None
    }

Domain

Subdomains

Frequently Asked Questions

What does matched_path_or_any_parents() do?
matched_path_or_any_parents() is a function in the tailwindcss codebase, defined in crates/ignore/src/gitignore.rs.
Where is matched_path_or_any_parents() defined?
matched_path_or_any_parents() is defined in crates/ignore/src/gitignore.rs at line 221.
What does matched_path_or_any_parents() call?
matched_path_or_any_parents() calls 3 function(s): is_empty, matched_stripped, strip.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free