Home / Function/ matched() — tailwindcss Function Reference

matched() — tailwindcss Function Reference

Architecture documentation for the matched() function in dir.rs from the tailwindcss codebase.

Function rust RustCore FileScanner calls 2 called by 20

Entity Profile

Dependency Diagram

graph TD
  3d475977_d06e_4912_978d_07df5c71fed8["matched()"]
  7762aff3_b0a0_d9d9_69cc_7a869659f9cf["matched_dir_entry()"]
  7762aff3_b0a0_d9d9_69cc_7a869659f9cf -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  ac8fac4b_5baf_500a_e391_2a9d3774f354["matched_ignore()"]
  ac8fac4b_5baf_500a_e391_2a9d3774f354 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  c94787ee_7482_f446_eb6f_762e581305a0["explicit_ignore()"]
  c94787ee_7482_f446_eb6f_762e581305a0 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  17cdd51d_ca35_8a64_6dc8_9c6e0455e172["git_exclude()"]
  17cdd51d_ca35_8a64_6dc8_9c6e0455e172 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  fbdeb509_eba4_bae9_2ce8_5c766d404493["gitignore()"]
  fbdeb509_eba4_bae9_2ce8_5c766d404493 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  79e3c754_8474_a963_29a3_90d4c7ba1ae6["gitignore_with_jj()"]
  79e3c754_8474_a963_29a3_90d4c7ba1ae6 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  34932f21_88af_6440_c66c_353d5f8f5d5f["gitignore_no_git()"]
  34932f21_88af_6440_c66c_353d5f8f5d5f -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  0acf0b75_0130_a3a0_05a9_f8eb96b43574["gitignore_allowed_no_git()"]
  0acf0b75_0130_a3a0_05a9_f8eb96b43574 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  d58907e3_e69c_781c_552a_4b682691e0de["ignore()"]
  d58907e3_e69c_781c_552a_4b682691e0de -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  7c8bc7c4_7dd0_d829_9332_58553c511460["custom_ignore()"]
  7c8bc7c4_7dd0_d829_9332_58553c511460 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  19d156d4_7c5c_d5ed_6f56_d112749db9a1["custom_ignore_over_ignore()"]
  19d156d4_7c5c_d5ed_6f56_d112749db9a1 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  f0c99ae8_fcd9_3c14_092d_773616d8e5ad["custom_ignore_precedence()"]
  f0c99ae8_fcd9_3c14_092d_773616d8e5ad -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  ef4ea465_671d_5033_3bef_d011f47b964b["ignore_over_gitignore()"]
  ef4ea465_671d_5033_3bef_d011f47b964b -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  a5a4c460_4ba4_6dd3_9b89_f7d9ae34fbb4["exclude_lowest()"]
  a5a4c460_4ba4_6dd3_9b89_f7d9ae34fbb4 -->|calls| 3d475977_d06e_4912_978d_07df5c71fed8
  style 3d475977_d06e_4912_978d_07df5c71fed8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/dir.rs lines 365–404

    fn matched<'a, P: AsRef<Path>>(&'a self, path: P, is_dir: bool) -> Match<IgnoreMatch<'a>> {
        // We need to be careful with our path. If it has a leading ./, then
        // strip it because it causes nothing but trouble.
        let mut path = path.as_ref();
        if let Some(p) = strip_prefix("./", path) {
            path = p;
        }
        // Match against the override patterns. If an override matches
        // regardless of whether it's whitelist/ignore, then we quit and
        // return that result immediately. Overrides have the highest
        // precedence.
        if !self.0.overrides.is_empty() {
            let mat = self
                .0
                .overrides
                .matched(path, is_dir)
                .map(IgnoreMatch::overrides);
            if !mat.is_none() {
                return mat;
            }
        }
        let mut whitelisted = Match::None;
        if self.has_any_ignore_rules() {
            let mat = self.matched_ignore(path, is_dir);
            if mat.is_ignore() {
                return mat;
            } else if mat.is_whitelist() {
                whitelisted = mat;
            }
        }
        if !self.0.types.is_empty() {
            let mat = self.0.types.matched(path, is_dir).map(IgnoreMatch::types);
            if mat.is_ignore() {
                return mat;
            } else if mat.is_whitelist() {
                whitelisted = mat;
            }
        }
        whitelisted
    }

Domain

Subdomains

Frequently Asked Questions

What does matched() do?
matched() is a function in the tailwindcss codebase.
What does matched() call?
matched() calls 2 function(s): has_any_ignore_rules, matched_ignore.
What calls matched()?
matched() is called by 20 function(s): absolute_parent, absolute_parent_anchored, custom_ignore, custom_ignore_over_ignore, custom_ignore_precedence, errored_partial, errored_partial_and_ignore, exclude_lowest, and 12 more.

Analyze Your Own Codebase

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

Try Supermodel Free