@mailwoman/tiger 4.16.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/block-group.ts +2 -3
  2. package/class-code.ts +268 -318
  3. package/constants.ts +2 -4
  4. package/county-subdivision.ts +3 -4
  5. package/county.ts +2 -3
  6. package/files.ts +1 -0
  7. package/functional-status.ts +4 -6
  8. package/geoid.ts +20 -18
  9. package/legal-statistical-area.ts +4 -6
  10. package/out/block-group.d.ts +2 -3
  11. package/out/block-group.d.ts.map +1 -1
  12. package/out/class-code.d.ts +268 -318
  13. package/out/class-code.d.ts.map +1 -1
  14. package/out/class-code.js +268 -318
  15. package/out/class-code.js.map +1 -1
  16. package/out/constants.d.ts +2 -4
  17. package/out/constants.d.ts.map +1 -1
  18. package/out/county-subdivision.d.ts +3 -4
  19. package/out/county-subdivision.d.ts.map +1 -1
  20. package/out/county.d.ts +2 -3
  21. package/out/county.d.ts.map +1 -1
  22. package/out/county.js.map +1 -1
  23. package/out/files.d.ts.map +1 -1
  24. package/out/files.js.map +1 -1
  25. package/out/functional-status.d.ts +4 -6
  26. package/out/functional-status.d.ts.map +1 -1
  27. package/out/functional-status.js +4 -6
  28. package/out/functional-status.js.map +1 -1
  29. package/out/geoid.d.ts +15 -15
  30. package/out/geoid.d.ts.map +1 -1
  31. package/out/geoid.js +3 -4
  32. package/out/geoid.js.map +1 -1
  33. package/out/legal-statistical-area.d.ts +4 -6
  34. package/out/legal-statistical-area.d.ts.map +1 -1
  35. package/out/legal-statistical-area.js +4 -6
  36. package/out/legal-statistical-area.js.map +1 -1
  37. package/out/sdk/fetch.d.ts +3 -6
  38. package/out/sdk/fetch.d.ts.map +1 -1
  39. package/out/sdk/fetch.js +3 -4
  40. package/out/sdk/fetch.js.map +1 -1
  41. package/out/sdk/redistricting.d.ts +1 -2
  42. package/out/sdk/redistricting.d.ts.map +1 -1
  43. package/out/sdk/redistricting.js +3 -4
  44. package/out/sdk/redistricting.js.map +1 -1
  45. package/out/sdk/schema.d.ts +12 -12
  46. package/out/sdk/schema.js +9 -9
  47. package/out/sdk/state/block-operations.d.ts +1 -2
  48. package/out/sdk/state/block-operations.d.ts.map +1 -1
  49. package/out/sdk/state/block-operations.js +1 -2
  50. package/out/sdk/state/block-operations.js.map +1 -1
  51. package/out/state.d.ts +10 -12
  52. package/out/state.d.ts.map +1 -1
  53. package/out/state.js +8 -10
  54. package/out/state.js.map +1 -1
  55. package/out/tabulation-block.d.ts +2 -2
  56. package/out/tabulation-block.d.ts.map +1 -1
  57. package/out/tabulation-block.js.map +1 -1
  58. package/out/tract.d.ts +2 -2
  59. package/out/tract.d.ts.map +1 -1
  60. package/out/tract.js.map +1 -1
  61. package/out/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +18 -18
  63. package/sdk/fetch.ts +21 -8
  64. package/sdk/redistricting.ts +14 -4
  65. package/sdk/schema.ts +12 -12
  66. package/sdk/state/block-operations.ts +1 -2
  67. package/state.ts +11 -12
  68. package/tabulation-block.ts +3 -2
  69. package/tract.ts +3 -2
