Returns whether code exposes the requested extract kind.
code
Use this to gate UI affordances (e.g. only show a "show birthday" button for documents that encode a DOB).
Document type to query.
Extract category: "dob", "sex", or "region".
"dob"
"sex"
"region"
true if code can answer kind, false otherwise.
true
kind
false
import { supports } from "nationid/extract";supports("MX_CURP", "dob"); // truesupports("MX_CURP", "sex"); // truesupports("SV_DUI", "dob"); // false (DUI does not encode DOB) Copy
import { supports } from "nationid/extract";supports("MX_CURP", "dob"); // truesupports("MX_CURP", "sex"); // truesupports("SV_DUI", "dob"); // false (DUI does not encode DOB)
Returns whether
codeexposes the requested extract kind.Use this to gate UI affordances (e.g. only show a "show birthday" button for documents that encode a DOB).