Skip to content

v0.2.0 — IsValidSubdivision

Latest

Choose a tag to compare

@prodigeris prodigeris released this 15 May 17:25
· 1 commit to master since this release
3f566dc

Adds IsValidSubdivision(country, state) and SubdivisionsOf(country) — a validator API derived from the existing city resolver data. Where ResolveState answers "what region is this city in?", IsValidSubdivision answers "is this state code something geonames could produce for this country?"

Use case: catching legacy data (raw INSEE numerics, US codes paired with non-US countries, etc.) at the write boundary, when the geonames data itself is the source of truth for what's valid.

See #8 for full context.