matched() — tailwindcss Function Reference
Architecture documentation for the matched() function in dir.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 610d87f4_d454_8c17_656c_4616db7298c0["matched()"] a558c8e1_3e7c_59d2_b113_bacec65ba188["dir.rs"] 610d87f4_d454_8c17_656c_4616db7298c0 -->|defined in| a558c8e1_3e7c_59d2_b113_bacec65ba188 a1122870_2d58_e007_abc5_264a624d29f1["matched_dir_entry()"] a1122870_2d58_e007_abc5_264a624d29f1 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 fb038a5b_bec2_4158_52f9_87530af3ef38["matched_ignore()"] fb038a5b_bec2_4158_52f9_87530af3ef38 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 543e8e56_62fc_aedb_1322_634e822611af["explicit_ignore()"] 543e8e56_62fc_aedb_1322_634e822611af -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 be98651c_88d7_d30d_10a1_3927cda9ad23["git_exclude()"] be98651c_88d7_d30d_10a1_3927cda9ad23 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 81e57ff4_1a02_72db_1925_89f33cb05e09["gitignore()"] 81e57ff4_1a02_72db_1925_89f33cb05e09 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 a5b02978_8dde_fde5_0113_61a5d42267f5["gitignore_with_jj()"] a5b02978_8dde_fde5_0113_61a5d42267f5 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 42c35850_8d1a_750a_3d03_03c97c60cd05["gitignore_no_git()"] 42c35850_8d1a_750a_3d03_03c97c60cd05 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 6c50d8cb_3fe9_ad84_460b_101551757406["gitignore_allowed_no_git()"] 6c50d8cb_3fe9_ad84_460b_101551757406 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 6fb37daf_367f_5f63_8d90_7bdef42a1dcf["ignore()"] 6fb37daf_367f_5f63_8d90_7bdef42a1dcf -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 4e744744_5061_ebe6_cdd2_25a38709bad1["custom_ignore()"] 4e744744_5061_ebe6_cdd2_25a38709bad1 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 6fc51294_5187_4c70_1acc_9ff8488e6881["custom_ignore_over_ignore()"] 6fc51294_5187_4c70_1acc_9ff8488e6881 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 157735d2_2986_738b_0de4_d9ba9ee02849["custom_ignore_precedence()"] 157735d2_2986_738b_0de4_d9ba9ee02849 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 10513e75_5211_7066_c6d6_b93dcee8fc41["ignore_over_gitignore()"] 10513e75_5211_7066_c6d6_b93dcee8fc41 -->|calls| 610d87f4_d454_8c17_656c_4616db7298c0 style 610d87f4_d454_8c17_656c_4616db7298c0 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
Defined In
Called By
- absolute_parent()
- absolute_parent_anchored()
- custom_ignore()
- custom_ignore_over_ignore()
- custom_ignore_precedence()
- errored_partial()
- errored_partial_and_ignore()
- exclude_lowest()
- explicit_ignore()
- git_exclude()
- git_info_exclude_in_linked_worktree()
- gitignore()
- gitignore_allowed_no_git()
- gitignore_no_git()
- gitignore_with_jj()
- ignore()
- ignore_over_gitignore()
- matched_dir_entry()
- matched_ignore()
- stops_at_git_dir()
Source
Frequently Asked Questions
What does matched() do?
matched() is a function in the tailwindcss codebase, defined in crates/ignore/src/dir.rs.
Where is matched() defined?
matched() is defined in crates/ignore/src/dir.rs at line 365.
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