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.
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.