Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
29a0a9f
refactor(cbo): getCbo builds on isValidCbo instead of the other way r…
claude Sep 26, 2026
8ba21d8
refactor(cnae): getCnae builds on isValidCnae instead of the other wa…
claude Sep 26, 2026
f715bc2
refactor(cfop): getCfop builds on isValidCfop instead of repeating it…
claude Sep 26, 2026
14baeba
refactor(legal-nature): getLegalNature builds on isValidLegalNature
claude Sep 26, 2026
e8772ef
refactor(license-plate): getFormatLicensePlate builds on isValidLicen…
claude Sep 26, 2026
fb8571d
refactor: spell out truncated internal names
claude Sep 26, 2026
dd4cc4b
refactor(nfe-key): isValidNfeKey checks the key itself and getNfeKeyI…
claude Sep 26, 2026
a2980b1
refactor(pix): isValidPixPayload checks the BR Code itself and getPix…
claude Sep 26, 2026
2d8e94e
refactor(pix): isValidPixKey tells the kind of key without normalizin…
claude Sep 26, 2026
6fc9a90
fix(caepf): reject negative and fractional numbers
claude Sep 26, 2026
801f2f9
fix(cei,cno): reject negative and fractional numbers
claude Sep 26, 2026
97969c0
fix(cep): reject negative and fractional numbers
claude Sep 26, 2026
29b5a18
fix(cns): reject negative and fractional numbers
claude Sep 26, 2026
ee00e23
fix(legal-nature): reject negative and fractional numbers in getLegal…
claude Sep 26, 2026
73cab3c
docs: document the number rule of the guarded utils, and fix two JSDo…
claude Sep 26, 2026
c67c1ba
fix(boleto): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
a99fe3d
fix(caepf): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
88f5bda
fix(cei): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
040b530
fix(cep): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
90592af
fix(certidao): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
72a5de6
fix(cnae): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
3215bb6
fix(cnh): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
d19ad28
fix(cno): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
b6563f3
fix(cnpj): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
8592439
fix(cns): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
e484f4e
fix(cpf): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
6259d13
fix(legal-nature): read a number only when it is a non-negative safe …
claude Sep 26, 2026
cf0aeb0
fix(ncm): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
674e125
fix(phone): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
ca2ea73
fix(pis): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
a22a8d2
fix(processo-juridico): read a number only when it is a non-negative …
claude Sep 26, 2026
f26cd3e
fix(voter-id): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
3ff37bb
fix(cbo): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
a590084
fix(cfop): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
3f0a860
fix(iban): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
0de7184
fix(nfe-key): read a number only when it is a non-negative safe integer
claude Sep 26, 2026
22eabd8
fix(ie): accept the Goiás prefixes 20 to 29
claude Sep 27, 2026
0a854c8
fix(ie): accept the 9 digit Mato Grosso registration
claude Sep 27, 2026
a224dcd
fix(ie): accept the Distrito Federal prefix 08
claude Sep 27, 2026
a942d8f
fix(ie): accept only the Pará prefixes 15 and 75
claude Sep 27, 2026
3f224a4
fix(ie): require the 0 after the P of a São Paulo produtor rural regi…
claude Sep 27, 2026
a39ceda
docs(ie): correct the RJ, TO and header notes, and add MG and MS notes
claude Sep 27, 2026
1e4a799
fix(get-holidays): list Carnaval Monday as a ponto facultativo next t…
claude Sep 27, 2026
2ef1027
fix(get-holidays): list each national holiday only in the years a fed…
claude Sep 27, 2026
905cf9e
fix(get-holidays): start each state holiday in the first year its law…
claude Sep 27, 2026
7c56a74
fix(get-holidays): type Rio de Janeiro's Carnaval Tuesday as a state …
claude Sep 27, 2026
f6dc883
fix(get-holidays): list Alagoas' 20 November from 1995 to 2023 under …
claude Sep 27, 2026
567978d
fix(get-holidays): list Acre's Dia do Católico and name both transfer…
claude Sep 27, 2026
c67a7ec
fix(get-holidays): list the first round of the elections as a nationa…
claude Sep 27, 2026
c919097
fix(get-holidays): drop the AM and PR optional days no state norm dec…
claude Sep 27, 2026
f5199a7
docs(business-days): stop calling the default count the calendar of b…
claude Sep 27, 2026
526a27a
fix(capitalize): write the UF of a "Cidade - UF" address in upper case
claude Sep 27, 2026
0c419d5
fix(capitalize): keep every roman numeral up to XXXIX upper case, not…
claude Sep 27, 2026
9722941
fix(pix): check an e-mail key against the DICT pattern instead of isV…
claude Sep 27, 2026
205db69
fix(pix): reject a BR Code object whose declared length is 00
claude Sep 27, 2026
49bb373
fix(pix): require the merchant category code of a BR Code to be 4 digits
claude Sep 27, 2026
3459ee5
fix(pix): require the payload format indicator to open the BR Code
claude Sep 27, 2026
649c0ef
fix(pix): read a BR Code amount the way the EMV writes it
claude Sep 27, 2026
433c78b
fix(pix): validate a BR Code by the rules of the Pix manual, not only…
claude Sep 27, 2026
842d556
docs(pix): describe pointOfInitiation and the random key by what the …
claude Sep 27, 2026
955df10
docs(bank-account): say where the check digit rules come from
claude Sep 27, 2026
d2523a1
fix(voter-id): read a voter id as at most 12 digits, its leading zero…
claude Sep 27, 2026
59bafec
fix(certidao): reject the book codes 8 and 9, which art. 473, V does …
claude Sep 27, 2026
38a2194
fix(vin): check a VIN by the Brazilian rule, the 49 CFR check digit o…
claude Sep 27, 2026
6e0dee4
fix(cnpj): never generate the número de ordem 0000, which is never as…
claude Sep 27, 2026
70346ff
fix(phone): reject a mobile number starting with 6 under the default …
claude Sep 27, 2026
a6cd5e0
docs(cnh): read art. 4º § 1º as the rule of the Espelho's check digit
claude Sep 27, 2026
a3e40fa
docs(format): cite the LDO rule behind obfuscate, and none for the CNPJ
claude Sep 27, 2026
843b3fd
docs(processo-juridico): give the check digits' true range and the An…
claude Sep 27, 2026
30e5409
docs(cnpj): say the alphanumeric set is A to Z and lower case is only…
claude Sep 27, 2026
32ebc70
fix(nfe-key): accept the alphanumeric CNPJ in positions 7 to 18 of th…
claude Sep 27, 2026
035a04e
fix(boleto): accept only the código de moeda 9 and the 988 layout, an…
claude Sep 27, 2026
e054b44
docs(cid10): name the COVID-19 codes the DATASUS V2008 tables do not …
claude Sep 27, 2026
18a9efa
docs(nfe-key): note that the current CT-e schema gives the GTV-e tpEm…
claude Sep 27, 2026
65f9947
fix(ie): accept the Pará prefixes 76 to 79 the SINTEGRA page lists
claude Sep 27, 2026
b8b3c3f
fix(ie): accept only the Alagoas tipo de empresa digits 0, 3, 5, 7 and 8
claude Sep 27, 2026
8cf1255
fix(ie): accept the old 14 digit Pernambuco CACEPE registration
claude Sep 27, 2026
c46e1c2
docs(ie): quote both branches of the Amazonas check digit rule as the…
claude Sep 27, 2026
1653501
docs(ie): cite the three Goiás sources for the prefixes and say where…
claude Sep 27, 2026
75dcd32
docs(ie): cite Portaria SEFAZ-MT 59/2025 art. 8º § 1º for the 9 digit…
claude Sep 27, 2026
6d0d8e5
docs(ie): say the Mato Grosso do Sul prefix 50 comes from SINTEGRA an…
claude Sep 27, 2026
7cd13ad
docs(ie): cite Portaria SEFAZ-TO 676/2002 art. 3º and RICMS-TO art. 9…
claude Sep 27, 2026
1698d4a
docs(ie): say the SINTEGRA page does not fix the Distrito Federal pre…
claude Sep 27, 2026
9af1673
docs(ie): say the Roraima prefix 24 is read from the SINTEGRA examples
claude Sep 27, 2026
6c8dc4a
docs(ie): note the typo in the São Paulo produtor rural example of th…
claude Sep 27, 2026
6864ed3
docs(phone): document the Anatel numbering rules scheduled for 1 Marc…
claude Sep 27, 2026
930b5ae
docs(service-phone): rest the 0800-like numbers on Resolução 749/2022…
claude Sep 27, 2026
52a904f
fix(service-phone): take the SUP codes from the current Anatel list a…
claude Sep 27, 2026
f6aa2e6
docs(area-code): check the DDD tables against the current Anatel CN t…
claude Sep 27, 2026
1402462
fix(pix-key): drop the & the current DICT API removed from the e-mail…
claude Sep 27, 2026
bfd183b
docs(pix-payload): say that no BCB manual sets the case of the CRC or…
claude Sep 27, 2026
8c91543
fix(iban): accept an alphanumeric ISPB and cite Resolução BCB nº 585/…
claude Sep 27, 2026
f127e9c
chore(banks): regenerate the bank table from the STR list of 25/09/2026
claude Sep 27, 2026
a958800
docs(bank-account): cite the CNAB 240 v11.0 notes that leave the chec…
claude Sep 27, 2026
5dd780c
docs(boleto): cite Layout de Arrecadação v8 and drop an unverified FE…
claude Sep 27, 2026
5ee6402
docs(gtin): say that rejecting a GTIN of zeros is a rule of this library
claude Sep 27, 2026
5d8dd32
docs(nfse-key): state that no official rule sets the check digit of a…
claude Sep 27, 2026
196985e
fix(cid10): add the U07 codes of the DATASUS SIM table the V2008 file…
claude Sep 27, 2026
a603dfb
docs(datasets): name the official versions the NCM, LC 116 and munici…
claude Sep 27, 2026
706da94
docs(voter-id): quote Res. TSE 23.659/2021 art. 36 literally and flag…
claude Sep 27, 2026
6279241
docs(cnpj): cite IN RFB 2.229/2024 and its retificação, and pin the m…
claude Sep 27, 2026
5f1ee50
docs(pis): say that no official document publishes the PIS/PASEP/NIS …
claude Sep 27, 2026
8cf60b3
docs(cns): cite the DATASUS validation routines and say that no offic…
claude Sep 27, 2026
f862881
docs(certidao): trace book codes 8 and 9 to Prov. CNJ 3/2009 and say …
claude Sep 27, 2026
45c21b3
docs(cnh): cite Res. CONTRAN 1.020/2025, which repeats the layout and…
claude Sep 27, 2026
fd5a8fe
docs(renavam): cite Portaria DENATRAN 27/2013, the official source of…
claude Sep 27, 2026
a4432bb
docs(caepf,cei,cno): cite the official format sources and say the che…
claude Sep 27, 2026
e60fe5a
feat(registro-profissional): accept the CRO number form of art. 115 o…
claude Sep 27, 2026
9806856
docs(passport): say the Polícia Federal FAQ is the only official sour…
claude Sep 27, 2026
3a68e6a
docs(processo-juridico): place the check digit algorithm in Anexo VII…
claude Sep 27, 2026
21e2fe7
docs(suframa): say the NF-e MOC, not the SUFRAMA, is the source of th…
claude Sep 27, 2026
e6fcbb0
docs(vin): stop attributing the I, O and Q exclusion to Res. CONTRAN …
claude Sep 27, 2026
1c6e54f
docs(obfuscate): cite art. 163 of the LDO 2026 (Lei 15.321/2025) next…
claude Sep 27, 2026
0386232
docs(format-phone,format-cnpj): say no official rule masks a phone or…
claude Sep 27, 2026
1b28890
docs(cpf): cite the DJE layout for the reserved numbers and say IN RF…
claude Sep 27, 2026
3d96c65
fix(certidao): accept again the book codes 8 and 9 of Prov. CNJ 3/2009
claude Sep 27, 2026
f39c2dc
fix(holidays): list Amapá's 20 November from 2008, the first one afte…
claude Sep 27, 2026
8f0412c
fix(holidays): add Amapá's Dia de Cabralzinho, 15 May, from 2018 (Lei…
claude Sep 27, 2026
fd2aafd
fix(holidays): add Amapá's Dia de São Tiago, 25 July, from 2012 to 2018
claude Sep 27, 2026
cc084f9
fix(holidays): add Alagoas' Dia Estadual do Evangélico, 30 November, …
claude Sep 27, 2026
0093e06
fix(holidays): make Corpus Christi a feriado estadual in Maranhão fro…
claude Sep 27, 2026
d437782
fix(holidays): add Maranhão's Dia Internacional da Mulher, 8 March, f…
claude Sep 27, 2026
d52be2b
fix(holidays): list Paraíba's 5 August from 1968, under Lei PB nº 3.4…
claude Sep 27, 2026
46331ca
fix(holidays): list Sergipe's 8 July from 1990 and its 24 October fro…
claude Sep 27, 2026
4b4516f
docs(holidays): say why Acre's Friday shift is not applied: its decre…
claude Sep 27, 2026
0de1f8c
docs(holidays): say Goiás' dates come from the servants' statute and …
claude Sep 27, 2026
97561c5
docs(holidays): name the one-year moves of Piauí's and Tocantins' dat…
claude Sep 27, 2026
4793913
docs(holidays): say Santa Catarina's law leaves Saturday open and how…
claude Sep 27, 2026
743be48
docs(holidays): record the state sources a 2026 official-source check…
claude Sep 27, 2026
cef0039
docs(holidays): cite the DOU texts of the 2024 and 2025 federal calen…
claude Sep 27, 2026
f2b109d
docs(business-days): quote art. 6º of Resolução CMN nº 4.880/2020 in …
claude Sep 27, 2026
ed5bf26
docs(business-days): cite IN MTP nº 2/2021 from the DOU and say what …
claude Sep 27, 2026
e3dbf4c
fix(pix): accept a dynamic BR Code whose txid is filled, as §2.7 has …
claude Sep 27, 2026
186fa6b
docs(gtin): read the prefix from the GS1 tables, not from an unread S…
claude Sep 27, 2026
0fc6bb1
docs(ie): say the Goiás check digit follows the 2012 roteiro, not the…
claude Sep 27, 2026
c1fdf48
docs(nfse-key): say the alphanumeric key schema is the restricted-pro…
claude Sep 27, 2026
ed23fb9
docs(suframa): say reading an 8 digit ISUF as a lost leading zero is …
claude Sep 27, 2026
b19d0b7
docs(format): say which phone masks keep 190 and to pad a numeric vot…
claude Sep 27, 2026
1e3d8a2
fix(holidays): list PR 19/12 from 1963 to 2013, AM 08/12 and PE 06/03…
claude Sep 27, 2026
595664b
docs: state the non-negative safe integer rule for numbers among the …
claude Sep 27, 2026
cb7786e
docs(pix-key): drop the claim that 2.4.0 accepted an e-mail key with &
claude Sep 28, 2026
0bd38dd
Merge branch 'claude/api-check-without-baseline' into hyan/confident-…
claude Sep 28, 2026
c7ca9f5
Merge branch 'claude/api-check-without-baseline' into hyan/confident-…
claude Sep 28, 2026
61b4c16
Merge branch 'claude/api-check-without-baseline' into hyan/confident-…
claude Sep 29, 2026
6782fd0
Merge branch 'main' into hyan/confident-babbage-dj7wii
claude Sep 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ A few utils embed an official dataset and weigh far more than everything else co

