Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/common"

Index

Functions

validateMatchlist

  • Validates a matchlist

    As the name implies. If the matchlist is invalid it throws a TypeError. If it is valid, it returns a brand new matchlist with a copy of all the MatchOptions passed in.

    What makes a matchlist valid?

    • Each object in the matchlist must be an object (and not like a string or something).
    • Each object in the matchlist must have exactly one of {accept, offer} be set to a string value indicating its "accept" or "offer" protocol
    • Each "accept" protocol can only appear once as an "accept" protocol, and likewise each "offer" protocol may only appear once as an "offer" protocol.
    • However, An "accept" protocol may appear as an "offer" protocol in a separate MatchOption, in case the protocol doesn't have an obvious "accept" or "offer" side.

    Parameters

    Returns MatchOption[]

Generated using TypeDoc