isPostalCode function
Returns true if text is a valid postal code for locale.
Returns false if text is null.
Throws FormatException if locale is not supported and no orElse is provided.
Implementation
bool isPostalCode(String? text, String locale, {bool Function()? orElse}) {
if (text == null) return false;
final pattern = postalCodePatterns[locale];
return pattern != null
? pattern.hasMatch(text)
: orElse != null
? orElse()
: throw FormatException('No postal code pattern for locale: $locale');
}