Parse information from a valid national ID number.
Returns { ok: true, info } with what the country's parser extracted, or
{ ok: false, reason } saying why nothing was parsed (#123):
UNSUPPORTED_COUNTRY: the country code is not registered;
INVALID_LENGTH / INVALID_FORMAT / CHECKSUM_MISMATCH / VALIDATION_FAILED:
the ID is invalid, with the same reason validateNationalId() reports;
NOT_PARSABLE: the ID is valid, but the country has no parser or its parser
extracted nothing.
Aliases resolve like validateNationalId(), and countryCode in the result is
the resolved alpha-3 code, also when a validator or parser throws (#301). For a
built-in country code, info has that country's parse result type; see
ParseResultMap. A non-string country code, from untyped JavaScript, is unsupported too.
Parse information from a valid national ID number.
Returns
{ ok: true, info }with what the country's parser extracted, or{ ok: false, reason }saying why nothing was parsed (#123):UNSUPPORTED_COUNTRY: the country code is not registered;INVALID_LENGTH/INVALID_FORMAT/CHECKSUM_MISMATCH/VALIDATION_FAILED: the ID is invalid, with the same reasonvalidateNationalId()reports;NOT_PARSABLE: the ID is valid, but the country has no parser or its parser extracted nothing.Aliases resolve like
validateNationalId(), andcountryCodein the result is the resolved alpha-3 code, also when a validator or parser throws (#301). For a built-in country code,infohas that country's parse result type; seeParseResultMap. A non-string country code, from untyped JavaScript, is unsupported too.