Skip to content

Commit 7afafbd

Browse files
chore: lint & fmt
1 parent aeb21a4 commit 7afafbd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/error.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ export interface ITpyErrors {
5252
*
5353
* @template T The type of {@linkcode rawInfo}.
5454
*/
55-
export class TpyError<T>
56-
extends Error
57-
implements Omit<ITpyErrors[string], "message">
58-
{
55+
export class TpyError<T> extends Error
56+
implements Omit<ITpyErrors[string], "message"> {
5957
/**
6058
* A short description of the Tpy error.
6159
*/
@@ -86,7 +84,7 @@ export class TpyError<T>
8684
* name index of {@linkcode TpyErrors}.
8785
*/
8886
messageContext: string,
89-
rawinfo: T
87+
rawinfo: T,
9088
) {
9189
super(TpyErrors[name].message(messageContext));
9290
this.name = name;
@@ -105,7 +103,8 @@ export class TpyError<T>
105103
export const TpyErrors = {
106104
"Internal Server Error": {
107105
message: (s: string) => serverRespondedWith(s),
108-
description: `Sometimes thrown when a request's authorization header is invalid.`,
106+
description:
107+
`Sometimes thrown when a request's authorization header is invalid.`,
109108
},
110109
"Missing or Unexpected Value in Response": {
111110
message: (s: string) => `Response structure validation failed: ${s}.`,
@@ -114,7 +113,8 @@ export const TpyErrors = {
114113
"Missing or Invalid JSON in Request Body": {
115114
message: (s: string) =>
116115
`With given field(s) ${s} were unsatisfactory; contains invalid JSON.`,
117-
description: `The fetch contents sent were did not have the required JSON body.`,
116+
description:
117+
`The fetch contents sent were did not have the required JSON body.`,
118118
},
119119
"Guild Not Found": {
120120
message: (s: string) => couldNotBeFound("Guild ID", s),
@@ -187,7 +187,7 @@ export function responseBody(s: string) {
187187
*/
188188
export function parametersPrompt(
189189
issue: "missing" | "incompatible",
190-
params: string | string[]
190+
params: string | string[],
191191
) {
192192
return `Parameter(s) are ${issue}: ${
193193
Array.isArray(params) ? params.join(", ") : params

src/ws.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@ export class TpyWs {
5959
constructor(
6060
tpyInstance: Tpy,
6161
deploymentID: string,
62-
reconnectionTimeout = 250
62+
reconnectionTimeout = 250,
6363
) {
6464
if (!tpyInstance || !(tpyInstance instanceof Tpy)) {
6565
throw new TpyError(
6666
"Missing or Invalid Required Parameter",
6767
parametersPrompt(
6868
!tpyInstance ? "missing" : "incompatible",
69-
"tpyInstance"
69+
"tpyInstance",
7070
),
7171
"tpyInstance",
72-
tpyInstance
72+
tpyInstance,
7373
);
7474
}
7575
if (!deploymentID) {
7676
throw new TpyError(
7777
"Missing or Invalid Required Parameter",
7878
parametersPrompt("missing", "deploymentID"),
7979
"deploymentID",
80-
deploymentID
80+
deploymentID,
8181
);
8282
}
8383
this.tpyClient = tpyInstance;
@@ -124,20 +124,20 @@ export class TpyWs {
124124
*/
125125
on<T extends unknown[]>(
126126
type: "message",
127-
callback: (data: Unpacked<PylonWebSocket.Response<T>>) => void
127+
callback: (data: Unpacked<PylonWebSocket.Response<T>>) => void,
128128
): EventEmitter;
129129
on<T extends unknown[]>(type: messageTypes, callback: unknown) {
130130
if (typeof callback != "function") {
131131
throw new TpyError(
132132
"Missing or Invalid Required Parameter",
133133
parametersPrompt("incompatible", "callback"),
134134
"callback",
135-
typeof callback
135+
typeof callback,
136136
);
137137
}
138138
return this.eventEmitter.on(
139139
type,
140-
<(data: Unpacked<PylonWebSocket.Response<T>>) => void>callback
140+
<(data: Unpacked<PylonWebSocket.Response<T>>) => void> callback,
141141
);
142142
}
143143

@@ -147,7 +147,7 @@ export class TpyWs {
147147
async connect() {
148148
if (!this.tryToConnect) return;
149149
this._websocket = new WebSocket(
150-
(await this.tpyClient.getDeployment(this.deploymentID)).workbench_url
150+
(await this.tpyClient.getDeployment(this.deploymentID)).workbench_url,
151151
);
152152

153153
this._websocket.onopen = ((event: Event) => {

0 commit comments

Comments
 (0)