def comps
import ezx@1.11.0.0/src/pkg/pkg.bend as Pkgimport Base
import ezx@1.11.0.0/src/pkg/path.bend as P
1224# how many components a checkout-relative directory has: none for the
1225# checkout's top
1226def comps(+dir: String) -> Nat:
1227 +d = P.norm(dir)
1228 Bool.pick(Nat, Bool.or(String.eq(d, "."), String.is_empty(d)), 0n,
1229 List.length(&2, String, String.split(d, '/')))