|
1 | | -const usaStates = [ |
2 | | - { name: "Alabama", abbreviation: "AL", territory: false }, |
3 | | - { name: "Alaska", abbreviation: "AK", territory: false }, |
4 | | - { name: "American Samoa", abbreviation: "AS", territory: true }, |
5 | | - { name: "Arizona", abbreviation: "AZ", territory: false }, |
6 | | - { name: "Arkansas", abbreviation: "AR", territory: false }, |
7 | | - { name: "California", abbreviation: "CA", territory: false }, |
8 | | - { name: "Colorado", abbreviation: "CO", territory: false }, |
9 | | - { name: "Connecticut", abbreviation: "CT", territory: false }, |
10 | | - { name: "Delaware", abbreviation: "DE", territory: false }, |
11 | | - { name: "District Of Columbia", abbreviation: "DC", territory: false }, |
12 | | - { name: "Florida", abbreviation: "FL", territory: false }, |
13 | | - { name: "Georgia", abbreviation: "GA", territory: false }, |
14 | | - { name: "Guam", abbreviation: "GU", territory: true }, |
15 | | - { name: "Hawaii", abbreviation: "HI", territory: false }, |
16 | | - { name: "Idaho", abbreviation: "ID", territory: false }, |
17 | | - { name: "Illinois", abbreviation: "IL", territory: false }, |
18 | | - { name: "Indiana", abbreviation: "IN", territory: false }, |
19 | | - { name: "Iowa", abbreviation: "IA", territory: false }, |
20 | | - { name: "Kansas", abbreviation: "KS", territory: false }, |
21 | | - { name: "Kentucky", abbreviation: "KY", territory: false }, |
22 | | - { name: "Louisiana", abbreviation: "LA", territory: false }, |
23 | | - { name: "Maine", abbreviation: "ME", territory: false }, |
24 | | - { name: "Maryland", abbreviation: "MD", territory: false }, |
25 | | - { name: "Massachusetts", abbreviation: "MA", territory: false }, |
26 | | - { name: "Michigan", abbreviation: "MI", territory: false }, |
27 | | - { name: "Minnesota", abbreviation: "MN", territory: false }, |
28 | | - { name: "Mississippi", abbreviation: "MS", territory: false }, |
29 | | - { name: "Missouri", abbreviation: "MO", territory: false }, |
30 | | - { name: "Montana", abbreviation: "MT", territory: false }, |
31 | | - { name: "Nebraska", abbreviation: "NE", territory: false }, |
32 | | - { name: "Nevada", abbreviation: "NV", territory: false }, |
33 | | - { name: "New Hampshire", abbreviation: "NH", territory: false }, |
34 | | - { name: "New Jersey", abbreviation: "NJ", territory: false }, |
35 | | - { name: "New Mexico", abbreviation: "NM", territory: false }, |
36 | | - { name: "New York", abbreviation: "NY", territory: false }, |
37 | | - { name: "North Carolina", abbreviation: "NC", territory: false }, |
38 | | - { name: "North Dakota", abbreviation: "ND", territory: false }, |
39 | | - { name: "Northern Mariana Islands", abbreviation: "MP", territory: true }, |
40 | | - { name: "Ohio", abbreviation: "OH", territory: false }, |
41 | | - { name: "Oklahoma", abbreviation: "OK", territory: false }, |
42 | | - { name: "Oregon", abbreviation: "OR", territory: false }, |
43 | | - { name: "Pennsylvania", abbreviation: "PA", territory: false }, |
44 | | - { name: "Puerto Rico", abbreviation: "PR", territory: true }, |
45 | | - { name: "Rhode Island", abbreviation: "RI", territory: false }, |
46 | | - { name: "South Carolina", abbreviation: "SC", territory: false }, |
47 | | - { name: "South Dakota", abbreviation: "SD", territory: false }, |
48 | | - { name: "Tennessee", abbreviation: "TN", territory: false }, |
49 | | - { name: "Texas", abbreviation: "TX", territory: false }, |
50 | | - { name: "Utah", abbreviation: "UT", territory: false }, |
51 | | - { name: "Vermont", abbreviation: "VT", territory: false }, |
52 | | - { name: "Virgin Islands", abbreviation: "VI", territory: true }, |
53 | | - { name: "Virginia", abbreviation: "VA", territory: false }, |
54 | | - { name: "Washington", abbreviation: "WA", territory: false }, |
55 | | - { name: "West Virginia", abbreviation: "WV", territory: false }, |
56 | | - { name: "Wisconsin", abbreviation: "WI", territory: false }, |
57 | | - { name: "Wyoming", abbreviation: "WY", territory: false }, |
58 | | -] as const; |
59 | | - |
60 | 1 | /** |
61 | | - * Jurisdictions, a.k.a. US States and territories. |
| 2 | + * Jurisdictions, a.k.a. US States and territories, keyed by lowercase |
| 3 | + * abbreviation (matching content collection jurisdiction IDs). |
62 | 4 | */ |
63 | | -export const JURISDICTIONS = usaStates.reduce( |
64 | | - (acc, state) => { |
65 | | - acc[state.abbreviation] = state.name; |
66 | | - return acc; |
| 5 | +export const JURISDICTIONS = { |
| 6 | + al: { name: "Alabama", territory: false, namesakeSupport: "none" }, |
| 7 | + ak: { name: "Alaska", territory: false, namesakeSupport: "none" }, |
| 8 | + as: { name: "American Samoa", territory: true, namesakeSupport: "none" }, |
| 9 | + az: { name: "Arizona", territory: false, namesakeSupport: "none" }, |
| 10 | + ar: { name: "Arkansas", territory: false, namesakeSupport: "none" }, |
| 11 | + ca: { name: "California", territory: false, namesakeSupport: "none" }, |
| 12 | + co: { name: "Colorado", territory: false, namesakeSupport: "none" }, |
| 13 | + ct: { name: "Connecticut", territory: false, namesakeSupport: "none" }, |
| 14 | + de: { name: "Delaware", territory: false, namesakeSupport: "none" }, |
| 15 | + dc: { |
| 16 | + name: "District of Columbia", |
| 17 | + territory: false, |
| 18 | + namesakeSupport: "none", |
67 | 19 | }, |
68 | | - {} as Record<string, string>, |
69 | | -); |
70 | | - |
71 | | -export type Jurisdiction = (typeof usaStates)[number]["abbreviation"]; |
| 20 | + fl: { name: "Florida", territory: false, namesakeSupport: "none" }, |
| 21 | + ga: { name: "Georgia", territory: false, namesakeSupport: "none" }, |
| 22 | + gu: { name: "Guam", territory: true, namesakeSupport: "none" }, |
| 23 | + hi: { name: "Hawaii", territory: false, namesakeSupport: "none" }, |
| 24 | + id: { name: "Idaho", territory: false, namesakeSupport: "none" }, |
| 25 | + il: { name: "Illinois", territory: false, namesakeSupport: "prioritized" }, |
| 26 | + in: { name: "Indiana", territory: false, namesakeSupport: "none" }, |
| 27 | + ia: { name: "Iowa", territory: false, namesakeSupport: "none" }, |
| 28 | + ks: { name: "Kansas", territory: false, namesakeSupport: "none" }, |
| 29 | + ky: { name: "Kentucky", territory: false, namesakeSupport: "none" }, |
| 30 | + la: { name: "Louisiana", territory: false, namesakeSupport: "none" }, |
| 31 | + me: { name: "Maine", territory: false, namesakeSupport: "none" }, |
| 32 | + md: { name: "Maryland", territory: false, namesakeSupport: "none" }, |
| 33 | + ma: { name: "Massachusetts", territory: false, namesakeSupport: "full" }, |
| 34 | + mi: { name: "Michigan", territory: false, namesakeSupport: "none" }, |
| 35 | + mn: { name: "Minnesota", territory: false, namesakeSupport: "none" }, |
| 36 | + ms: { name: "Mississippi", territory: false, namesakeSupport: "none" }, |
| 37 | + mo: { name: "Missouri", territory: false, namesakeSupport: "none" }, |
| 38 | + mt: { name: "Montana", territory: false, namesakeSupport: "none" }, |
| 39 | + ne: { name: "Nebraska", territory: false, namesakeSupport: "none" }, |
| 40 | + nv: { name: "Nevada", territory: false, namesakeSupport: "none" }, |
| 41 | + nh: { name: "New Hampshire", territory: false, namesakeSupport: "none" }, |
| 42 | + nj: { name: "New Jersey", territory: false, namesakeSupport: "none" }, |
| 43 | + nm: { name: "New Mexico", territory: false, namesakeSupport: "none" }, |
| 44 | + ny: { name: "New York", territory: false, namesakeSupport: "prioritized" }, |
| 45 | + nc: { name: "North Carolina", territory: false, namesakeSupport: "none" }, |
| 46 | + nd: { name: "North Dakota", territory: false, namesakeSupport: "none" }, |
| 47 | + mp: { |
| 48 | + name: "Northern Mariana Islands", |
| 49 | + territory: true, |
| 50 | + namesakeSupport: "none", |
| 51 | + }, |
| 52 | + oh: { name: "Ohio", territory: false, namesakeSupport: "none" }, |
| 53 | + ok: { name: "Oklahoma", territory: false, namesakeSupport: "none" }, |
| 54 | + or: { name: "Oregon", territory: false, namesakeSupport: "none" }, |
| 55 | + pa: { name: "Pennsylvania", territory: false, namesakeSupport: "none" }, |
| 56 | + pr: { name: "Puerto Rico", territory: true, namesakeSupport: "none" }, |
| 57 | + ri: { name: "Rhode Island", territory: false, namesakeSupport: "full" }, |
| 58 | + sc: { name: "South Carolina", territory: false, namesakeSupport: "none" }, |
| 59 | + sd: { name: "South Dakota", territory: false, namesakeSupport: "none" }, |
| 60 | + tn: { name: "Tennessee", territory: false, namesakeSupport: "none" }, |
| 61 | + tx: { name: "Texas", territory: false, namesakeSupport: "none" }, |
| 62 | + ut: { name: "Utah", territory: false, namesakeSupport: "none" }, |
| 63 | + vt: { name: "Vermont", territory: false, namesakeSupport: "none" }, |
| 64 | + vi: { name: "Virgin Islands", territory: true, namesakeSupport: "none" }, |
| 65 | + va: { name: "Virginia", territory: false, namesakeSupport: "none" }, |
| 66 | + wa: { name: "Washington", territory: false, namesakeSupport: "none" }, |
| 67 | + wv: { name: "West Virginia", territory: false, namesakeSupport: "none" }, |
| 68 | + wi: { name: "Wisconsin", territory: false, namesakeSupport: "none" }, |
| 69 | + wy: { name: "Wyoming", territory: false, namesakeSupport: "none" }, |
| 70 | +} as const satisfies Record< |
| 71 | + string, |
| 72 | + { |
| 73 | + name: string; |
| 74 | + territory: boolean; |
| 75 | + namesakeSupport: "full" | "prioritized" | "none"; |
| 76 | + } |
| 77 | +>; |
72 | 78 |
|
73 | | -/** Lowercase state/territory abbreviation, matching content collection state IDs. */ |
74 | | -export type StateId = Lowercase<Jurisdiction>; |
| 79 | +/** Lowercase state/territory abbreviation, matching content collection jurisdiction IDs. */ |
| 80 | +export type JurisdictionId = keyof typeof JURISDICTIONS; |
0 commit comments