doers-comms-types 1.0.2 → 1.0.3
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.
package/dist/src/types/Tweet.js
CHANGED
|
@@ -6,6 +6,7 @@ export class Tweet {
|
|
|
6
6
|
tweet_content;
|
|
7
7
|
replying_to;
|
|
8
8
|
quote;
|
|
9
|
+
html;
|
|
9
10
|
constructor(tweet) {
|
|
10
11
|
if (!Tweet.is(tweet)) {
|
|
11
12
|
throw Error("Invalid input.");
|
|
@@ -17,6 +18,7 @@ export class Tweet {
|
|
|
17
18
|
this.tweet_content = tweet.tweet_content;
|
|
18
19
|
this.replying_to = tweet.replying_to;
|
|
19
20
|
this.quote = tweet.quote;
|
|
21
|
+
this.html = tweet.html;
|
|
20
22
|
}
|
|
21
23
|
static is(tweet) {
|
|
22
24
|
return (tweet !== undefined &&
|
|
@@ -27,6 +29,7 @@ export class Tweet {
|
|
|
27
29
|
typeof tweet.tweet_content === "string" &&
|
|
28
30
|
Array.isArray(tweet.replying_to) &&
|
|
29
31
|
tweet.replying_to.every((username) => typeof username === "string") &&
|
|
30
|
-
(tweet.quote === undefined || typeof tweet.quote === "string")
|
|
32
|
+
(tweet.quote === undefined || typeof tweet.quote === "string") &&
|
|
33
|
+
(typeof tweet.html === "string"));
|
|
31
34
|
}
|
|
32
35
|
}
|
package/package.json
CHANGED
package/src/types/Tweet.ts
CHANGED
|
@@ -6,6 +6,7 @@ export class Tweet {
|
|
|
6
6
|
readonly tweet_content : string
|
|
7
7
|
readonly replying_to : string[]
|
|
8
8
|
readonly quote? : string
|
|
9
|
+
readonly html : string
|
|
9
10
|
|
|
10
11
|
constructor(tweet : any) {
|
|
11
12
|
if (!Tweet.is(tweet)) {
|
|
@@ -18,6 +19,7 @@ export class Tweet {
|
|
|
18
19
|
this.tweet_content = tweet.tweet_content
|
|
19
20
|
this.replying_to = tweet.replying_to
|
|
20
21
|
this.quote = tweet.quote
|
|
22
|
+
this.html = tweet.html
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
static is(tweet : any) : tweet is Tweet {
|
|
@@ -30,7 +32,8 @@ export class Tweet {
|
|
|
30
32
|
typeof tweet.tweet_content === "string" &&
|
|
31
33
|
Array.isArray(tweet.replying_to) &&
|
|
32
34
|
tweet.replying_to.every((username : any) => typeof username === "string") &&
|
|
33
|
-
(tweet.quote === undefined || typeof tweet.quote === "string")
|
|
35
|
+
(tweet.quote === undefined || typeof tweet.quote === "string") &&
|
|
36
|
+
(typeof tweet.html === "string")
|
|
34
37
|
)
|
|
35
38
|
}
|
|
36
39
|
}
|