triangle-types 1.0.263 → 1.0.264

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,7 +1,8 @@
1
1
  export declare class Label {
2
2
  readonly label_id: string;
3
3
  readonly resource_type_id: string;
4
- readonly name?: string;
4
+ readonly name: string;
5
+ readonly description: string;
5
6
  constructor(label: any);
6
7
  static is(label: any): label is Label;
7
8
  }
@@ -2,6 +2,7 @@ export class Label {
2
2
  label_id;
3
3
  resource_type_id;
4
4
  name;
5
+ description;
5
6
  constructor(label) {
6
7
  if (!Label.is(label)) {
7
8
  throw Error("Invalid input.");
@@ -9,11 +10,13 @@ export class Label {
9
10
  this.label_id = label.label_id;
10
11
  this.resource_type_id = label.resource_type_id;
11
12
  this.name = label.name;
13
+ this.description = label.description;
12
14
  }
13
15
  static is(label) {
14
16
  return (label !== undefined &&
15
17
  typeof label.label_id === "string" &&
16
18
  typeof label.resource_type_id === "string" &&
17
- (label.name === undefined || typeof label.voter_id === "string"));
19
+ typeof label.name === "string" &&
20
+ typeof label.description === "string");
18
21
  }
19
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.263",
3
+ "version": "1.0.264",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,7 +1,8 @@
1
1
  export class Label {
2
2
  readonly label_id : string
3
3
  readonly resource_type_id : string
4
- readonly name? : string
4
+ readonly name : string
5
+ readonly description : string
5
6
 
6
7
  constructor(label : any) {
7
8
  if (!Label.is(label)) {
@@ -10,6 +11,7 @@ export class Label {
10
11
  this.label_id = label.label_id
11
12
  this.resource_type_id = label.resource_type_id
12
13
  this.name = label.name
14
+ this.description = label.description
13
15
  }
14
16
 
15
17
  static is(label : any) : label is Label {
@@ -17,7 +19,8 @@ export class Label {
17
19
  label !== undefined &&
18
20
  typeof label.label_id === "string" &&
19
21
  typeof label.resource_type_id === "string" &&
20
- (label.name === undefined || typeof label.voter_id === "string")
22
+ typeof label.name === "string" &&
23
+ typeof label.description === "string"
21
24
  )
22
25
  }
23
26
  }