| Util | Dataset | Minified | Gzipped |
| --- | --- | --- | --- |
| `getCid10` | CID-10 V2008 categories and subcategories, with the DATASUS descriptions | 1030.4 KB | 146.9 KB |
| `getCid10` | CID-10 V2008 categories and subcategories plus the SIM `U07` codes, with the DATASUS descriptions | 1030.6 KB | 147.0 KB |
| `getMunicipalities` · `getMunicipalityByCode` · `getMunicipality` | 5571 IBGE municipalities, with names and codes | 154.9 - 156.5 KB | 50.3 - 50.4 KB |
| `getCities` | 5571 IBGE municipality names | 154.2 KB | 49.8 KB |
| `isValidNcm` | NCM (Nomenclatura Comum do Mercosul) codes | 114.2 KB | 24.6 KB |
| `isValidCbo` · `getCbo` | CBO 2002 occupation titles | 119.1 KB | 30.6 KB |
| `isValidCbo` · `getCbo` | CBO 2002 occupation titles | 119.1 - 119.2 KB | 30.6 - 30.7 KB |
| `isValidCest` · `getCest` | CEST descriptions and segments (Convênio ICMS 142/18) | 116.6 - 117.8 KB | 26.4 - 26.9 KB |
| `isValidCnae` · `getCnae` | CNAE-Subclasses 2.3 | 93.9 KB | 21.2 KB |
| `isValidCnae` · `getCnae` | CNAE-Subclasses 2.3 | 93.9 - 94.0 KB | 21.1 - 21.2 KB |
| `isValidNbs` · `getNbs` | NBS 2.0 (Nomenclatura Brasileira de Serviços) descriptions | 81.8 KB | 13.8 KB |
| `isValidCfop` · `getCfop` | CFOP operation descriptions | 68.9 KB | 6.9 KB |
| `isValidCfop` · `getCfop` | CFOP operation descriptions | 68.9 - 69.0 KB | 6.9 KB |
| `getClassTrib` | cClassTrib (IBS/CBS) names and descriptions | 50.8 KB | 9.6 KB |
| `getBanks` · `getBankByCode` · `getBankByIspb` | Banco Central STR participants (COMPE + ISPB) | 38.3 - 38.6 KB | 9.5 - 9.7 KB |
| `isValidServiceItem` · `getServiceItem` | Service list of the Lei Complementar 116/2003 | 27.1 - 27.2 KB | 8.8 - 8.9 KB |
| `isValidCid10` | CID-10 V2008 category and subcategory codes, without the descriptions | 27.0 KB | 7.4 KB |
| `isValidCid10` | CID-10 V2008 category and subcategory codes plus the SIM `U07` codes, without the descriptions | 27.0 KB | 7.4 KB |

