Skip to content

fix(states): read the state code ignoring case in every state-taking util - #604

Merged
hyanmandian merged 17 commits into
claude/holiday-state-codefrom
claude/municipalities-state-case
Sep 29, 2026
Merged

hyanmandian merged 17 commits into
claude/holiday-state-codefrom
claude/municipalities-state-case

Conversation

@hyanmandian

@hyanmandian hyanmandian commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Stacks on #603. Six utils did not read the state code the way the rest of the library does, so a lower-case or padded code behaved like an unknown one:

Util Input Before Now
getMunicipalities "sp" [] the 645 São Paulo municipalities
getCities "sp" [] the 645 São Paulo cities
generateCpf "sp" a random região fiscal digit 8, the SP região fiscal
generateVoterId "sp" "ZZ" (UF 28) SP (UF 01)
isValidRegistroProfissional (stateCode) "sp" false for "123456-SP" true
isValidIe (stateCode) " sp " false (it upper-cased the code but did not trim it) read as "SP"

Two new internal helpers do the reading:

The utils that are already keyed by the state codes (generateCpf, generateVoterId, getMunicipalities, getCities, isValidIe) look the normalized code up in their own table through hasOwnKey, so they don't bundle the code list. getStateNameByCode, getTimezoneByState, getAreaCodesByState and getMunicipality already followed this rule.

What an unknown code means is unchanged in every util:

  • getMunicipalities still returns [];
  • getCities still reads a falsy state as the full list;
  • the generators still fall back;
  • the registro and IE checks still fail.

The only change is that a real state code written in another case or with padding is now accepted. No return type changes, so check:api passes.

The JSDoc and both docs drop the "case-sensitive" notes and say what 2.4.0 did. For isValidIe, they now say that surrounding whitespace is ignored.

Checklist

  • My commit/PR title follows Conventional Commits.
  • I added or updated tests covering this change.
  • I updated the documentation in both docs/utilities.md and docs/pt-br/utilities.md.
  • npm run check passes locally. These also pass: coverage (100%), Stryker on the changed files (100%, is-valid-ie.ts included), Deno, Bun, check:unused, check:duplication and check:api (no breaking change against 2.4.0).
  • I ran npm run build:llms.
  • This change does not introduce a breaking change: only inputs that spell a real state code in another case, or with surrounding whitespace, change result.
  • This change does not add any runtime dependency.

Additional context

The tree-shaking report shows no size regression. The generators and getMunicipalities/getCities grow by about 86 to 94 B, and isValidRegistroProfissional by about 100 B.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH

…util

getMunicipalities, getCities, generateCpf, generateVoterId and isValidRegistroProfissional
matched the state code exactly, so "sp" returned no municipality, drew a random região fiscal,
fell back to "ZZ" or failed the UF check. They now read it through readStateCode (trim and upper
case, then an exact state code), like getStateNameByCode, getTimezoneByState, getAreaCodesByState
and getMunicipality already did; readHolidayStateCode builds on it. What an unknown code means
is unchanged in each util.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
brazilian-utils Ready Ready Preview Sep 29, 2026 4:30am UTC

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2f2855cf-7be9-4602-b318-27fa134552f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@brazilian-utils/brazilian-utils@604

commit: e13bb25

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Tree-shaking report

✅ No size regression. 18 grew, 1 shrank out of 194 exports.

Base Head Δ
Pre-existing exports, all imported 1925.5 KB 1925.2 KB (gzip 356.1 KB) -326 B (-0.0%)
Full import 1925.5 KB 1925.2 KB (gzip 356.1 KB) -326 B (-0.0%)
Exports 194 194 0

What changed (19)

