nationid - v2.2.1
    Preparing search index...

    Function extractSex

    • Returns the sex marker encoded in input, or null if the spec does not encode sex or the input fails validation.

      Returns the document's literal marker — "M", "F", or "X" for non-physical-person entities (e.g. Argentine PJ CUIT prefixes 30/33/34).

      Parameters

      • code: CodesSupporting<"sex">

        Document type. Must support "sex" (see supports).

      • input: string

        Raw user input; will be normalized and validated first.

      Returns Sex | null

      A Sex on success, null otherwise.

      import { extractSex } from "nationid/extract";

      extractSex("MX_CURP", "GOMC850315HDFRRR07"); // "M"
      extractSex("AR_CUIT", "30709653543"); // "X" (persona jurídica)