Repository navigation
feat(municipalities): add getCodeByMunicipalityName - #610
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
commit: |
Tree-shaking report✅ No size regression. 1 grew, 1 new out of 195 exports.
What changed (2)
All exports (195)
How this is measuredEvery 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/license-plate-format #610 +/- ##
===============================================================
Coverage ? 100.00%
===============================================================
Files ? 238
Lines ? 2429
Branches ? 713
===============================================================
Hits ? 2429
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The IBGE code of a municipality from its name and state code, accents, cedilla and casing ignored: the offline, synchronous counterpart of the Python library's get_code_by_municipality_name. The deprecated getMunicipality name query now calls it, and its deprecation points to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
…yName as { stateCode }
The second argument is now an options object, GetCodeByMunicipalityNameOptions, exported with
the function. A missing or malformed options object returns null.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
…tate code in one object
getCodeByMunicipalityName({ municipalityName, stateCode }): both fields are
required, so one params object names them at the call site, as isValidIe's
{ value, stateCode } and getMunicipality's { municipalityName, uf } do.
Also list the new type in the public-types test and point the migration
guide and context7 at the new function for a name lookup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
bf63917 to
1dc0bab
Compare
What does this PR do?
Adds
getCodeByMunicipalityName, the offline, synchronous counterpart of the Python library'sget_code_by_municipality_name: the 7-digit IBGE code of a municipality from its name and state code.isValidIe's{ value, stateCode }does. The type is exported asGetCodeByMunicipalityNameParams.null.getMunicipalityname query now delegates to it, and its deprecation note points here.getMunicipalitykeeps itsuffield for compatibility.context7.jsonand the getting-started bundle size are updated.Stacked on the license-plate PR.
Checklist
npm test).docs/utilities.mdanddocs/pt-br/utilities.md.npm run checkpasses locally (format, lint, types).npm run build:llms.Additional context
It uses the municipality table already shipped in the package, so there is no new data.
getMunicipalitybehaves as before.🤖 Generated with Claude Code
https://claude.ai/code/session_01RLkm9YrtAifc6XCLFVEsdH
Generated by Claude Code