2.3.8 • Published 12 months ago

@zerodep/geo-state v2.3.8

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@zerodep/geo-state

version language types license

CodeFactor Known Vulnerabilities

A parser to get state abbreviation and information from a state name or abbreviation; it will throw a ZeroDepError if the guard fails.

Full documentation is available at the zerodep.app page.

Examples

geoStateIso Examples

geoStateIso('n.y.'); // ['NY', 'US']
geoStateIso('oreg'); // ['OR', 'US']
geoStateIso('alberta'); // ['AB', 'CA']

geoState Examples

geoState(['utah']);
// {
//   stateName: 'Utah',
//   stateAbbr: 'UT',
//   stateFips: '49',
//   regionCensus: 'West',
//   regionDivision: 'Mountain',
//   regionBea: 'Rocky Mountain',
//   countryName: 'United States',
//   countryIso2: 'US',
// }

geoState('bc');
// {
//   stateName: 'British Columbia',
//   stateAbbr: 'BC',
//   stateFips: '00',
//   regionCensus: undefined,
//   regionDivision: undefined,
//   regionBea: undefined,
//   countryName: 'Canada',
//   countryIso2: 'CA',
// }

Unsuccessful Cases

geoStateIso('unknown'); // thows ZeroDepError: Could not find a state or province for "UNKNOWN"

geoState('unknown'); // thows ZeroDepError: Could not find a state or province for "UNKNOWN"
2.3.8

12 months ago

2.3.6

12 months ago

2.3.7

12 months ago

2.3.4

1 year ago

2.3.2

1 year ago

2.3.1

2 years ago

2.3.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago