All files / src index.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63                                                                                                                             
/**
 * Entry point of `nif-dni-nie-cif-validation`: validators for Spanish NIF,
 * DNI, K/L/M, NIE and CIF (NIF of a legal person or entity) numbers.
 *
 * The export names are the public API: keep them stable. Every rule the
 * validators apply has an ID in SPEC.md, cited in the modules below:
 *
 * - nif.ts: any NIF (isValidNif) and natural persons (isValidNaturalPersonNif).
 * - dni.ts: DNI and K/L/M NIF.
 * - nie.ts: NIE.
 * - cif.ts: NIF of a legal person or entity (formerly CIF).
 * - normalize.ts: input cleanup (NORM-1 to NORM-4, NIE-3).
 * - policy.ts: opt-in policies (POLICY-1, placeholders).
 * - validate.ts: validate() and getNifType(), the detailed API.
 * - organisations.ts: describeCifOrganisation(), the CIF organisation keys.
 * - localize.ts, locales/: the texts of validate() and
 *   describeCifOrganisation(). English is built in; every other language is
 *   its own entry point (`nif-dni-nie-cif-validation/locales/es`), so it is
 *   not exported here.
 * - vat.ts: isValidSpanishVat() (VAT-1).
 * - format.ts: format() and computeControlCharacter().
 */
export { isValidNif, isValidNaturalPersonNif } from "./nif";
export {
  isValidDniLetter,
  DNI_CONTROL_LETTERS,
  isValidDni,
  DNI_REGEX,
} from "./dni";
export { isValidNie, NIE_REGEX, replaceNieLetter } from "./nie";
export {
  CIF_CONTROL_LETTERS,
  CIF_REGEX,
  isValidCif,
  isValidCifControlCode,
  isValidLegalEntityNif,
  isValidLegalEntityNifControlCode,
  LEGAL_ENTITY_CONTROL_LETTERS,
  LEGAL_ENTITY_NIF_REGEX,
} from "./cif";
export { normalize } from "./normalize";
export { describeCifOrganisation } from "./organisations";
export { getNifType, validate } from "./validate";
export { isValidSpanishVat } from "./vat";
export { computeControlCharacter, format } from "./format";
export type { FormatOptions } from "./format";
export type {
  CifControlMode,
  CifOrganisationKey,
  CifOrganisationMeta,
  GetNifTypeOptions,
  IsValidOptions,
  NifErrorCode,
  NifFormatRule,
  NifLengthRule,
  NifLocale,
  NifMessages,
  NifType,
  NifValidationError,
  ValidateOptions,
  ValidationResult,
} from "./types";