Logo Lanfrica

Franciscobridge/ango-tools

Domain:

digital infrastructure

Record type:

softwaretools
Creator:
Fra
Host:
Biblioteca de validação de documentos e dados financeiros de Angola # @ango-tools/validate Biblioteca de validação de documentos e dados financeiros de Angola. ## Instalação ```bash npm install @ango-tools/validate ``` ## Uso ### Número de Bilhete de Identidade (BI) ```ts import { validateBI } from "@ango-tools/validate"; validateBI("123456789AB123"); // { isValid: true, code: "VALID_NUM_BI" } validateBI("123456789AB12"); // { isValid: false, code: "INVALID_NUM_BI" } ``` ### IBAN ```ts import { validateIban } from "@ango-tools/validate"; validateIban("AO32004000001234567891057"); // { // isValid: true, // code: "VALID_IBAN", // details: { // code: "0040", // swift: "BAIPAOLU", // name: "BAI", // fullname: "Banco Angolano de Investimento" // } // } ``` ### Códigos bancários ```ts import { CODE_LIST } from "@ango-tools/validate"; CODE_LIST.AO.agency["0040"]; // { code: "0040", swift: "BAIPAOLU", sname: "BAI", fname: "Banco Angolano de Investimento" } ``` ## API | Importação | Função | Retorno | | --- | --- | --- | | `@ango-tools/validate` | `validateBI(value: string)` | `TypeValidationResponse` | | `@ango-tools/validate` | `validateIban(iban: string)` | `TypeValidationResponse & { details?: IbanInfo } \| null` | ## Desenvolvimento ```bash npm run build # compila com tsup (ESM + CJS + tipos) npm test # roda os testes (vitest) npm run typecheck # verificação de tipos ``` ## Licença MIT

Languages

Licenses