def ent

bend-kit-sigv4@0.11.0.1 · sigv4.bend:630

import bend-kit-sigv4@0.11.0.1/sigv4.bend as Sigv4
import Base

630# The five XML entities and &#NN; / &#xHH;. None for any other.
631def ent(+e: String) -> Maybe<&2, U32>:
632  Bool.pick(Maybe<&2, U32>, String.eq(e, "lt"), Some{60},
633    Bool.pick(Maybe<&2, U32>, String.eq(e, "gt"), Some{62},
634      Bool.pick(Maybe<&2, U32>, String.eq(e, "amp"), Some{38},
635        Bool.pick(Maybe<&2, U32>, String.eq(e, "quot"), Some{34},
636          Bool.pick(Maybe<&2, U32>, String.eq(e, "apos"), Some{39},
637            Bool.pick(Maybe<&2, U32>, Bool.and(String.starts_with(e, "#"), Nat.is_lt(1n, String.length(e))), ent.num(String.drop(e, 1n)), None{}))))))

Uses (11)

Used by (1)