Export Base Head Δ gzip
🟢 getStateCapital 1.1 KB 959 B -129 B (-11.9%) 638 B
🟡 isValidRegistroProfissional 1.2 KB 1.3 KB +90 B (+7.5%) 758 B
🟡 getCities 153.4 KB 153.5 KB +82 B (+0.1%) 49.3 KB
🟡 getMunicipalities 153.6 KB 153.7 KB +79 B (+0.1%) 49.5 KB
🟡 generateCpf 628 B 702 B +74 B (+11.8%) 458 B
🟡 generateCPF 628 B 702 B +74 B (+11.8%) 458 B
🟡 generateVoterId 852 B 926 B +74 B (+8.7%) 587 B
🟡 isValidIe 5.1 KB 5.2 KB +34 B (+0.6%) 1.8 KB
🟡 isValidIE 5.1 KB 5.2 KB +34 B (+0.6%) 1.8 KB
🟡 getTimezoneByState 737 B 759 B +22 B (+3.0%) 344 B
🟡 addBusinessDays 9.5 KB 9.5 KB +13 B (+0.1%) 3.3 KB
🟡 differenceInBusinessDays 9.3 KB 9.3 KB +13 B (+0.1%) 3.3 KB
🟡 isBusinessDay 8.8 KB 8.8 KB +13 B (+0.1%) 3.1 KB
🟡 isHoliday 8.7 KB 8.7 KB +13 B (+0.1%) 3.0 KB
🟡 subBusinessDays 9.6 KB 9.6 KB +13 B (+0.1%) 3.4 KB
🟡 getMunicipality 154.1 KB 154.1 KB +12 B (+0.0%) 49.8 KB
🟡 getHolidays 8.4 KB 8.4 KB +9 B (+0.1%) 2.9 KB
🟡 getAreaCodesByState 809 B 814 B +5 B (+0.6%) 463 B
🟡 getStateNameByCode 2.2 KB 2.2 KB +2 B (+0.1%) 594 B
All exports (194)
Export Base Head Δ gzip
⚪ GetAddressInfoByCepError 112 B 112 B 0 B 124 B
⚪ GetAddressInfoByCepNotFoundError 205 B 205 B 0 B 145 B
⚪ GetAddressInfoByCepServiceError 204 B 204 B 0 B 143 B
⚪ GetAddressInfoByCepValidationError 203 B 203 B 0 B 144 B
⚪ GetCepInfoByAddressError 112 B 112 B 0 B 124 B
⚪ GetCepInfoByAddressNotFoundError 205 B 205 B 0 B 145 B
⚪ GetCepInfoByAddressValidationError 203 B 203 B 0 B 144 B
🟡 addBusinessDays 9.5 KB 9.5 KB +13 B (+0.1%) 3.3 KB
⚪ capitalize 2.4 KB 2.4 KB 0 B 1.2 KB
⚪ convertCurrencyToWords 2.0 KB 2.0 KB 0 B 1.0 KB
⚪ convertDateToWords 2.4 KB 2.4 KB 0 B 1.2 KB
⚪ convertLicensePlateToMercosul 527 B 527 B 0 B 363 B
⚪ convertNumberToWords 1.6 KB 1.6 KB 0 B 819 B
🟡 differenceInBusinessDays 9.3 KB 9.3 KB +13 B (+0.1%) 3.3 KB
⚪ formatBoleto 649 B 649 B 0 B 402 B
⚪ formatCEP 470 B 470 B 0 B 334 B
⚪ formatCNPJ 620 B 620 B 0 B 420 B
⚪ formatCPF 521 B 521 B 0 B 365 B
⚪ formatCaepf 487 B 487 B 0 B 344 B
⚪ formatCei 484 B 484 B 0 B 343 B
⚪ formatCep 470 B 470 B 0 B 334 B
⚪ formatCertidao 513 B 513 B 0 B 350 B
⚪ formatCest 474 B 474 B 0 B 337 B
⚪ formatCid10 459 B 459 B 0 B 330 B
⚪ formatCnae 474 B 474 B 0 B 340 B
⚪ formatCnh 517 B 517 B 0 B 361 B
⚪ formatCno 488 B 488 B 0 B 344 B
⚪ formatCnpj 620 B 620 B 0 B 420 B
⚪ formatCns 483 B 483 B 0 B 340 B
⚪ formatCpf 521 B 521 B 0 B 365 B
⚪ formatCurrency 985 B 985 B 0 B 592 B
⚪ formatIban 267 B 267 B 0 B 228 B
⚪ formatIsbn 27.0 KB 27.0 KB 0 B 6.2 KB
⚪ formatLegalNature 470 B 470 B 0 B 337 B
⚪ formatLicensePlate 361 B 361 B 0 B 270 B
⚪ formatNbs 462 B 462 B 0 B 334 B
⚪ formatNcm 475 B 475 B 0 B 338 B
⚪ formatNfeKey 601 B 601 B 0 B 383 B
⚪ formatPassport 187 B 187 B 0 B 174 B
⚪ formatPhone 2.6 KB 2.6 KB 0 B 1.2 KB
⚪ formatPis 521 B 521 B 0 B 365 B
⚪ formatProcessoJuridico 490 B 490 B 0 B 344 B
⚪ formatSuframa 476 B 476 B 0 B 338 B
⚪ formatVoterId 523 B 523 B 0 B 365 B
⚪ generateBoleto 1.4 KB 1.4 KB 0 B 779 B
⚪ generateCNPJ 843 B 843 B 0 B 523 B
🟡 generateCPF 628 B 702 B +74 B (+11.8%) 458 B
⚪ generateCep 130 B 130 B 0 B 136 B
⚪ generateCnh 565 B 565 B 0 B 343 B
⚪ generateCnpj 843 B 843 B 0 B 523 B
🟡 generateCpf 628 B 702 B +74 B (+11.8%) 458 B
⚪ generateLegalNature 5.0 KB 5.0 KB 0 B 1.6 KB
⚪ generateLicensePlate 266 B 266 B 0 B 227 B
⚪ generatePassport 226 B 226 B 0 B 191 B
⚪ generatePhone 670 B 670 B 0 B 419 B
⚪ generatePis 357 B 357 B 0 B 272 B
⚪ generatePixPayload 4.5 KB 4.5 KB 0 B 2.0 KB
⚪ generateProcessoJuridico 821 B 821 B 0 B 523 B
⚪ generateRenavam 378 B 378 B 0 B 284 B
⚪ generateSuframa 451 B 451 B 0 B 335 B
🟡 generateVoterId 852 B 926 B +74 B (+8.7%) 587 B
⚪ getAddressInfoByCep 3.9 KB 3.9 KB 0 B 1.7 KB
⚪ getAreaCodeByMunicipalityCode 165.0 KB 165.0 KB 0 B 52.2 KB
⚪ getAreaCodeInfo 3.1 KB 3.1 KB 0 B 989 B
🟡 getAreaCodesByState 809 B 814 B +5 B (+0.6%) 463 B
⚪ getBankByCode 37.8 KB 37.8 KB 0 B 9.2 KB
⚪ getBankByIspb 37.8 KB 37.8 KB 0 B 9.2 KB
⚪ getBanks 37.6 KB 37.6 KB 0 B 9.0 KB
⚪ getBoletoInfo 2.4 KB 2.4 KB 0 B 1.2 KB
⚪ getCbo 117.3 KB 117.3 KB 0 B 29.9 KB
⚪ getCepInfoByAddress 2.0 KB 2.0 KB 0 B 1.0 KB
⚪ getCertidaoInfo 1.0 KB 1.0 KB 0 B 594 B
⚪ getCest 115.5 KB 115.5 KB 0 B 26.1 KB
⚪ getCfop 67.6 KB 67.6 KB 0 B 6.3 KB
⚪ getCid10 988.3 KB 988.3 KB 0 B 123.6 KB
🟡 getCities 153.4 KB 153.5 KB +82 B (+0.1%) 49.3 KB
⚪ getClassTrib 50.0 KB 50.0 KB 0 B 9.0 KB
⚪ getCnae 91.6 KB 91.6 KB 0 B 20.0 KB
⚪ getCnpjInfo 964 B 964 B 0 B 542 B
⚪ getCpfInfo 994 B 994 B 0 B 614 B
⚪ getCstIbsCbs 967 B 967 B 0 B 534 B
⚪ getFormatLicensePlate 315 B 315 B 0 B 245 B
⚪ getGtinInfo 821 B 821 B 0 B 558 B
🟡 getHolidays 8.4 KB 8.4 KB +9 B (+0.1%) 2.9 KB
⚪ getIbanInfo 752 B 752 B 0 B 494 B
⚪ getIsbnInfo 26.9 KB 26.9 KB 0 B 6.1 KB
⚪ getLegalNature 5.6 KB 5.6 KB 0 B 1.8 KB
⚪ getLegalNatures 5.1 KB 5.1 KB 0 B 1.6 KB
⚪ getLegalNaturesByCategory 5.6 KB 5.6 KB 0 B 1.9 KB
🟡 getMunicipalities 153.6 KB 153.7 KB +79 B (+0.1%) 49.5 KB
⚪ getMunicipalitiesByAreaCode 167.8 KB 167.8 KB 0 B 52.8 KB
🟡 getMunicipality 154.1 KB 154.1 KB +12 B (+0.0%) 49.8 KB
⚪ getMunicipalityByCode 153.8 KB 153.8 KB 0 B 49.5 KB
⚪ getNbs 80.6 KB 80.6 KB 0 B 13.1 KB
⚪ getNfeKeyInfo 2.2 KB 2.2 KB 0 B 1.2 KB
⚪ getNfseKeyInfo 2.4 KB 2.4 KB 0 B 1.2 KB
⚪ getPixKeyInfo 2.5 KB 2.5 KB 0 B 1.2 KB
⚪ getPixPayloadInfo 4.6 KB 4.6 KB 0 B 2.1 KB
⚪ getRegions 255 B 255 B 0 B 165 B
⚪ getServiceItem 26.1 KB 26.1 KB 0 B 8.4 KB
⚪ getStateByCep 3.6 KB 3.6 KB 0 B 1.0 KB
⚪ getStateByIbgeCode 2.4 KB 2.4 KB 0 B 700 B
🟢 getStateCapital 1.1 KB 959 B -129 B (-11.9%) 638 B
⚪ getStateCodeByName 2.3 KB 2.3 KB 0 B 649 B
🟡 getStateNameByCode 2.2 KB 2.2 KB +2 B (+0.1%) 594 B
⚪ getStates 2.2 KB 2.2 KB 0 B 539 B
⚪ getStatesByRegion 2.3 KB 2.3 KB 0 B 602 B
🟡 getTimezoneByState 737 B 759 B +22 B (+3.0%) 344 B
🟡 isBusinessDay 8.8 KB 8.8 KB +13 B (+0.1%) 3.1 KB
🟡 isHoliday 8.7 KB 8.7 KB +13 B (+0.1%) 3.0 KB
⚪ isValidBankAccount 5.3 KB 5.3 KB 0 B 2.4 KB
⚪ isValidBoleto 1.6 KB 1.6 KB 0 B 892 B
⚪ isValidCEP 163 B 163 B 0 B 163 B
⚪ isValidCNPJ 796 B 796 B 0 B 447 B
⚪ isValidCPF 500 B 500 B 0 B 334 B
⚪ isValidCaepf 782 B 782 B 0 B 479 B
⚪ isValidCbo 16.4 KB 16.4 KB 0 B 5.6 KB
⚪ isValidCei 714 B 714 B 0 B 472 B
⚪ isValidCep 163 B 163 B 0 B 163 B
⚪ isValidCertidao 758 B 758 B 0 B 462 B
⚪ isValidCest 7.6 KB 7.6 KB 0 B 2.3 KB
⚪ isValidCfop 2.8 KB 2.8 KB 0 B 1.4 KB
⚪ isValidCid10 26.2 KB 26.2 KB 0 B 6.8 KB
⚪ isValidClassTrib 1.8 KB 1.8 KB 0 B 639 B
⚪ isValidCnae 9.6 KB 9.6 KB 0 B 3.4 KB
⚪ isValidCnh 610 B 610 B 0 B 370 B
⚪ isValidCno 718 B 718 B 0 B 474 B
⚪ isValidCnpj 796 B 796 B 0 B 447 B
⚪ isValidCns 746 B 746 B 0 B 475 B
⚪ isValidCpf 500 B 500 B 0 B 334 B
⚪ isValidCreditCard 555 B 555 B 0 B 389 B
⚪ isValidCsosn 330 B 330 B 0 B 262 B
⚪ isValidCst 995 B 995 B 0 B 569 B
⚪ isValidCstIbsCbs 894 B 894 B 0 B 505 B
⚪ isValidEmail 171 B 171 B 0 B 157 B
⚪ isValidGtin 432 B 432 B 0 B 316 B
🟡 isValidIE 5.1 KB 5.2 KB +34 B (+0.6%) 1.8 KB
⚪ isValidIban 531 B 531 B 0 B 376 B
🟡 isValidIe 5.1 KB 5.2 KB +34 B (+0.6%) 1.8 KB
⚪ isValidIsbn 413 B 413 B 0 B 325 B
⚪ isValidLandlinePhone 717 B 717 B 0 B 463 B
⚪ isValidLegalNature 649 B 649 B 0 B 427 B
⚪ isValidLicensePlate 267 B 267 B 0 B 216 B
⚪ isValidMobilePhone 758 B 758 B 0 B 496 B
⚪ isValidNbs 8.5 KB 8.5 KB 0 B 2.3 KB
⚪ isValidNcm 82.6 KB 82.6 KB 0 B 22.8 KB
⚪ isValidNfeKey 1.6 KB 1.6 KB 0 B 954 B
⚪ isValidNfseKey 2.1 KB 2.1 KB 0 B 1.1 KB
⚪ isValidPIS 418 B 418 B 0 B 316 B
⚪ isValidPassport 197 B 197 B 0 B 186 B
⚪ isValidPhone 1.8 KB 1.8 KB 0 B 909 B
⚪ isValidPis 418 B 418 B 0 B 316 B
⚪ isValidPixKey 2.3 KB 2.3 KB 0 B 1.1 KB
⚪ isValidPixPayload 4.2 KB 4.2 KB 0 B 1.9 KB
⚪ isValidProcessoJuridico 699 B 699 B 0 B 429 B
🟡 isValidRegistroProfissional 1.2 KB 1.3 KB +90 B (+7.5%) 758 B
⚪ isValidRenavam 516 B 516 B 0 B 356 B
⚪ isValidServiceItem 1.2 KB 1.2 KB 0 B 694 B
⚪ isValidServicePhone 706 B 706 B 0 B 372 B
⚪ isValidSuframa 590 B 590 B 0 B 411 B
⚪ isValidVin 848 B 848 B 0 B 573 B
⚪ isValidVoterId 706 B 706 B 0 B 427 B
⚪ parseBoleto 247 B 247 B 0 B 215 B
⚪ parseCaepf 199 B 199 B 0 B 183 B
⚪ parseCbo 198 B 198 B 0 B 182 B
⚪ parseCei 199 B 199 B 0 B 183 B
⚪ parseCep 198 B 198 B 0 B 182 B
⚪ parseCertidao 199 B 199 B 0 B 183 B
⚪ parseCest 198 B 198 B 0 B 182 B
⚪ parseCfop 198 B 198 B 0 B 182 B
⚪ parseCid10 177 B 177 B 0 B 170 B
⚪ parseCnae 198 B 198 B 0 B 182 B
⚪ parseCnh 199 B 199 B 0 B 183 B
⚪ parseCno 199 B 199 B 0 B 183 B
⚪ parseCnpj 298 B 298 B 0 B 240 B
⚪ parseCns 199 B 199 B 0 B 184 B
⚪ parseCpf 199 B 199 B 0 B 183 B
⚪ parseCurrency 610 B 610 B 0 B 409 B
⚪ parseIban 227 B 227 B 0 B 202 B
⚪ parseIsbn 150 B 150 B 0 B 150 B
⚪ parseLegalNature 198 B 198 B 0 B 182 B
⚪ parseLicensePlate 177 B 177 B 0 B 170 B
⚪ parseNcm 198 B 198 B 0 B 182 B
⚪ parseNfeKey 412 B 412 B 0 B 312 B
⚪ parseNfseKey 253 B 253 B 0 B 219 B
⚪ parsePassport 177 B 177 B 0 B 169 B
⚪ parsePhone 370 B 370 B 0 B 281 B
⚪ parsePis 199 B 199 B 0 B 183 B
⚪ parseProcessoJuridico 199 B 199 B 0 B 182 B
⚪ parseSuframa 198 B 198 B 0 B 181 B
⚪ parseVoterId 199 B 199 B 0 B 183 B
⚪ removeAccents 99 B 99 B 0 B 119 B
🟡 subBusinessDays 9.6 KB 9.6 KB +13 B (+0.1%) 3.4 KB
⚪ toStandardSchema 284 B 284 B 0 B 233 B
How this is measured

