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

    Function parseDrivingLicense

    • Parses a Sri Lankan Driving License number. Supports:

      • Legacy DMT format: B followed by 7 digits (e.g. B1234567)
      • Modern Smart Card format: DMT B-number or NIC-based license

      Parameters

      • rawLicense: unknown

        Driving licence number. Strings and finite numbers are accepted; other types return a failure without throwing.

      Returns DrivingLicenseInfo | null

      The detected format and number, or null if invalid.

      parseDrivingLicense('B1234567')?.format; // 'smart_card_b'