MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / matches

Function matches

crates/opencode-util/src/util.rs:4–8  ·  view source on GitHub ↗
(pattern: &str, text: &str)

Source from the content-addressed store, hash-verified

2 use glob::Pattern;
3
4 pub fn matches(pattern: &str, text: &str) -> bool {
5 Pattern::new(pattern)
6 .map(|p| p.matches(text))
7 .unwrap_or(false)
8 }
9
10 pub fn matches_any(patterns: &[&str], text: &str) -> bool {
11 patterns.iter().any(|p| matches(p, text))

Callers 2

matches_anyFunction · 0.85
filterFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected