Canboat ts-pgns
    Preparing search index...

    Function findMatchingDefinition

    • Finds and returns the matching PGN definition for a given PGN object.

      This function retrieves possible definitions for the provided PGN, filters out fallback definitions, and iteratively matches fields with specific criteria. If a field has a Match property, it compares the numeric value of the field in the PGN with the definition. Throws an error if no matching definition is found or if a field value is invalid.

      Parameters

      • pgn: PGN

        The PGN object containing the PGN string and associated fields to match against definitions.

      Returns Definition

      The matching Definition object for the provided PGN.

      If the PGN is unknown, if a field value is invalid, or if no matching definition is found.