The root of the package is a single ESM module, so a bundler cannot split one of these datasets out of it: importing a heavy util from the root puts its whole dataset in your main bundle, and a dynamic `import()` of the root does not help. To lazy-load one, import it from its own subpath:

Expand Down
10 changes: 5 additions & 5 deletions docs/pt-br/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ Alguns utilitários embutem uma base de dados oficial e pesam muito mais que tod

| Utilitário | Base de dados | Minificado | Gzip |
| --- | --- | --- | --- |
| `getCid10` | categorias e subcategorias da CID-10 V2008, com as descrições do DATASUS | 1030,4 KB | 146,9 KB |
| `getCid10` | categorias e subcategorias da CID-10 V2008 mais os códigos `U07` do SIM, com as descrições do DATASUS | 1030,6 KB | 147,0 KB |
| `getMunicipalities` · `getMunicipalityByCode` · `getMunicipality` | 5571 municípios do IBGE, com nomes e códigos | 154,9 - 156,5 KB | 50,3 - 50,4 KB |
| `getCities` | nomes dos 5571 municípios do IBGE | 154,2 KB | 49,8 KB |
| `isValidNcm` | códigos NCM (Nomenclatura Comum do Mercosul) | 114,2 KB | 24,6 KB |
| `isValidCbo` · `getCbo` | títulos das ocupações da CBO 2002 | 119,1 KB | 30,6 KB |
| `isValidCbo` · `getCbo` | títulos das ocupações da CBO 2002 | 119,1 - 119,2 KB | 30,6 - 30,7 KB |
| `isValidCest` · `getCest` | descrições e segmentos do CEST (Convênio ICMS 142/18) | 116,6 - 117,8 KB | 26,4 - 26,9 KB |
| `isValidCnae` · `getCnae` | CNAE-Subclasses 2.3 | 93,9 KB | 21,2 KB |
| `isValidCnae` · `getCnae` | CNAE-Subclasses 2.3 | 93,9 - 94,0 KB | 21,1 - 21,2 KB |
| `isValidNbs` · `getNbs` | descrições da NBS 2.0 (Nomenclatura Brasileira de Serviços) | 81,8 KB | 13,8 KB |
| `isValidCfop` · `getCfop` | descrições das operações do CFOP | 68,9 KB | 6,9 KB |
| `isValidCfop` · `getCfop` | descrições das operações do CFOP | 68,9 - 69,0 KB | 6,9 KB |
| `getClassTrib` | nomes e descrições do cClassTrib (IBS/CBS) | 50,8 KB | 9,6 KB |
| `getBanks` · `getBankByCode` · `getBankByIspb` | participantes do STR do Banco Central (COMPE + ISPB) | 38,3 - 38,6 KB | 9,5 - 9,7 KB |
| `isValidServiceItem` · `getServiceItem` | lista de serviços da Lei Complementar 116/2003 | 27,1 - 27,2 KB | 8,8 - 8,9 KB |
| `isValidCid10` | códigos das categorias e subcategorias da CID-10 V2008, sem as descrições | 27,0 KB | 7,4 KB |
| `isValidCid10` | códigos das categorias e subcategorias da CID-10 V2008 mais os códigos `U07` do SIM, sem as descrições | 27,0 KB | 7,4 KB |

A raiz do pacote é um único módulo ESM, então o bundler não consegue separar uma dessas bases de dados dele: importar um utilitário pesado da raiz coloca a base inteira no seu bundle principal, e um `import()` dinâmico da raiz não ajuda. Para carregar sob demanda, importe do subpath próprio:

Expand Down
Loading
Loading