@duque.edits/sdk 0.0.4 → 0.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/{v1/index.ts → dist/index.d.ts} +27 -30
- package/dist/index.js +43 -0
- package/dist/managers/bet/GuildBetManager.d.ts +32 -0
- package/dist/managers/bet/GuildBetManager.js +107 -0
- package/dist/managers/betuser/GuildBetUserManager.d.ts +30 -0
- package/dist/managers/betuser/GuildBetUserManager.js +94 -0
- package/dist/managers/channel/ChannelManager.d.ts +39 -0
- package/dist/managers/channel/ChannelManager.js +147 -0
- package/dist/managers/groupedchannel/GroupedChannelManager.d.ts +34 -0
- package/dist/managers/groupedchannel/GroupedChannelManager.js +92 -0
- package/dist/managers/guild/GuildManager.d.ts +24 -0
- package/dist/managers/guild/GuildManager.js +75 -0
- package/dist/managers/match/GuildMatchManager.d.ts +32 -0
- package/dist/managers/match/GuildMatchManager.js +103 -0
- package/dist/managers/mediator/GuildMediatorManager.d.ts +32 -0
- package/dist/managers/mediator/GuildMediatorManager.js +97 -0
- package/dist/managers/messages/MessagesManager.d.ts +32 -0
- package/dist/managers/messages/MessagesManager.js +82 -0
- package/dist/managers/permission/GuildPermissionManager.d.ts +26 -0
- package/dist/managers/permission/GuildPermissionManager.js +70 -0
- package/dist/managers/product/GuildProductManager.d.ts +32 -0
- package/dist/managers/product/GuildProductManager.js +102 -0
- package/dist/managers/ticket/GuildTicketManager.d.ts +32 -0
- package/dist/managers/ticket/GuildTicketManager.js +99 -0
- package/dist/managers/user/GuildUserManager.d.ts +32 -0
- package/dist/managers/user/GuildUserManager.js +106 -0
- package/dist/rest/APIEndpoints.d.ts +11 -0
- package/dist/rest/APIEndpoints.js +12 -0
- package/dist/rest/REST.d.ts +51 -0
- package/dist/rest/REST.js +96 -0
- package/dist/rest/Routes.d.ts +84 -0
- package/dist/rest/Routes.js +89 -0
- package/dist/structures/Collection.d.ts +17 -0
- package/dist/structures/Collection.js +87 -0
- package/dist/structures/bet/GuildBet.d.ts +86 -0
- package/dist/structures/bet/GuildBet.js +276 -0
- package/dist/structures/betuser/GuildBetUser.d.ts +82 -0
- package/dist/structures/betuser/GuildBetUser.js +194 -0
- package/dist/structures/channel/Channel.d.ts +31 -0
- package/dist/structures/channel/Channel.js +57 -0
- package/dist/structures/groupedchannel/GroupedChannel.d.ts +34 -0
- package/dist/structures/groupedchannel/GroupedChannel.js +121 -0
- package/dist/structures/guild/Guild.d.ts +90 -0
- package/dist/structures/guild/Guild.js +254 -0
- package/dist/structures/match/GuildMatch.d.ts +84 -0
- package/dist/structures/match/GuildMatch.js +327 -0
- package/dist/structures/mediator/GuildMediator.d.ts +41 -0
- package/dist/structures/mediator/GuildMediator.js +131 -0
- package/dist/structures/product/GuildProduct.d.ts +52 -0
- package/dist/structures/product/GuildProduct.js +175 -0
- package/dist/structures/shop/GuildShop.d.ts +34 -0
- package/dist/structures/shop/GuildShop.js +80 -0
- package/dist/structures/ticket/GuildTicket.d.ts +51 -0
- package/dist/structures/ticket/GuildTicket.js +170 -0
- package/dist/structures/user/GuildUser.d.ts +82 -0
- package/dist/structures/user/GuildUser.js +208 -0
- package/dist/types/api/APIBaseChannel.d.ts +10 -0
- package/dist/types/api/APIBaseChannel.js +2 -0
- package/dist/types/api/APIBetChannel.d.ts +10 -0
- package/dist/types/api/APIBetChannel.js +2 -0
- package/dist/types/api/APIBetMessage.d.ts +10 -0
- package/dist/types/api/APIBetMessage.js +2 -0
- package/dist/types/api/APIGuild.d.ts +93 -0
- package/dist/types/api/APIGuild.js +2 -0
- package/dist/types/api/APIGuildBet.d.ts +48 -0
- package/dist/types/api/APIGuildBet.js +2 -0
- package/dist/types/api/APIGuildBetUser.d.ts +32 -0
- package/dist/types/api/APIGuildBetUser.js +2 -0
- package/dist/types/api/APIGuildChannel.d.ts +10 -0
- package/dist/types/api/APIGuildChannel.js +2 -0
- package/dist/types/api/APIGuildEmoji.d.ts +12 -0
- package/dist/types/api/APIGuildEmoji.js +2 -0
- package/dist/types/api/APIGuildGroupedChannel.d.ts +10 -0
- package/dist/types/api/APIGuildGroupedChannel.js +2 -0
- package/dist/types/api/APIGuildMatch.d.ts +46 -0
- package/dist/types/api/APIGuildMatch.js +2 -0
- package/dist/types/api/APIGuildMediator.d.ts +13 -0
- package/dist/types/api/APIGuildMediator.js +3 -0
- package/dist/types/api/APIGuildMessage.d.ts +10 -0
- package/dist/types/api/APIGuildMessage.js +2 -0
- package/dist/types/api/APIGuildPermissions.d.ts +6 -0
- package/dist/types/api/APIGuildPermissions.js +2 -0
- package/dist/types/api/APIGuildRole.d.ts +10 -0
- package/dist/types/api/APIGuildRole.js +2 -0
- package/dist/types/api/APIGuildShop.d.ts +11 -0
- package/dist/types/api/APIGuildShop.js +2 -0
- package/dist/types/api/APIGuildTicket.d.ts +25 -0
- package/dist/types/api/APIGuildTicket.js +3 -0
- package/dist/types/api/APIGuildUser.d.ts +31 -0
- package/dist/types/api/APIGuildUser.js +2 -0
- package/dist/types/api/APIMessage.d.ts +12 -0
- package/dist/types/api/APIMessage.js +2 -0
- package/dist/types/api/APIPlayer.d.ts +10 -0
- package/dist/types/api/APIPlayer.js +2 -0
- package/dist/types/api/APIProduct.d.ts +19 -0
- package/dist/types/api/APIProduct.js +3 -0
- package/dist/types/api/index.d.ts +130 -0
- package/dist/types/api/index.js +35 -0
- package/{v1/types/index.ts → dist/types/index.d.ts} +21 -24
- package/dist/types/index.js +37 -0
- package/dist/utils/Assertion.d.ts +32 -0
- package/dist/utils/Assertion.js +60 -0
- package/package.json +15 -1
- package/.gitattributes +0 -2
- package/tests/index.ts +0 -86
- package/tsconfig.json +0 -15
- package/v1/managers/bet/GuildBetManager.ts +0 -117
- package/v1/managers/betuser/GuildBetUserManager.ts +0 -103
- package/v1/managers/channel/ChannelManager.ts +0 -168
- package/v1/managers/groupedchannel/GroupedChannelManager.ts +0 -117
- package/v1/managers/guild/GuildManager.ts +0 -84
- package/v1/managers/match/GuildMatchManager.ts +0 -115
- package/v1/managers/mediator/GuildMediatorManager.ts +0 -111
- package/v1/managers/messages/MessagesManager.ts +0 -95
- package/v1/managers/permission/GuildPermissionManager.ts +0 -88
- package/v1/managers/product/GuildProductManager.ts +0 -115
- package/v1/managers/ticket/GuildTicketManager.ts +0 -112
- package/v1/managers/user/GuildUserManager.ts +0 -116
- package/v1/rest/APIEndpoints.ts +0 -11
- package/v1/rest/REST.ts +0 -126
- package/v1/rest/Routes.ts +0 -143
- package/v1/structures/Collection.ts +0 -85
- package/v1/structures/bet/GuildBet.ts +0 -332
- package/v1/structures/betuser/GuildBetUser.ts +0 -247
- package/v1/structures/channel/Channel.ts +0 -78
- package/v1/structures/groupedchannel/GroupedChannel.ts +0 -165
- package/v1/structures/guild/Guild.ts +0 -302
- package/v1/structures/match/GuildMatch.ts +0 -385
- package/v1/structures/mediator/GuildMediator.ts +0 -175
- package/v1/structures/product/GuildProduct.ts +0 -217
- package/v1/structures/shop/GuildShop.ts +0 -98
- package/v1/structures/ticket/GuildTicket.ts +0 -227
- package/v1/structures/user/GuildUser.ts +0 -248
- package/v1/types/api/APIBaseChannel.ts +0 -13
- package/v1/types/api/APIBetChannel.ts +0 -13
- package/v1/types/api/APIBetMessage.ts +0 -13
- package/v1/types/api/APIGuild.ts +0 -123
- package/v1/types/api/APIGuildBet.ts +0 -69
- package/v1/types/api/APIGuildBetUser.ts +0 -46
- package/v1/types/api/APIGuildChannel.ts +0 -13
- package/v1/types/api/APIGuildEmoji.ts +0 -16
- package/v1/types/api/APIGuildGroupedChannel.ts +0 -13
- package/v1/types/api/APIGuildMatch.ts +0 -67
- package/v1/types/api/APIGuildMediator.ts +0 -18
- package/v1/types/api/APIGuildMessage.ts +0 -13
- package/v1/types/api/APIGuildPermissions.ts +0 -7
- package/v1/types/api/APIGuildRole.ts +0 -13
- package/v1/types/api/APIGuildShop.ts +0 -15
- package/v1/types/api/APIGuildTicket.ts +0 -36
- package/v1/types/api/APIGuildUser.ts +0 -45
- package/v1/types/api/APIMessage.ts +0 -16
- package/v1/types/api/APIPlayer.ts +0 -13
- package/v1/types/api/APIProduct.ts +0 -27
- package/v1/types/api/index.ts +0 -180
- package/v1/utils/Assertion.ts +0 -56
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { APIProduct } from "./APIProduct";
|
|
2
|
-
|
|
3
|
-
export interface APIGuildShop {
|
|
4
|
-
/** Shop's product */
|
|
5
|
-
products: APIProduct[];
|
|
6
|
-
|
|
7
|
-
/** Bought count */
|
|
8
|
-
boughtCount: number;
|
|
9
|
-
|
|
10
|
-
/** Creation Date */
|
|
11
|
-
createdAt: Date;
|
|
12
|
-
|
|
13
|
-
/** Updated Date */
|
|
14
|
-
updatedAt: Date;
|
|
15
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { APIMessage } from "./APIMessage";
|
|
2
|
-
|
|
3
|
-
export interface APIGuildTicket {
|
|
4
|
-
/** Ticket's id */
|
|
5
|
-
id: string;
|
|
6
|
-
|
|
7
|
-
/** Ticket's creator id */
|
|
8
|
-
creatorId: string;
|
|
9
|
-
|
|
10
|
-
/** Ticket's admin id */
|
|
11
|
-
adminId: string;
|
|
12
|
-
|
|
13
|
-
/** Ticket's rating that customer gave */
|
|
14
|
-
customerRating: number;
|
|
15
|
-
|
|
16
|
-
/** Ticket's channel id */
|
|
17
|
-
channelId: string;
|
|
18
|
-
|
|
19
|
-
/** Ticket's closed by who */
|
|
20
|
-
closedById: string;
|
|
21
|
-
|
|
22
|
-
/** Ticket's type */
|
|
23
|
-
type: string;
|
|
24
|
-
|
|
25
|
-
/** Ticket's status */
|
|
26
|
-
status: "on" | "off";
|
|
27
|
-
|
|
28
|
-
/** Ticket's messages */
|
|
29
|
-
messages: APIMessage[];
|
|
30
|
-
|
|
31
|
-
/** Creation Date */
|
|
32
|
-
createdAt: Date;
|
|
33
|
-
|
|
34
|
-
/** Updated Date */
|
|
35
|
-
updatedAt: Date;
|
|
36
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Accessory, Daily, Items, OriginalChannels } from ".";
|
|
2
|
-
|
|
3
|
-
export interface APIGuildUser {
|
|
4
|
-
/** User's id */
|
|
5
|
-
id: string;
|
|
6
|
-
|
|
7
|
-
/** User name */
|
|
8
|
-
name: string;
|
|
9
|
-
|
|
10
|
-
/** User's daily */
|
|
11
|
-
daily: Omit<Daily, "credit">;
|
|
12
|
-
|
|
13
|
-
/** User's points */
|
|
14
|
-
points: number;
|
|
15
|
-
|
|
16
|
-
/** User's wins */
|
|
17
|
-
wins: number;
|
|
18
|
-
|
|
19
|
-
/** User's mvps */
|
|
20
|
-
mvps: number;
|
|
21
|
-
|
|
22
|
-
/** User's losses */
|
|
23
|
-
losses: number;
|
|
24
|
-
|
|
25
|
-
/** User's games */
|
|
26
|
-
games: number;
|
|
27
|
-
|
|
28
|
-
/** If user is blacklisted */
|
|
29
|
-
blacklist: boolean;
|
|
30
|
-
|
|
31
|
-
/** User's accessories such as double point */
|
|
32
|
-
accessories: Accessory[];
|
|
33
|
-
|
|
34
|
-
/** User's original channels */
|
|
35
|
-
originalChannels: OriginalChannels;
|
|
36
|
-
|
|
37
|
-
/** User's items */
|
|
38
|
-
items: Items;
|
|
39
|
-
|
|
40
|
-
/** Creation Date */
|
|
41
|
-
createdAt: Date;
|
|
42
|
-
|
|
43
|
-
/** Updated Date */
|
|
44
|
-
updatedAt: Date;
|
|
45
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface APIMessage {
|
|
2
|
-
/** Message's content */
|
|
3
|
-
content: string | object;
|
|
4
|
-
|
|
5
|
-
/** Message's creator id */
|
|
6
|
-
userId: string;
|
|
7
|
-
|
|
8
|
-
/** Message's type */
|
|
9
|
-
type: "text" | "img" | ".png" | ".gif" | ".jpg";
|
|
10
|
-
|
|
11
|
-
/** Creation Date */
|
|
12
|
-
createdAt: Date;
|
|
13
|
-
|
|
14
|
-
/** Updated Date */
|
|
15
|
-
updatedAt: Date;
|
|
16
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { APIPlayer } from "./APIPlayer";
|
|
2
|
-
|
|
3
|
-
export interface APIProduct {
|
|
4
|
-
/** Product's name */
|
|
5
|
-
name: string;
|
|
6
|
-
|
|
7
|
-
/** Product's description */
|
|
8
|
-
description: string;
|
|
9
|
-
|
|
10
|
-
/** Product's id */
|
|
11
|
-
id: string;
|
|
12
|
-
|
|
13
|
-
/** Product's price */
|
|
14
|
-
price: number;
|
|
15
|
-
|
|
16
|
-
/** Product's buyers */
|
|
17
|
-
buyers: APIPlayer[];
|
|
18
|
-
|
|
19
|
-
/** Product's emoji */
|
|
20
|
-
emoji: string;
|
|
21
|
-
|
|
22
|
-
/** Creation Date */
|
|
23
|
-
createdAt: Date;
|
|
24
|
-
|
|
25
|
-
/** Updated Date */
|
|
26
|
-
updatedAt: Date;
|
|
27
|
-
};
|
package/v1/types/api/index.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
export interface APITicketCategory {
|
|
2
|
-
/** Category's type */
|
|
3
|
-
type: string;
|
|
4
|
-
|
|
5
|
-
/** Category's emoji */
|
|
6
|
-
emoji: string;
|
|
7
|
-
|
|
8
|
-
/** Category's description */
|
|
9
|
-
description: string;
|
|
10
|
-
|
|
11
|
-
/** Category's alias */
|
|
12
|
-
alias: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface Blacklisted {
|
|
16
|
-
/** Blacklist's id */
|
|
17
|
-
id: string;
|
|
18
|
-
|
|
19
|
-
/** Blacklist added by */
|
|
20
|
-
addedBy: string;
|
|
21
|
-
|
|
22
|
-
/** Guild Creation Date */
|
|
23
|
-
createdAt: Date;
|
|
24
|
-
|
|
25
|
-
/** Guild Updated Date */
|
|
26
|
-
updatedAt: Date;
|
|
27
|
-
}
|
|
28
|
-
export type GuildBlacklist = Blacklisted[];
|
|
29
|
-
|
|
30
|
-
export interface LogMessage {
|
|
31
|
-
/** The message's content */
|
|
32
|
-
content: string | Buffer<any>;
|
|
33
|
-
|
|
34
|
-
/** The message's sender */
|
|
35
|
-
userId: string;
|
|
36
|
-
|
|
37
|
-
/** The message's type */
|
|
38
|
-
type: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Base match modes */
|
|
42
|
-
export type BaseMatchModes =
|
|
43
|
-
| "1x1"
|
|
44
|
-
| "2x2"
|
|
45
|
-
| "3x3"
|
|
46
|
-
| "4x4"
|
|
47
|
-
| "5x5"
|
|
48
|
-
| "6x6"
|
|
49
|
-
| "1v1"
|
|
50
|
-
| "2v2"
|
|
51
|
-
| "3v3"
|
|
52
|
-
| "4v4"
|
|
53
|
-
| "5v5"
|
|
54
|
-
| "6v6";
|
|
55
|
-
|
|
56
|
-
/** Base match status */
|
|
57
|
-
export type BaseMatchStatus = "on" | "created" | "off" | "shutted";
|
|
58
|
-
|
|
59
|
-
/** The logs of the structure */
|
|
60
|
-
export interface Logs {
|
|
61
|
-
/** The messages of the structure */
|
|
62
|
-
messages: LogMessage[];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Original Channel */
|
|
66
|
-
export type OriginalChannel = {
|
|
67
|
-
/** Channel id */
|
|
68
|
-
channelId: string;
|
|
69
|
-
|
|
70
|
-
/** Match id */
|
|
71
|
-
matchId: string;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/** Items */
|
|
75
|
-
export type Items = string[];
|
|
76
|
-
|
|
77
|
-
/** Original Channels */
|
|
78
|
-
export type OriginalChannels = OriginalChannel[];
|
|
79
|
-
|
|
80
|
-
/** Accessories */
|
|
81
|
-
export type Accessory = {
|
|
82
|
-
/** Accessory type */
|
|
83
|
-
type: "point_protect" | "immunity" | "double_points";
|
|
84
|
-
|
|
85
|
-
/** Accessory longevity */
|
|
86
|
-
longevity: string;
|
|
87
|
-
|
|
88
|
-
/** Accessory adder */
|
|
89
|
-
addedBy: string;
|
|
90
|
-
|
|
91
|
-
/** When accessory added */
|
|
92
|
-
when: Date;
|
|
93
|
-
|
|
94
|
-
/** If accessory has expired */
|
|
95
|
-
expired: boolean;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/** Daily information */
|
|
99
|
-
export type Daily = {
|
|
100
|
-
/** Wins */
|
|
101
|
-
wins: number;
|
|
102
|
-
|
|
103
|
-
/** Coins */
|
|
104
|
-
coins: number;
|
|
105
|
-
|
|
106
|
-
/** Points */
|
|
107
|
-
points: number;
|
|
108
|
-
|
|
109
|
-
/** Credit */
|
|
110
|
-
credit: number;
|
|
111
|
-
|
|
112
|
-
/** Losses */
|
|
113
|
-
losses: number;
|
|
114
|
-
|
|
115
|
-
/** Mvps */
|
|
116
|
-
mvps: number;
|
|
117
|
-
|
|
118
|
-
/** Date of the daily */
|
|
119
|
-
date: Date;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export interface Banner {
|
|
123
|
-
/** Equipped banner */
|
|
124
|
-
equipped: number;
|
|
125
|
-
|
|
126
|
-
/** Bought banners */
|
|
127
|
-
allowed: number[];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface ProfileCard {
|
|
131
|
-
/** Profile's description */
|
|
132
|
-
description: string;
|
|
133
|
-
|
|
134
|
-
/** Profile's banner */
|
|
135
|
-
banner: Banner;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface Confirm {
|
|
139
|
-
/** Confirm's type */
|
|
140
|
-
type: string;
|
|
141
|
-
|
|
142
|
-
/** Confirm's id */
|
|
143
|
-
ids: string[];
|
|
144
|
-
|
|
145
|
-
/** Confirm's counts */
|
|
146
|
-
count: number;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export type Optional<T> = { [K in keyof T]?: T[K] };
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
export enum MATCHTYPES {
|
|
153
|
-
OneVOne = "1v1",
|
|
154
|
-
TwoVTwo = "2v2",
|
|
155
|
-
ThreeVThree = "3v3",
|
|
156
|
-
FourVFour = "4v4",
|
|
157
|
-
FiveVFive = "5v5",
|
|
158
|
-
SixVSix = "6v6",
|
|
159
|
-
}
|
|
160
|
-
export enum MATCHSTATUS {
|
|
161
|
-
ON = "on",
|
|
162
|
-
OFF = "off",
|
|
163
|
-
CREATED = "created",
|
|
164
|
-
SHUTTED = "shutted",
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export enum BETSTATUS {
|
|
168
|
-
ON = "on",
|
|
169
|
-
OFF = "off",
|
|
170
|
-
CREATED = "created",
|
|
171
|
-
SHUTTED = "shutted",
|
|
172
|
-
WAITING = "waiting",
|
|
173
|
-
}
|
|
174
|
-
export enum STATES {
|
|
175
|
-
ON = "on",
|
|
176
|
-
OFF = "off",
|
|
177
|
-
CREATED = "created",
|
|
178
|
-
SHUTTED = "shutted",
|
|
179
|
-
WAITING = "waiting",
|
|
180
|
-
}
|
package/v1/utils/Assertion.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class used to assert types in the sdk
|
|
3
|
-
*/
|
|
4
|
-
export class Assertion {
|
|
5
|
-
constructor() {}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Tests if given key is a string
|
|
9
|
-
* @param key Key to test
|
|
10
|
-
*/
|
|
11
|
-
static assertString(key: unknown): key is string {
|
|
12
|
-
if (typeof key !== "string") throw new Error(`${key} must be a string`);
|
|
13
|
-
if (!key || key === "") throw new Error(`${key} must be a string`);
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Tests if given key is a number
|
|
19
|
-
* @param key Key to test
|
|
20
|
-
*/
|
|
21
|
-
static assertNumber(key: unknown): key is number {
|
|
22
|
-
if (typeof key !== "number") throw new Error(`${key} must be a number`);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Tests if given key is a boolean
|
|
28
|
-
* @param key Key to test
|
|
29
|
-
*/
|
|
30
|
-
static assertBoolean(key: unknown): key is boolean {
|
|
31
|
-
if (typeof key !== "boolean") throw new Error(`${key} must be a boolean`);
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Tests if given key is an array
|
|
37
|
-
* @param key Key to test
|
|
38
|
-
*/
|
|
39
|
-
static assertArray(key: unknown): key is object {
|
|
40
|
-
if (!Array.isArray(key)) throw new Error(`${key} must be an array`);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Tests if given key is an object
|
|
46
|
-
* @param key Key to test
|
|
47
|
-
*/
|
|
48
|
-
static assertObject(key: unknown): key is object {
|
|
49
|
-
if (typeof key !== "object") throw new Error(`${key} must be an object`);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
toString() {
|
|
54
|
-
return 'string, number, boolean, array, object';
|
|
55
|
-
}
|
|
56
|
-
}
|