def name.ok
import ezx@1.11.0.0/src/pkg/pkg.bend as Pkgimport Base
396# whether a `<name>@<version>` is one the hub rules in, as bend's `NAMED`
397# pattern reads it
398def name.ok(+nv: String) -> Bool:
399 +ps = String.split(nv, '@')
400 Bool.and(Nat.is_eq(List.length(&2, String, ps), 2n),
401 Bool.and(name.part(word(ps, 0n)), ver.ok(word(ps, 1n))))