nationid - v2.2.1
    Preparing search index...

    Module extract

    nationid/extract — structured-data extraction from documents that structurally encode that data (DOB, sex, region).

    Design notes:

    • All extractors validate first via parse(). If parse(...).ok === false they return null. No extractor sees an unverified body.
    • The dispatcher is a switch on DocumentTypeCode. Adding a new spec requires only an entry in SUPPORT_TABLE plus the per-spec extractor.
    • The public surface is intentionally small: 4 functions and 4 types. We do not expose a "rich" object with all three fields because most specs encode only one or two; mixing them in a single shape would force consumers to handle implausible combinations.
    DateOfBirth
    ExtractKind
    Region
    Sex
    extractDOB
    extractRegion
    extractSex
    supports