triangle-types 1.0.5 → 1.0.6
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/User.d.ts +3 -0
- package/dist/src/types/User.js +10 -1
- package/package.json +1 -1
- package/src/types/User.ts +10 -1
package/dist/src/types/User.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export declare class User {
|
|
|
2
2
|
readonly user_id: string;
|
|
3
3
|
readonly email: string;
|
|
4
4
|
readonly is_admin_elections: boolean;
|
|
5
|
+
readonly is_admin_prism: boolean;
|
|
6
|
+
readonly is_admin_scout: boolean;
|
|
7
|
+
readonly is_admin_triage: boolean;
|
|
5
8
|
constructor(user: User);
|
|
6
9
|
static is(user: any): user is User;
|
|
7
10
|
}
|
package/dist/src/types/User.js
CHANGED
|
@@ -2,6 +2,9 @@ export class User {
|
|
|
2
2
|
user_id;
|
|
3
3
|
email;
|
|
4
4
|
is_admin_elections;
|
|
5
|
+
is_admin_prism;
|
|
6
|
+
is_admin_scout;
|
|
7
|
+
is_admin_triage;
|
|
5
8
|
// readonly [x : string] : any
|
|
6
9
|
constructor(user) {
|
|
7
10
|
if (!User.is(user)) {
|
|
@@ -10,11 +13,17 @@ export class User {
|
|
|
10
13
|
this.user_id = user.user_id;
|
|
11
14
|
this.email = user.email;
|
|
12
15
|
this.is_admin_elections = user.is_admin_elections;
|
|
16
|
+
this.is_admin_prism = user.is_admin_prism;
|
|
17
|
+
this.is_admin_scout = user.is_admin_scout;
|
|
18
|
+
this.is_admin_triage = user.is_admin_triage;
|
|
13
19
|
}
|
|
14
20
|
static is(user) {
|
|
15
21
|
return (user !== undefined &&
|
|
16
22
|
typeof user.user_id === "string" &&
|
|
17
23
|
typeof user.email === "string" &&
|
|
18
|
-
typeof user.is_admin_elections === "boolean"
|
|
24
|
+
typeof user.is_admin_elections === "boolean" &&
|
|
25
|
+
typeof user.is_admin_prism === "boolean" &&
|
|
26
|
+
typeof user.is_admin_scout === "boolean" &&
|
|
27
|
+
typeof user.is_admin_triage === "boolean");
|
|
19
28
|
}
|
|
20
29
|
}
|
package/package.json
CHANGED
package/src/types/User.ts
CHANGED
|
@@ -2,6 +2,9 @@ export class User {
|
|
|
2
2
|
readonly user_id : string
|
|
3
3
|
readonly email : string
|
|
4
4
|
readonly is_admin_elections : boolean
|
|
5
|
+
readonly is_admin_prism : boolean
|
|
6
|
+
readonly is_admin_scout : boolean
|
|
7
|
+
readonly is_admin_triage : boolean
|
|
5
8
|
// readonly [x : string] : any
|
|
6
9
|
|
|
7
10
|
constructor(user : User) {
|
|
@@ -11,6 +14,9 @@ export class User {
|
|
|
11
14
|
this.user_id = user.user_id
|
|
12
15
|
this.email = user.email
|
|
13
16
|
this.is_admin_elections = user.is_admin_elections
|
|
17
|
+
this.is_admin_prism = user.is_admin_prism
|
|
18
|
+
this.is_admin_scout = user.is_admin_scout
|
|
19
|
+
this.is_admin_triage = user.is_admin_triage
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
static is(user : any) : user is User {
|
|
@@ -18,7 +24,10 @@ export class User {
|
|
|
18
24
|
user !== undefined &&
|
|
19
25
|
typeof user.user_id === "string" &&
|
|
20
26
|
typeof user.email === "string" &&
|
|
21
|
-
typeof user.is_admin_elections === "boolean"
|
|
27
|
+
typeof user.is_admin_elections === "boolean" &&
|
|
28
|
+
typeof user.is_admin_prism === "boolean" &&
|
|
29
|
+
typeof user.is_admin_scout === "boolean" &&
|
|
30
|
+
typeof user.is_admin_triage === "boolean"
|
|
22
31
|
)
|
|
23
32
|
}
|
|
24
33
|
}
|