elections-types 1.1.29 → 1.1.30
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 +1 -4
- package/dist/src/types/User.js +3 -11
- package/package.json +1 -1
- package/src/types/User.ts +3 -10
package/dist/src/types/User.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { LongFormTypeID } from "./FormTypeID.js";
|
|
2
1
|
export declare class User {
|
|
3
2
|
readonly user_id: string;
|
|
4
|
-
readonly admin: boolean;
|
|
5
|
-
readonly premium: boolean;
|
|
6
3
|
readonly email: string;
|
|
7
|
-
readonly
|
|
4
|
+
readonly is_admin_elections: boolean;
|
|
8
5
|
constructor(user: User);
|
|
9
6
|
static is(user: any): user is User;
|
|
10
7
|
}
|
package/dist/src/types/User.js
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
import { is_long_form_type_id } from "./FormTypeID.js";
|
|
2
1
|
export class User {
|
|
3
2
|
user_id;
|
|
4
|
-
admin;
|
|
5
|
-
premium;
|
|
6
3
|
email;
|
|
7
|
-
|
|
4
|
+
is_admin_elections;
|
|
8
5
|
// readonly [x : string] : any
|
|
9
6
|
constructor(user) {
|
|
10
7
|
if (!User.is(user)) {
|
|
11
8
|
throw Error("Invalid Input.");
|
|
12
9
|
}
|
|
13
10
|
this.user_id = user.user_id;
|
|
14
|
-
this.admin = user.admin;
|
|
15
|
-
this.premium = user.premium;
|
|
16
11
|
this.email = user.email;
|
|
17
|
-
this.
|
|
12
|
+
this.is_admin_elections = user.is_admin_elections;
|
|
18
13
|
}
|
|
19
14
|
static is(user) {
|
|
20
15
|
return (user !== undefined &&
|
|
21
16
|
typeof user.user_id === "string" &&
|
|
22
|
-
typeof user.admin === "boolean" &&
|
|
23
|
-
typeof user.premium === "boolean" &&
|
|
24
17
|
typeof user.email === "string" &&
|
|
25
|
-
typeof user.
|
|
26
|
-
Object.entries(user.email_settings).every(([key, value]) => (is_long_form_type_id(key) || key === "NEWS") && typeof value === "number"));
|
|
18
|
+
typeof user.is_admin_elections === "boolean");
|
|
27
19
|
}
|
|
28
20
|
}
|
package/package.json
CHANGED
package/src/types/User.ts
CHANGED
|
@@ -2,10 +2,8 @@ import { is_long_form_type_id, LongFormTypeID } from "./FormTypeID"
|
|
|
2
2
|
|
|
3
3
|
export class User {
|
|
4
4
|
readonly user_id : string
|
|
5
|
-
readonly admin : boolean
|
|
6
|
-
readonly premium : boolean
|
|
7
5
|
readonly email : string
|
|
8
|
-
readonly
|
|
6
|
+
readonly is_admin_elections : boolean
|
|
9
7
|
// readonly [x : string] : any
|
|
10
8
|
|
|
11
9
|
constructor(user : User) {
|
|
@@ -13,21 +11,16 @@ export class User {
|
|
|
13
11
|
throw Error("Invalid Input.")
|
|
14
12
|
}
|
|
15
13
|
this.user_id = user.user_id
|
|
16
|
-
this.admin = user.admin
|
|
17
|
-
this.premium = user.premium
|
|
18
14
|
this.email = user.email
|
|
19
|
-
this.
|
|
15
|
+
this.is_admin_elections = user.is_admin_elections
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
static is(user : any) : user is User {
|
|
23
19
|
return (
|
|
24
20
|
user !== undefined &&
|
|
25
21
|
typeof user.user_id === "string" &&
|
|
26
|
-
typeof user.admin === "boolean" &&
|
|
27
|
-
typeof user.premium === "boolean" &&
|
|
28
22
|
typeof user.email === "string" &&
|
|
29
|
-
typeof user.
|
|
30
|
-
Object.entries(user.email_settings).every(([key, value]) => (is_long_form_type_id(key) || key === "NEWS") && typeof value === "number")
|
|
23
|
+
typeof user.is_admin_elections === "boolean"
|
|
31
24
|
)
|
|
32
25
|
}
|
|
33
26
|
}
|