def valid_host2
import cswap-bend-cli@0.1.0.0/store/base.bend as Baseimport Base
154def valid_host2(+tld: Maybe<&2, String>, +n: Nat, +chars: Bool) -> Bool:
155 match tld:
156 case None{}:
157 False{}
158 case Some{t}:
159 chars && Nat.is_ge(n, 2n) && all_alpha(t) && Nat.is_ge(String.length(t), 2n)