elections-types 1.0.24 → 1.0.26
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.
|
@@ -7,7 +7,8 @@ export declare class Article {
|
|
|
7
7
|
readonly domain: string;
|
|
8
8
|
readonly url: string;
|
|
9
9
|
readonly fetch_time: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly relevance_title?: string;
|
|
11
|
+
readonly text_status?: string;
|
|
11
12
|
constructor(article: any);
|
|
12
13
|
static is(article: any): article is Article;
|
|
13
14
|
}
|
|
@@ -7,7 +7,8 @@ export class Article {
|
|
|
7
7
|
domain;
|
|
8
8
|
url;
|
|
9
9
|
fetch_time;
|
|
10
|
-
|
|
10
|
+
relevance_title;
|
|
11
|
+
text_status;
|
|
11
12
|
constructor(article) {
|
|
12
13
|
if (!Article.is(article)) {
|
|
13
14
|
throw Error("Invalid input.");
|
|
@@ -20,7 +21,8 @@ export class Article {
|
|
|
20
21
|
this.domain = article.domain;
|
|
21
22
|
this.url = article.url;
|
|
22
23
|
this.fetch_time = article.fetch_time;
|
|
23
|
-
this.
|
|
24
|
+
this.relevance_title = article.relevance_title;
|
|
25
|
+
this.text_status = article.text_status;
|
|
24
26
|
}
|
|
25
27
|
static is(article) {
|
|
26
28
|
return (article !== undefined &&
|
|
@@ -32,6 +34,7 @@ export class Article {
|
|
|
32
34
|
typeof article.domain === "string" &&
|
|
33
35
|
typeof article.url === "string" &&
|
|
34
36
|
typeof article.fetch_time === "string" &&
|
|
35
|
-
(article.
|
|
37
|
+
(article.relevance_title === undefined || typeof article.relevance_title === "string") &&
|
|
38
|
+
(article.text_status === undefined || typeof article.text_status === "string"));
|
|
36
39
|
}
|
|
37
40
|
}
|
package/package.json
CHANGED
package/src/types/Article.ts
CHANGED
|
@@ -7,7 +7,8 @@ export class Article {
|
|
|
7
7
|
readonly domain : string
|
|
8
8
|
readonly url : string
|
|
9
9
|
readonly fetch_time : string
|
|
10
|
-
readonly
|
|
10
|
+
readonly relevance_title? : string
|
|
11
|
+
readonly text_status? : string
|
|
11
12
|
|
|
12
13
|
constructor(article : any) {
|
|
13
14
|
if (!Article.is(article)) {
|
|
@@ -21,7 +22,8 @@ export class Article {
|
|
|
21
22
|
this.domain = article.domain
|
|
22
23
|
this.url = article.url
|
|
23
24
|
this.fetch_time = article.fetch_time
|
|
24
|
-
this.
|
|
25
|
+
this.relevance_title = article.relevance_title
|
|
26
|
+
this.text_status = article.text_status
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
static is(article : any) : article is Article {
|
|
@@ -35,7 +37,8 @@ export class Article {
|
|
|
35
37
|
typeof article.domain === "string" &&
|
|
36
38
|
typeof article.url === "string" &&
|
|
37
39
|
typeof article.fetch_time === "string" &&
|
|
38
|
-
(article.
|
|
40
|
+
(article.relevance_title === undefined || typeof article.relevance_title === "string") &&
|
|
41
|
+
(article.text_status === undefined || typeof article.text_status === "string")
|
|
39
42
|
)
|
|
40
43
|
}
|
|
41
44
|
}
|