sniff-cli 0.1.0

An exhaustive LLM-backed slop finder for codebases
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub fn normalize_path(p: &str) -> String {
    let mut normalized = p.replace('\\', "/");
    if normalized.starts_with("//?/") || normalized.starts_with("\\\\?\\") {
        normalized = normalized[4..].to_string();
    }
    if normalized.starts_with("./") {
        normalized = normalized[2..].to_string();
    }
    while normalized.contains("/./") {
        normalized = normalized.replace("/./", "/");
    }
    if normalized.ends_with("/.") {
        normalized.truncate(normalized.len().saturating_sub(2));
    }
    normalized
}