The compact form of an ID (#128): ASCII letters uppercased, without whitespace and without
the separators . - / ( ). Other letters, such as the sharp s or a Greek letter, are kept
as written, as in the Python library (#301); toUpperCase() would turn some of them into
ASCII letters. For an ID written without separators, those characters stay
when the ID without whitespace already has an allowed length, so Finland's century
sign in 131052-308T is kept. Sweden's + for people aged 100 or over always stays.
validateNationalId() accepts the compact form for every country except USA and
KOR, whose validators require the separators: validate formatId()'s output
there.
Returns null for an unsupported country code (including a non-string one from
untyped JavaScript) or a non-string ID.
The compact form of an ID (#128): ASCII letters uppercased, without whitespace and without the separators
. - / ( ). Other letters, such as the sharp s or a Greek letter, are kept as written, as in the Python library (#301);toUpperCase()would turn some of them into ASCII letters. For an ID written without separators, those characters stay when the ID without whitespace already has an allowed length, so Finland's century sign in131052-308Tis kept. Sweden's+for people aged 100 or over always stays.validateNationalId()accepts the compact form for every country except USA and KOR, whose validators require the separators: validateformatId()'s output there.Returns null for an unsupported country code (including a non-string one from untyped JavaScript) or a non-string ID.