Handy in exhaustive switches (in default case) of enums values,
so that we have compilation-time exhaustive check (via never argument).
We return undefined instead of throwing error (e.g. via assertNever()) to support
unexpected values in case third party goes ahead in protocol implementation -- in this case we should ignore
respective part of protocol message based on undefined result of parsing.
Handy in exhaustive switches (in
defaultcase) of enums values, so that we have compilation-time exhaustive check (vianeverargument). We returnundefinedinstead of throwing error (e.g. viaassertNever()) to support unexpected values in case third party goes ahead in protocol implementation -- in this case we should ignore respective part of protocol message based onundefinedresult of parsing.