lanka-validations - v2.1.0
    Preparing search index...

    Module postal-code

    Validate Sri Lankan postal codes and find their district and province.

    Import from lanka-validations/postal-code, or from the package root.

    Checks the five-digit format and the two-digit routing prefix. It does not confirm that a specific post office uses the code.

    import { isValidPostalCode, lookupPostalCode } from 'lanka-validations/postal-code';

    isValidPostalCode('00100'); // true
    lookupPostalCode('20000')?.district; // 'Kandy'
    isValidPostalCode
    lookupPostalCode
    normalizePostalCode
    validatePostalCode
    PostalCodeInfo
    PrefixMapping
    MAJOR_CITIES
    POSTAL_PREFIXES