Repository navigation
Feature/5 geoloc valid - #19
akhilapnuri wants to merge 8 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
amanuelabiy
left a comment
There was a problem hiding this comment.
Checked against the Census API with Rockville addresses outside city limits. Made one non-blocking nit for the isRockvilleResident function. Approving.
| export const isRockvilleResident = async ( | ||
| address: string, | ||
| ): Promise<boolean | null> => { | ||
| const trimmed = address.trim(); |
There was a problem hiding this comment.
Non-blocking: This runs outside of the try. This means a non-string value from untyped data would throw. Moving it inside the try makes "never throws" fully true.
Pull Request
Summary
isRockvilleResident(address) implemented in geocode.ts. Uses US Census Geocoder to check whether an address is inside Rockville city limits. Returns true if address is in Rockville, false if different place, and null if empty address, timeout, error response, etc. Matches on GEOID 2467675 so Rockville from different states don't count. Checks all address matches. 12 unit tests written.
Unit tests:
pnpm install
pnpm vitest run geocode
You should see 12 tests pass.
Type of Change
Related Issues (put task name here from notion)
Screenshots (If it is a front end feature screenshot is required)
Additional Notes