pub fn normalize_exclude_pattern(root: &Path, path: &Path) -> StringExpand description
Normalize an exclude path into a deterministic pattern.
Rules:
- if
pathis absolute and underroot, strip therootprefix - convert backslashes to
/ - strip one leading
./
ยงExamples
use std::path::Path;
use tokmd_exclude::normalize_exclude_pattern;
let root = Path::new("/project");
let relative = Path::new("./out/bundle.js");
assert_eq!(normalize_exclude_pattern(root, relative), "out/bundle.js");