https://github.com/marekrozmus/zuora-codes
Mappings of US State/Canadian Province to Name and back again 🧙
https://github.com/marekrozmus/zuora-codes
mappings provinces states zuora
Last synced: 5 months ago
JSON representation
Mappings of US State/Canadian Province to Name and back again 🧙
- Host: GitHub
- URL: https://github.com/marekrozmus/zuora-codes
- Owner: marekrozmus
- License: mit
- Created: 2021-11-08T21:16:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-05T23:08:39.000Z (over 4 years ago)
- Last Synced: 2025-10-18T23:05:20.869Z (8 months ago)
- Topics: mappings, provinces, states, zuora
- Language: TypeScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zuora-codes
Mappings of US State/Canadian Province to Name and back again 🧙
Based on:
- [United States Standard State Codes](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/D_Country%2C_State%2C_and_Province_Codes/B_State_Names_and_2-Digit_Codes)
- [Zuora Knowledge Base - Canadian Standard Province Codes](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/D_Country%2C_State%2C_and_Province_Codes/C_Canadian_Province_Names_and_2-Digit_Codes)
## Installation
```bash
npm install zuora-codes
# or via yarn
yarn add zuora-codes
```
## Usage
### getUnitedStatesStateCode
Gets US state code by state's name or throws an error if state name is incorrect.
##### Type signature
```typescript
(stateCode: UnitedStatesStateName | string) => string;
```
### getUnitedStatesStateName
Gets US state name by state's code or throws an error if state code is incorrect.
##### Type signature
```typescript
(stateCode: UnitedStatesStateCode | string) => string;
```
### getCanadianProvinceCode
Gets Canadian province code by province's name or throws an error if province name is incorrect.
##### Type signature
```typescript
(stateCode: CanadianProvinceName | string) => string;
```
### getCanadianProvinceName
Gets Canadian province name by province's code or throws an error if province code is incorrect.
##### Type signature
```typescript
(stateCode: CanadianProvinceCode | string) => string;
```