Home / Function/ matched() — tailwindcss Function Reference

matched() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  22918057_f3e8_c59b_6372_a4375af46acd["matched()"]
  c75c70e7_dc06_a5cc_0142_21cef4f81c82["matched_dir_entry()"]
  c75c70e7_dc06_a5cc_0142_21cef4f81c82 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  bc27902d_86a1_5533_1198_836c4e5c562b["matched_ignore()"]
  bc27902d_86a1_5533_1198_836c4e5c562b -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  f1f554cd_2dca_9460_e576_64c5b09c9268["explicit_ignore()"]
  f1f554cd_2dca_9460_e576_64c5b09c9268 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  81e66cc6_ada0_e6b7_1128_6229de35f490["git_exclude()"]
  81e66cc6_ada0_e6b7_1128_6229de35f490 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  c01c7bf5_556b_f530_3f8a_e6f70be3451e["gitignore()"]
  c01c7bf5_556b_f530_3f8a_e6f70be3451e -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  6743beeb_06b1_7340_4d85_b02bb0ef3614["gitignore_with_jj()"]
  6743beeb_06b1_7340_4d85_b02bb0ef3614 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  88c25882_f68d_1483_23de_7d81e4bd9db5["gitignore_no_git()"]
  88c25882_f68d_1483_23de_7d81e4bd9db5 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  43491051_b333_52ea_3e11_4cf4d7e1c3f6["gitignore_allowed_no_git()"]
  43491051_b333_52ea_3e11_4cf4d7e1c3f6 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  e907515d_40f5_492d_a3eb_eef08a9cb3db["ignore()"]
  e907515d_40f5_492d_a3eb_eef08a9cb3db -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  4f1a1f48_0c56_e213_fafe_bedc115b544e["custom_ignore()"]
  4f1a1f48_0c56_e213_fafe_bedc115b544e -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  9d928b06_6c8a_7d84_6194_bf0101a9dd0d["custom_ignore_over_ignore()"]
  9d928b06_6c8a_7d84_6194_bf0101a9dd0d -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  900c5211_b9d0_6817_aeeb_55546cd3e19a["custom_ignore_precedence()"]
  900c5211_b9d0_6817_aeeb_55546cd3e19a -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  41292f9f_cf96_4d7a_2901_4c472fd9feb4["ignore_over_gitignore()"]
  41292f9f_cf96_4d7a_2901_4c472fd9feb4 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  1973d0a7_029f_1d4e_61c3_cd58107fa9c6["exclude_lowest()"]
  1973d0a7_029f_1d4e_61c3_cd58107fa9c6 -->|calls| 22918057_f3e8_c59b_6372_a4375af46acd
  style 22918057_f3e8_c59b_6372_a4375af46acd 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
    }

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