Every export is imported alone into an esbuild consumer bundle (minified, tree-shaken) built from the head and from the base of this pull request; the sizes are the resulting bundles, gzip is their gzipped size. 🔴 marks a regression: a pre-existing export that grew more than 20% and more than 256 B, or the bundle importing every pre-existing export growing more than 5%. 🟡 is growth under the threshold, 🟢 a decrease, ⚪ no change, 🆕 an export that does not exist on the base (never a regression), 🗑️ an export that was removed. An intentional increase is accepted with the tree-shaking: accepted label.

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1118f19) to head (e13bb25).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           claude/holiday-state-code      #604   +/-   ##
===========================================================
  Coverage                     100.00%   100.00%           
===========================================================
  Files                            235       237    +2     
  Lines                           2418      2414    -4     
  Branches                         720       712    -8     
===========================================================
- Hits                            2418      2414    -4     
Flag Coverage Δ
node 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

generateCpf, generateVoterId, getMunicipalities and getCities are each keyed by the state codes
already, so they normalize the code (normalizeStateCode, trim and upper case) and look it up in
their own table (hasOwnKey) instead of bundling the list of the 27 codes: generateCpf and
generateVoterId grow by 86 B instead of 240 B and 219 B. readStateCode, for the utils that need
the list anyway, builds on normalizeStateCode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
… iframe

