def Entry.hit

bend-lint-pack@0.1.1.0 · common.bend:283

import bend-lint-pack@0.1.1.0/common.bend as Common
import Base

283# Entry lists: `a, b, prefix*`
284# ============================
285# Whether the entry `e` names `name`: the same, or, if it ends in `*`, a prefix of it.
286def Entry.hit(+e: String, +name: String) -> Bool:
287  Bool.pick(
288    Bool,
289    String.ends_with(e, "*"),
290    String.starts_with(name, String.take(e, Nat.sub(String.length(e), 1n))),
291    String.eq(e, name)
292  )

Uses (9)

Used by (1)