package/constants.ts CHANGED
@@ -166,11 +166,9 @@ export interface TIGERPropertyRecord<GeoID extends string = string> {
166
166
  [TIGERProperty.UrbanRuralCode]: TIGERGeographicClassification
167
167
 
168
168
  /**
169
- * A code indicating a specific urban area, such as a specific city, or a specific region of
170
- * cities.
169
+ * A code indicating a specific urban area, such as a specific city, or a specific region of cities.
171
170
  *
172
- * For example, 23824 references Detroit, MI. 63217 references the region of New York City, Jersey
173
- * City, and Newark.
171
+ * For example, 23824 references Detroit, MI. 63217 references the region of New York City, Jersey City, and Newark.
174
172
  *
175
173
  * @title Urban Area Code
176
174
  * @minLength 5
@@ -39,22 +39,22 @@ export interface TIGERCountySubdivision {
39
39
  COUSUBFP: string
40
40
 
41
41
  /**
42
- * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
43
42
  * @title County Subdivision GNIS Code
44
43
  *
45
44
  * @minLength 8
46
45
  * @maxLength 8
47
46
  * @pattern ^\d{8}$
47
+ * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
48
48
  */
49
49
  COUSUBNS: string
50
50
  /**
51
51
  * Concatenation of current state FIPS code, county FIPS code, and county subdivision FIPS code.
52
52
  *
53
- * @see {@link https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html | Census: GeoID}
54
53
  * @title County Sub-division Identifier
55
54
  * @minLength 10
56
55
  * @maxLength 20
57
56
  * @pattern ^\d{10,20}$
57
+ * @see {@link https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html | Census: GeoID}
58
58
  */
59
59
  GEOID: string
60
60
 
@@ -69,8 +69,7 @@ export interface TIGERCountySubdivision {
69
69
  GEOIDFQ: string
70
70
 
71
71
  /**
72
- * Current name and the translated legal/statistical area description code for county
73
- * sub-division.
72
+ * Current name and the translated legal/statistical area description code for county sub-division.
74
73
  *
75
74
  * @title Name/Legal Statistical Area Description
76
75
  * @minLength 1
package/county.ts CHANGED
@@ -28,12 +28,12 @@ export interface TIGERCounty {
28
28
  COUNTYFP: string
29
29
 
30
30
  /**
31
- * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
32
31
  * @title County GNIS Code
33
32
  *
34
33
  * @minLength 8
35
34
  * @maxLength 8
36
35
  * @pattern ^\d{8}$
36
+ * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
37
37
  */
38
38
  GEOID: string
39
39
 
@@ -48,8 +48,7 @@ export interface TIGERCounty {
48
48
  GEOIDFQ: string
49
49
 
50
50
  /**
51
- * Current name and the translated legal/statistical area description code for county
52
- * sub-division.
51
+ * Current name and the translated legal/statistical area description code for county sub-division.
53
52
  *
54
53
  * @title Name/Legal Statistical Area Description
55
54
  * @minLength 1
package/files.ts CHANGED
@@ -156,6 +156,7 @@ export function TIGERNationZIPPath<Vintage extends number = TIGERCurrentVintage>
156
156
  const fileName = `tl_${vintage}_${TIGERLevel.State}${TIGERFileExtension.Zip}` as const
157
157
 
158
158
  const path = `/geo/tiger/TIGER${vintage}/STATE/${fileName}` as const
159
+
159
160
  // https://www2.census.gov/geo/tiger/TIGER2023/STATE/tl_2023_us_state.zip
160
161
 
161
162
  return path
@@ -11,13 +11,12 @@
11
11
  */
12
12
  export enum TIGERFunctionalStatus {
13
13
  /**
14
- * Active government providing primary general-purpose functions. Active entity (federally
15
- * recognized entities only).
14
+ * Active government providing primary general-purpose functions. Active entity (federally recognized entities only).
16
15
  */
17
16
  ActiveGovernment = "A",
18
17
  /**
19
- * Active government that is partially consolidated with another government but with separate
20
- * officials providing primary general-purpose functions.
18
+ * Active government that is partially consolidated with another government but with separate officials providing
19
+ * primary general-purpose functions.
21
20
  */
22
21
  PartiallyConsolidatedActiveGovernment = "B",
23
22
  /**
@@ -41,8 +40,7 @@ export enum TIGERFunctionalStatus {
41
40
  */
42
41
  InActiveGovernmentalUnit = "I",
43
42
  /**
44
- * Inactive, nonfunctioning legal real property entity with potential quasi-legal administrative
45
- * functions.
43
+ * Inactive, nonfunctioning legal real property entity with potential quasi-legal administrative functions.
46
44
  */
47
45
  InactiveNonFunctioningLegalRealPropertyEntity = "L",
48
46
  /**
package/geoid.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { Tagged } from "type-fest"
8
+
8
9
  import { AdminLevel1Code, FIPSStateCode } from "./state.js"
9
10
 
10
11
  //#region Tagged FIPS types
@@ -22,12 +23,12 @@ import { AdminLevel1Code, FIPSStateCode } from "./state.js"
22
23
  * @category Census
23
24
  * @category FIPS
24
25
  * @type {string}
25
- * @see {@linkcode FIPSBlockGroupCode} for a less specific level.
26
- * @see {@linkcode FIPSBlockGeoID} for the full GeoID.
27
26
  * @pattern ^\d{4}$
28
27
  * @minLength 4
29
28
  * @maxLength 4
30
29
  * @title FIPS Block Code
30
+ * @see {@linkcode FIPSBlockGroupCode} for a less specific level.
31
+ * @see {@linkcode FIPSBlockGeoID} for the full GeoID.
31
32
  */
32
33
  export type FIPSBlockCode = Tagged<string, "FIPSBlockCode">
33
34
 
@@ -44,11 +45,11 @@ export type FIPSBlockCode = Tagged<string, "FIPSBlockCode">
44
45
  * @category Census
45
46
  * @category FIPS
46
47
  * @type {string}
47
- * @see {@linkcode FIPSBlockCode} for the 4-digit version.
48
48
  * @pattern ^\d{15}$
49
49
  * @minLength 15
50
50
  * @maxLength 15
51
51
  * @title FIPS Block Geo ID
52
+ * @see {@linkcode FIPSBlockCode} for the 4-digit version.
52
53
  */
53
54
  export type FIPSBlockGeoID = Tagged<string, "FIPSBlockGeoID">
54
55
 
@@ -65,12 +66,12 @@ export type FIPSBlockGeoID = Tagged<string, "FIPSBlockGeoID">
65
66
  * @category Census
66
67
  * @category FIPS
67
68
  * @type {string}
68
- * @see {@linkcode FIPSBlockCode} for a more specific level.
69
- * @see {@linkcode FIPSTractCode} for a less specific level.
70
69
  * @pattern ^\d{1}$
71
70
  * @minLength 1
72
71
  * @maxLength 1
73
72
  * @title FIPS Block Group Code
73
+ * @see {@linkcode FIPSBlockCode} for a more specific level.
74
+ * @see {@linkcode FIPSTractCode} for a less specific level.
74
75
  */
75
76
  export type FIPSBlockGroupCode = Tagged<string, "FIPSBlockGroupCode">
76
77
 
@@ -87,12 +88,12 @@ export type FIPSBlockGroupCode = Tagged<string, "FIPSBlockGroupCode">
87
88
  * @category Census
88
89
  * @category FIPS
89
90
  * @type {string}
90
- * @see {@linkcode FIPSBlockGroupCode} for a more specific level.
91
- * @see {@linkcode FIPSCountySubDivisionCode} for a less specific level.
92
91
  * @pattern ^\d{6}$
93
92
  * @minLength 6
94
93
  * @maxLength 6
95
94
  * @title FIPS Tract Code
95
+ * @see {@linkcode FIPSBlockGroupCode} for a more specific level.
96
+ * @see {@linkcode FIPSCountySubDivisionCode} for a less specific level.
96
97
  */
97
98
  export type FIPSTractCode = Tagged<string, "FIPSTractCode">
98
99
 
@@ -109,11 +110,11 @@ export type FIPSTractCode = Tagged<string, "FIPSTractCode">
109
110
  * @category Census
110
111
  * @category FIPS
111
112
  * @type {string}
112
- * @see {@linkcode FIPSBlockCode} for the 4-digit version.
113
113
  * @pattern ^\d{6}$
114
114
  * @minLength 6
115
115
  * @maxLength 6
116
116
  * @title FIPS Tract Geo ID
117
+ * @see {@linkcode FIPSBlockCode} for the 4-digit version.
117
118
  */
118
119
  export type FIPSTractGeoID = Tagged<string, "FIPSTractGeoID">
119
120
 
@@ -130,12 +131,12 @@ export type FIPSTractGeoID = Tagged<string, "FIPSTractGeoID">
130
131
  * @category Census
131
132
  * @category FIPS
132
133
  * @type {string}
133
- * @see {@linkcode FIPSTractCode} for a more specific level.
134
- * @see {@linkcode FIPSCountyCode} for a less specific level.
135
134
  * @pattern ^\d{5}$
136
135
  * @minLength 5
137
136
  * @maxLength 5
138
137
  * @title FIPS County Sub-Division Code
138
+ * @see {@linkcode FIPSTractCode} for a more specific level.
139
+ * @see {@linkcode FIPSCountyCode} for a less specific level.
139
140
  */
140
141
  export type FIPSCountySubDivisionCode = Tagged<string, "FIPSCountySubDivisionCode">
141
142
 
@@ -151,12 +152,12 @@ export type FIPSCountySubDivisionCode = Tagged<string, "FIPSCountySubDivisionCod
151
152
  * @category Census
152
153
  * @category FIPS
153
154
  * @type {string}
154
- * @see {@linkcode FIPSCountySubDivisionCode} for a more specific level.
155
- * @see {@linkcode AdminLevel1Code} for a less specific level.
156
155
  * @pattern ^\d{3}$
157
156
  * @minLength 3
158
157
  * @maxLength 3
159
158
  * @title FIPS County Code
159
+ * @see {@linkcode FIPSCountySubDivisionCode} for a more specific level.
160
+ * @see {@linkcode AdminLevel1Code} for a less specific level.
160
161
  */
161
162
  export type FIPSCountyCode = Tagged<string, "FIPSCountyCode">
162
163
 
@@ -191,12 +192,12 @@ export type FIPSPlaceCode = Tagged<string, "FIPSPlaceCode">
191
192
  * @category Census
192
193
  * @category FIPS
193
194
  * @type {string}
194
- * @see {@linkcode AdminLevel1Code} for a less specific level.
195
- * @see {@linkcode FIPSPlaceCode} for a more specific level.
196
195
  * @pattern ^\d{2}$
197
196
  * @minLength 2
198
197
  * @maxLength 2
199
198
  * @title FIPS Congressional District Code
199
+ * @see {@linkcode AdminLevel1Code} for a less specific level.
200
+ * @see {@linkcode FIPSPlaceCode} for a more specific level.
200
201
  */
201
202
  export type FIPSCongressionalDistrictCode = Tagged<string, "FIPSConressionalDistrictCode">
202
203
 
@@ -449,8 +450,8 @@ export class GeoIDInputMatcher<T extends GeoIDPart[] = GeoIDPart[]> {
449
450
  /**
450
451
  * Record of GeoID input matchers, i.e. a pattern and parser for each grouping of GeoID components.
451
452
  *
452
- * @see {@linkcode GeoIDComponentMatchers} for the component-level matchers.
453
453
  * @internal
454
+ * @see {@linkcode GeoIDComponentMatchers} for the component-level matchers.
454
455
  */
455
456
  export const GeoIDInputMatchers = {
456
457
  [GeoIDPart.Block]: new GeoIDInputMatcher(
@@ -502,8 +503,8 @@ export const GeoIDInputMatchers = {
502
503
  /**
503
504
  * A record of GeoID component matchers, i.e. a pattern and parser for each GeoID component.
504
505
  *
505
- * @see {@linkcode GeoIDInputMatchers} for the input-level matchers.
506
506
  * @internal
507
+ * @see {@linkcode GeoIDInputMatchers} for the input-level matchers.
507
508
  */
508
509
  const GeoIDComponentMatchers = Object.fromEntries(
509
510
  Object.values(GeoIDPart).map((value) => {
@@ -516,6 +517,7 @@ const GeoIDComponentMatchers = Object.fromEntries(
516
517
  */
517
518
  export function isGeoIDComponent<T extends GeoIDPart>(component: T, input: unknown): input is GeoIDPartMapping[T] {
518
519
  if (!input) return false
520
+
519
521
  if (typeof input !== "string") return false
520
522
 
521
523
  const matcher = GeoIDComponentMatchers[component]
@@ -528,8 +530,7 @@ export function isGeoIDComponent<T extends GeoIDPart>(component: T, input: unkno
528
530
  //#region GeoID Parsing
529
531
 
530
532
  /**
531
- * GeoID input matchers sorted by length in descending order, such that the most specific matchers
532
- * are first.
533
+ * GeoID input matchers sorted by length in descending order, such that the most specific matchers are first.
533
534
  */
534
535
  const OrderedGeoIDInputMatchers = Object.values(GeoIDInputMatchers).sort((a, b) => b.length - a.length)
535
536
 
@@ -591,6 +592,7 @@ export function parseGeoID(input: unknown): ParsedGeoID | null {
591
592
  if (!input) return null
592
593
 
593
594
  if (typeof input === "number") input = input.toString()
595
+
594
596
  if (typeof input !== "string") return null
595
597
 
596
598
  if (input.length === GeoIDInputMatchers[GeoIDPart.Block].length) {
@@ -7,11 +7,10 @@
7
7
  /**
8
8
  * Describes the particular typology for each geographic entity.
9
9
  *
10
- * For legal entities, the LSAD reflects the term that appears in legal documentation pertaining to
11
- * the entity, such as a treaty, charter, legislation, resolution, or ordinance.
10
+ * For legal entities, the LSAD reflects the term that appears in legal documentation pertaining to the entity, such as
11
+ * a treaty, charter, legislation, resolution, or ordinance.
12
12
  *
13
- * For statistical entities, the LSAD is the term assigned by the Census Bureau or other agency
14
- * defining the entity.
13
+ * For statistical entities, the LSAD is the term assigned by the Census Bureau or other agency defining the entity.
15
14
  *
16
15
  * @title Legal/Statistical Area Description
17
16
  */
@@ -96,8 +95,7 @@ export enum LegalStatisticalAreaDescription {
96
95
  */
97
96
  CensusSubDistrict = "24",
98
97
  /**
99
- * Consolidated City, County or Equivalent Feature, County Subdivision, Economic Census Place,
100
- * Incorporated Place.
98
+ * Consolidated City, County or Equivalent Feature, County Subdivision, Economic Census Place, Incorporated Place.
101
99
  */
102
100
  City = "25",
103
101
  CountySuffixCountySubdivision = "26",
@@ -32,12 +32,12 @@ export interface TIGERBlockGroup {
32
32
  */
33
33
  COUSUBFP: string;
34
34
  /**
35
- * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
36
35
  * @title County Subdivision GNIS Code
37
36
  *
38
37
  * @minLength 8
39
38
  * @maxLength 8
40
39
  * @pattern ^\d{8}$
40
+ * @see {@link https://www.usgs.gov/us-board-on-geographic-names/domestic-names | USGS: Domestic Names}
41
41
  */
42
42
  COUSUBNS: string;
43
43
  /**
@@ -58,8 +58,7 @@ export interface TIGERBlockGroup {
58
58
  */
59
59
  GEOIDFQ: string;
60
60
  /**
61
- * Current name and the translated legal/statistical area description code for county
62
- * sub-division.
61
+ * Current name and the translated legal/statistical area description code for county sub-division.
63
62
  *
64
63
  * @title Name/Legal Statistical Area Description
65
64
  * @minLength 1
@@ -1 +1 @@
1
- {"version":3,"file":"block-group.d.ts","sourceRoot":"","sources":["../block-group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IAExB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,IAAI,EAAE,+BAA+B,CAAA;IAErC;;;;OAIG;IACH,OAAO,EAAE,cAAc,CAAA;IAEvB;;;;;;;;OAQG;IACH,KAAK,EAAE,cAAc,CAAA;IAErB;;;;;;;OAOG;IACH,QAAQ,EAAE,qBAAqB,CAAA;IAE/B;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,QAAQ,EAAE,MAA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