Ported from #595 (3d1ca00), which targets main: Edge failed twice on this branch with "Cannot
connect to the iframe" in assemble-boleto-bancario.test.ts, a file this stack does not touch.
The change is identical to #595's, so it merges cleanly whichever of the two lands first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH

Copy link
Copy Markdown
Member Author

Test on Browsers (edge) failed on both 764c484 and c947d54 with Cannot connect to the iframe in src/_internals/assemble-boleto-bancario/assemble-boleto-bancario.test.ts, a file this PR does not touch. Every test that ran passed (216 files, 7,888 tests). This is the Chromium/Edge iframe loss that #595 addresses.

#595's workflow change is ported here as f462c71 (the .github/workflows/tests.yml diff is identical, so it merges cleanly whichever of the two lands first) and merged up into #605. The push re-runs the browser jobs.


Generated by Claude Code

…ywhere

getStateCapital, getMunicipality, getTimezoneByState, getStateNameByCode and getAreaCodesByState
each trimmed and upper cased the state code by hand. They now use normalizeStateCode, and the
ones keyed by the state codes look it up with hasOwnKey in their own table (getStateCapital no
longer bundles the list of the 27 codes: -129 B). No behavior changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH

Copy link
Copy Markdown
Member Author

On 5a279f8, Test on Browsers (chrome) lost a test iframe on both attempts of the retry step:

  • Failed to fetch dynamically imported module in parse-certidao.test.ts
  • Cannot connect to the iframe in parse-cid10.test.ts

That is the Chromium/webdriverio flake. This PR's code isn't involved: all 7410 tests that ran passed, and Edge, Firefox and Safari are green on the same commit. I re-ran the failed job once. If Chrome still fails after that, I'll look at making the retry step more robust for the whole stack.


Generated by Claude Code

hyanmandian pushed a commit that referenced this pull request Sep 28, 2026
One retry was not enough: Chrome lost an iframe on both attempts in #600 and #604. The retries
now run with --no-file-parallelism, since the iframes are lost when many files load at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
isValidIe upper cased the state code but kept its whitespace, so " sp " was refused while
every other util of #604 read it as SP. It now reads the code through normalizeStateCode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
@hyanmandian
hyanmandian merged commit 1f82b56 into main Sep 29, 2026
36 of 51 checks passed
fengmk2 pushed a commit to vite-plus-ecosystem-ci/brazilian-utils-javascript that referenced this pull request Oct 6, 2026
One retry was not enough: Chrome lost an iframe on both attempts in brazilian-utils#600 and brazilian-utils#604. The retries
now run with --no-file-parallelism, since the iframes are lost when many files load at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH

This branch was successfully deployed

1 active deployment
Preview — e13bb25f Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants