0.0.1-next.0 • Published 3 years ago
@standardsets/us-states v0.0.1-next.0
Utilities for querying U.S. States names, and their equivalent variations/abbreviations.
Install
Via npm
npm install -S @standardsets/us-statesVia Yarn
yarn add @standardsets/us-statesDataset Options
Variations
Passing the appropriate variation.key (enumerator VariationKey) is how either
lists of U.S. State names are returned in the requested variation, or allow for
one variation to be returned in another format (ex. fullName → postalCode
or postalCode → fullName)
fullName|VariationKey.FULL_NAME(default) - Full U.S. name, capitalized.postalCode|VariationKey.POSTAL_CODE- 2-letter codes by the United States Postal ServiceapStyle|VariationKey.AP_STYLE- Name abbreviations from the AP StylebookgpoStyle|VairationKey.GPO_STYLE- Official US Government Printing Office abbreviations
How to use
import { getAlternate, VariationKey } from '@standardsets/us-states'
const postalCode = getAlternate('Ohio', VariationKey.POSTAL_CODE)
console.debug(postalCode) // Outputs: 'OH'Methods
getVariations- Listing of available variations for the current data set.getVariationItems- Query data set and return the specified variation items. Defaults tofullName.getItemVariation- Allows for swapping one variation for another. (ex.fullName→postalCode|Ohio→OH)
License
0.0.1-next.4
3 years ago
0.0.1-next.3
3 years ago
0.0.1-next.2
3 years ago
0.0.1-next.1
3 years ago
0.0.1-next.0
3 years ago