triangle-types 1.0.191 → 1.0.192

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.
@@ -1 +1,14 @@
1
- export {};
1
+ import { StateID } from "../regions/State.js";
2
+ export declare class FederalCensusBlock {
3
+ readonly federal_census_block_id: string;
4
+ readonly federal_census_tract_id: string;
5
+ readonly federal_census_county_id: string;
6
+ readonly federal_census_id: number;
7
+ readonly county_id: string;
8
+ readonly tract_id: string;
9
+ readonly block_id: string;
10
+ readonly state_id: StateID;
11
+ readonly name: string;
12
+ constructor(federal_census_block: any);
13
+ static is(federal_census_block: any): federal_census_block is FederalCensusBlock;
14
+ }
@@ -1,44 +1,38 @@
1
- // import { is_state_id, StateID } from "../regions/State.js"
2
- export {};
3
- // export class FederalCensusBlock {
4
- // readonly federal_census_block_id : string
5
- // readonly federal_census_tract_id : string
6
- // readonly federal_census_county_id : string
7
- // readonly federal_census_id : number
8
- // readonly county_id : string
9
- // readonly tract_id : string
10
- // readonly block_id : string
11
- // readonly state_id : StateID
12
- // readonly name : string
13
- // readonly s3_id : string
14
- // constructor(federal_census_block : any) {
15
- // if (!FederalCensusBlock.is(federal_census_block)) {
16
- // throw Error("Invalid input.")
17
- // }
18
- // this.federal_census_block_id = federal_census_block.federal_census_block_id
19
- // this.federal_census_tract_id = federal_census_block.federal_census_tract_id
20
- // this.federal_census_county_id = federal_census_block.federal_census_county_id
21
- // this.federal_census_id = federal_census_block.federal_census_id
22
- // this.county_id = federal_census_block.county_id
23
- // this.tract_id = federal_census_block.tract_id
24
- // this.block_id = federal_census_block.block_id
25
- // this.state_id = federal_census_block.state_id
26
- // this.name = federal_census_block.name
27
- // this.s3_id = federal_census_block.s3_id
28
- // }
29
- // static is(federal_census_block : any) : federal_census_block is FederalCensusBlock {
30
- // return (
31
- // federal_census_block !== undefined &&
32
- // typeof federal_census_block.federal_census_block_id === "string" &&
33
- // typeof federal_census_block.federal_census_tract_id === "string" &&
34
- // typeof federal_census_block.federal_census_county_id === "string" &&
35
- // typeof federal_census_block.federal_census_id === "number" &&
36
- // typeof federal_census_block.county_id === "string" &&
37
- // typeof federal_census_block.tract_id === "string" &&
38
- // typeof federal_census_block.block_id === "string" &&
39
- // is_state_id(federal_census_block.state_id) &&
40
- // typeof federal_census_block.name === "string" &&
41
- // typeof federal_census_block.s3_id === "string"
42
- // )
43
- // }
44
- // }
1
+ import { is_state_id } from "../regions/State.js";
2
+ export class FederalCensusBlock {
3
+ federal_census_block_id;
4
+ federal_census_tract_id;
5
+ federal_census_county_id;
6
+ federal_census_id;
7
+ county_id;
8
+ tract_id;
9
+ block_id;
10
+ state_id;
11
+ name;
12
+ constructor(federal_census_block) {
13
+ if (!FederalCensusBlock.is(federal_census_block)) {
14
+ throw Error("Invalid input.");
15
+ }
16
+ this.federal_census_block_id = federal_census_block.federal_census_block_id;
17
+ this.federal_census_tract_id = federal_census_block.federal_census_tract_id;
18
+ this.federal_census_county_id = federal_census_block.federal_census_county_id;
19
+ this.federal_census_id = federal_census_block.federal_census_id;
20
+ this.county_id = federal_census_block.county_id;
21
+ this.tract_id = federal_census_block.tract_id;
22
+ this.block_id = federal_census_block.block_id;
23
+ this.state_id = federal_census_block.state_id;
24
+ this.name = federal_census_block.name;
25
+ }
26
+ static is(federal_census_block) {
27
+ return (federal_census_block !== undefined &&
28
+ typeof federal_census_block.federal_census_block_id === "string" &&
29
+ typeof federal_census_block.federal_census_tract_id === "string" &&
30
+ typeof federal_census_block.federal_census_county_id === "string" &&
31
+ typeof federal_census_block.federal_census_id === "number" &&
32
+ typeof federal_census_block.county_id === "string" &&
33
+ typeof federal_census_block.tract_id === "string" &&
34
+ typeof federal_census_block.block_id === "string" &&
35
+ is_state_id(federal_census_block.state_id) &&
36
+ typeof federal_census_block.name === "string");
37
+ }
38
+ }
@@ -1 +1,12 @@
1
- export {};
1
+ import { StateID } from "../regions/State.js";
2
+ export declare class FederalCensusTract {
3
+ readonly federal_census_tract_id: string;
4
+ readonly federal_census_county_id: string;
5
+ readonly federal_census_id: number;
6
+ readonly county_id: string;
7
+ readonly tract_id: string;
8
+ readonly state_id: StateID;
9
+ readonly name: string;
10
+ constructor(federal_census_tract: any);
11
+ static is(federal_census_tract: any): federal_census_tract is FederalCensusTract;
12
+ }
@@ -1,38 +1,32 @@
1
- // import { is_state_id, StateID } from "../regions/State.js"
2
- export {};
3
- // export class FederalCensusTract {
4
- // readonly federal_census_tract_id : string
5
- // readonly federal_census_county_id : string
6
- // readonly federal_census_id : number
7
- // readonly county_id : string
8
- // readonly tract_id : string
9
- // readonly state_id : StateID
10
- // readonly name : string
11
- // readonly s3_id : string
12
- // constructor(federal_census_tract : any) {
13
- // if (!FederalCensusTract.is(federal_census_tract)) {
14
- // throw Error("Invalid input.")
15
- // }
16
- // this.federal_census_tract_id = federal_census_tract.federal_census_tract_id
17
- // this.federal_census_county_id = federal_census_tract.federal_census_county_id
18
- // this.federal_census_id = federal_census_tract.federal_census_id
19
- // this.county_id = federal_census_tract.county_id
20
- // this.tract_id = federal_census_tract.tract_id
21
- // this.state_id = federal_census_tract.state_id
22
- // this.name = federal_census_tract.name
23
- // this.s3_id = federal_census_tract.s3_id
24
- // }
25
- // static is(federal_census_tract : any) : federal_census_tract is FederalCensusTract {
26
- // return (
27
- // federal_census_tract !== undefined &&
28
- // typeof federal_census_tract.federal_census_tract_id === "string" &&
29
- // typeof federal_census_tract.federal_census_county_id === "string" &&
30
- // typeof federal_census_tract.federal_census_id === "number" &&
31
- // typeof federal_census_tract.county_id === "string" &&
32
- // typeof federal_census_tract.tract_id === "string" &&
33
- // is_state_id(federal_census_tract.state_id) &&
34
- // typeof federal_census_tract.name === "string" &&
35
- // typeof federal_census_tract.s3_id === "string"
36
- // )
37
- // }
38
- // }
1
+ import { is_state_id } from "../regions/State.js";
2
+ export class FederalCensusTract {
3
+ federal_census_tract_id;
4
+ federal_census_county_id;
5
+ federal_census_id;
6
+ county_id;
7
+ tract_id;
8
+ state_id;
9
+ name;
10
+ constructor(federal_census_tract) {
11
+ if (!FederalCensusTract.is(federal_census_tract)) {
12
+ throw Error("Invalid input.");
13
+ }
14
+ this.federal_census_tract_id = federal_census_tract.federal_census_tract_id;
15
+ this.federal_census_county_id = federal_census_tract.federal_census_county_id;
16
+ this.federal_census_id = federal_census_tract.federal_census_id;
17
+ this.county_id = federal_census_tract.county_id;
18
+ this.tract_id = federal_census_tract.tract_id;
19
+ this.state_id = federal_census_tract.state_id;
20
+ this.name = federal_census_tract.name;
21
+ }
22
+ static is(federal_census_tract) {
23
+ return (federal_census_tract !== undefined &&
24
+ typeof federal_census_tract.federal_census_tract_id === "string" &&
25
+ typeof federal_census_tract.federal_census_county_id === "string" &&
26
+ typeof federal_census_tract.federal_census_id === "number" &&
27
+ typeof federal_census_tract.county_id === "string" &&
28
+ typeof federal_census_tract.tract_id === "string" &&
29
+ is_state_id(federal_census_tract.state_id) &&
30
+ typeof federal_census_tract.name === "string");
31
+ }
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.191",
3
+ "version": "1.0.192",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,47 +1,44 @@
1
- // import { is_state_id, StateID } from "../regions/State"
1
+ import { is_state_id, StateID } from "../regions/State"
2
2
 
3
- // export class FederalCensusBlock {
4
- // readonly federal_census_block_id : string
5
- // readonly federal_census_tract_id : string
6
- // readonly federal_census_county_id : string
7
- // readonly federal_census_id : number
8
- // readonly county_id : string
9
- // readonly tract_id : string
10
- // readonly block_id : string
11
- // readonly state_id : StateID
12
- // readonly name : string
13
- // readonly s3_id : string
3
+ export class FederalCensusBlock {
4
+ readonly federal_census_block_id : string
5
+ readonly federal_census_tract_id : string
6
+ readonly federal_census_county_id : string
7
+ readonly federal_census_id : number
8
+ readonly county_id : string
9
+ readonly tract_id : string
10
+ readonly block_id : string
11
+ readonly state_id : StateID
12
+ readonly name : string
14
13
 
15
- // constructor(federal_census_block : any) {
16
- // if (!FederalCensusBlock.is(federal_census_block)) {
17
- // throw Error("Invalid input.")
18
- // }
19
- // this.federal_census_block_id = federal_census_block.federal_census_block_id
20
- // this.federal_census_tract_id = federal_census_block.federal_census_tract_id
21
- // this.federal_census_county_id = federal_census_block.federal_census_county_id
22
- // this.federal_census_id = federal_census_block.federal_census_id
23
- // this.county_id = federal_census_block.county_id
24
- // this.tract_id = federal_census_block.tract_id
25
- // this.block_id = federal_census_block.block_id
26
- // this.state_id = federal_census_block.state_id
27
- // this.name = federal_census_block.name
28
- // this.s3_id = federal_census_block.s3_id
29
- // }
14
+ constructor(federal_census_block : any) {
15
+ if (!FederalCensusBlock.is(federal_census_block)) {
16
+ throw Error("Invalid input.")
17
+ }
18
+ this.federal_census_block_id = federal_census_block.federal_census_block_id
19
+ this.federal_census_tract_id = federal_census_block.federal_census_tract_id
20
+ this.federal_census_county_id = federal_census_block.federal_census_county_id
21
+ this.federal_census_id = federal_census_block.federal_census_id
22
+ this.county_id = federal_census_block.county_id
23
+ this.tract_id = federal_census_block.tract_id
24
+ this.block_id = federal_census_block.block_id
25
+ this.state_id = federal_census_block.state_id
26
+ this.name = federal_census_block.name
27
+ }
30
28
 
31
- // static is(federal_census_block : any) : federal_census_block is FederalCensusBlock {
32
- // return (
33
- // federal_census_block !== undefined &&
34
- // typeof federal_census_block.federal_census_block_id === "string" &&
35
- // typeof federal_census_block.federal_census_tract_id === "string" &&
36
- // typeof federal_census_block.federal_census_county_id === "string" &&
37
- // typeof federal_census_block.federal_census_id === "number" &&
38
- // typeof federal_census_block.county_id === "string" &&
39
- // typeof federal_census_block.tract_id === "string" &&
40
- // typeof federal_census_block.block_id === "string" &&
41
- // is_state_id(federal_census_block.state_id) &&
42
- // typeof federal_census_block.name === "string" &&
43
- // typeof federal_census_block.s3_id === "string"
44
- // )
45
- // }
29
+ static is(federal_census_block : any) : federal_census_block is FederalCensusBlock {
30
+ return (
31
+ federal_census_block !== undefined &&
32
+ typeof federal_census_block.federal_census_block_id === "string" &&
33
+ typeof federal_census_block.federal_census_tract_id === "string" &&
34
+ typeof federal_census_block.federal_census_county_id === "string" &&
35
+ typeof federal_census_block.federal_census_id === "number" &&
36
+ typeof federal_census_block.county_id === "string" &&
37
+ typeof federal_census_block.tract_id === "string" &&
38
+ typeof federal_census_block.block_id === "string" &&
39
+ is_state_id(federal_census_block.state_id) &&
40
+ typeof federal_census_block.name === "string"
41
+ )
42
+ }
46
43
 
47
- // }
44
+ }
@@ -1,41 +1,38 @@
1
- // import { is_state_id, StateID } from "../regions/State"
1
+ import { is_state_id, StateID } from "../regions/State"
2
2
 
3
- // export class FederalCensusTract {
4
- // readonly federal_census_tract_id : string
5
- // readonly federal_census_county_id : string
6
- // readonly federal_census_id : number
7
- // readonly county_id : string
8
- // readonly tract_id : string
9
- // readonly state_id : StateID
10
- // readonly name : string
11
- // readonly s3_id : string
3
+ export class FederalCensusTract {
4
+ readonly federal_census_tract_id : string
5
+ readonly federal_census_county_id : string
6
+ readonly federal_census_id : number
7
+ readonly county_id : string
8
+ readonly tract_id : string
9
+ readonly state_id : StateID
10
+ readonly name : string
12
11
 
13
- // constructor(federal_census_tract : any) {
14
- // if (!FederalCensusTract.is(federal_census_tract)) {
15
- // throw Error("Invalid input.")
16
- // }
17
- // this.federal_census_tract_id = federal_census_tract.federal_census_tract_id
18
- // this.federal_census_county_id = federal_census_tract.federal_census_county_id
19
- // this.federal_census_id = federal_census_tract.federal_census_id
20
- // this.county_id = federal_census_tract.county_id
21
- // this.tract_id = federal_census_tract.tract_id
22
- // this.state_id = federal_census_tract.state_id
23
- // this.name = federal_census_tract.name
24
- // this.s3_id = federal_census_tract.s3_id
25
- // }
12
+ constructor(federal_census_tract : any) {
13
+ if (!FederalCensusTract.is(federal_census_tract)) {
14
+ throw Error("Invalid input.")
15
+ }
16
+ this.federal_census_tract_id = federal_census_tract.federal_census_tract_id
17
+ this.federal_census_county_id = federal_census_tract.federal_census_county_id
18
+ this.federal_census_id = federal_census_tract.federal_census_id
19
+ this.county_id = federal_census_tract.county_id
20
+ this.tract_id = federal_census_tract.tract_id
21
+ this.state_id = federal_census_tract.state_id
22
+ this.name = federal_census_tract.name
23
+ }
26
24
 
27
- // static is(federal_census_tract : any) : federal_census_tract is FederalCensusTract {
28
- // return (
29
- // federal_census_tract !== undefined &&
30
- // typeof federal_census_tract.federal_census_tract_id === "string" &&
31
- // typeof federal_census_tract.federal_census_county_id === "string" &&
32
- // typeof federal_census_tract.federal_census_id === "number" &&
33
- // typeof federal_census_tract.county_id === "string" &&
34
- // typeof federal_census_tract.tract_id === "string" &&
35
- // is_state_id(federal_census_tract.state_id) &&
36
- // typeof federal_census_tract.name === "string" &&
37
- // typeof federal_census_tract.s3_id === "string"
38
- // )
39
- // }
25
+ static is(federal_census_tract : any) : federal_census_tract is FederalCensusTract {
26
+ return (
27
+ federal_census_tract !== undefined &&
28
+ typeof federal_census_tract.federal_census_tract_id === "string" &&
29
+ typeof federal_census_tract.federal_census_county_id === "string" &&
30
+ typeof federal_census_tract.federal_census_id === "number" &&
31
+ typeof federal_census_tract.county_id === "string" &&
32
+ typeof federal_census_tract.tract_id === "string" &&
33
+ is_state_id(federal_census_tract.state_id) &&
34
+ typeof federal_census_tract.name === "string"
35
+ )
36
+ }
40
37
 
41
- // }
38
+ }