@metreeca/blue - v0.12.0
    Preparing search index...

    Function getBoundBranch

    • Picks the single branch a relational bound filters against.

      Routes a <, >, <= or >= operand to the one branch it filters, so that a caller may type the bound by the branch it resolves to. A bound need not be a legal element value, so it is matched on the syntactic discriminators alone and the union is expected to be literally disjoint; the match stays exactly one, as a conversion commits to a single branch.

      A localised branch takes a plain string bound, compared against the strings its tags carry. A plain string bound over a string branch and a localised one therefore fits both and routes to neither. Links and embedded resources have no order and take no bound.

      Routing applies the same rule as template validation, so every bound in a validated template routes to a branch.

      Type Parameters

      • B extends Shape

        The branch type, carried through from the branches supplied

      Parameters

      • bound: unknown

        The bound to route

      • branches: readonly B[]

        The branches to choose among

      Returns Optional<B>

      The sole branch bound filters against, or undefined where it filters none or several