Retrieve a validator by key or alias. Returns undefined when the key is unknown.
Derive an IdFormat descriptor from the validator's METADATA. Resolves aliases. Returns undefined for unknown keys.
Check whether a key (primary or alias) is registered.
Return a sorted array of primary keys only.
Return a sorted array of all keys (primary + aliases).
Register a validator under a primary key.
Register a country definition: its validator under country.key, plus its aliases.
Atomic: every conflict is checked before anything is registered, so a failed
call leaves the registry unchanged. Idempotent for a definition that is already
fully registered (e.g. by the root idnumbers entry), which makes it a no-op.
Return the primary key (alpha-3) for a given key or alias. Matching is
case-insensitive for ASCII letters only, so a non-ASCII lookalike never resolves
to a built-in code (#298), like Python's resolve_country.
Returns undefined when the key is unknown or not a string (an untyped JavaScript
caller may pass undefined, null or a number), as the Python library does (#295).
Central registry for country ID validators.
Keys are stored uppercase. Only the ASCII letters are case-folded, so a non-ASCII lookalike (long s, dotless i, ...) never matches an ASCII code (#298). Aliases resolve to primary keys only (no chaining). Qualified keys use colon separator, e.g. "USA:SSN".