feat: adiciona função findAddress para busca por endereço#272
Open
mateus-araujo wants to merge 10 commits into
Open
feat: adiciona função findAddress para busca por endereço#272mateus-araujo wants to merge 10 commits into
mateus-araujo wants to merge 10 commits into
Conversation
- normalizeString: normalize strings for URLs - compareStrings: compare strings with normalization - convertViaCEPAddress: convert ViaCEP format to library format - isNumberAtComplementPattern: check number patterns in complements - selectAddressFromList: select best address match from list
- Add fetchViaCepAddressSearch function - Update services index with getAvailableAddressSearchServices - Supports search by state/city/street
- Export findAddress from main entry point - Supports multiple providers (concurrent queries) - Validation for state, city, street - Provider selection via providers parameter - Returns addresses list and selectedAddress
- 12 unit tests following project patterns - Test fixtures for address search - Cover validation, success, and error cases
- Add findAddress examples to README.md - Add TypeScript definitions for findAddress - Document providers parameter
- Rebuild with findAddress function - Update minified versions - Update package-lock.json
- Replace nested ternaries with if/else statements - Extract helper functions for better organization - Add comments to explain the logic - Make the code easier to understand and maintain
wellwelwel
reviewed
May 1, 2026
027c571 to
733819d
Compare
- normalizeString: accent removal, special chars, empty/null handling - compareStrings: exact match, partial match, no match - convertViaCEPAddress: format conversion - isNumberAtComplementPattern: pattern matching
wellwelwel
reviewed
May 1, 2026
Contributor
There was a problem hiding this comment.
Opá! Eu não faço parte do repositório, mas gostei da ideia/feature 😅
Vi que as mudanças não são tão grandes quanto parecem:
@mateus-araujo, tem algum motivo do porque modificar o package-lock.json junto nesse PR? Se for por questão de dependências desatualizadas, eu recomendaria fazer isso em um PR separado, mas vale esperar pelos mantenedores 🙋🏻♂️
712baf1 to
adb71ad
Compare
- Simplify isNumberAtComplementPattern with better regex - Fix selectAddressFromList filtering logic - Add comprehensive tests for all code paths - Cover even/odd lado selection, pattern matching, fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Descrição
Esta PR adiciona a função
findAddressque permite buscar endereços brasileiros utilizando estado, cidade e rua, não apenas por CEP.A implementação foi baseada na biblioteca cep-address-finder do próprio autor, trazendo a funcionalidade para o
cep-promisecom suporte a múltiplos provedores.Principais mudanças
findAddress: Permite buscar endereços informando estado, cidade e ruacep)Exemplo de uso
Commits
Checklist