@ovencord/rest 2.5.7 → 2.5.9

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/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ovencord/rest",
4
- "version": "2.5.7",
4
+ "version": "2.5.9",
5
5
  "description": "The REST API for discord.js",
6
6
  "scripts": {
7
7
  "test": "bun test",
8
8
  "typecheck": "tsc --noEmit",
9
- "lint": "eslint src"
9
+ "lint": "biome check .",
10
+ "format": "biome format --write .",
11
+ "check": "biome check --write ."
10
12
  },
11
13
  "type": "module",
12
14
  "exports": "./src/index.ts",
@@ -34,9 +36,9 @@
34
36
  "homepage": "https://ovencord.dev",
35
37
  "funding": "https://github.com/ovencord/ovencord?sponsor",
36
38
  "dependencies": {
37
- "@ovencord/collection": "^2.1.2",
38
- "@ovencord/util": "^1.1.4",
39
- "discord-api-types": "^0.38.36"
39
+ "@ovencord/collection": "^2.1.3",
40
+ "@ovencord/util": "^1.1.6",
41
+ "discord-api-types": "^0.38.40"
40
42
  },
41
43
  "devDependencies": {},
42
44
  "engines": {
package/src/lib/REST.ts CHANGED
@@ -365,7 +365,6 @@ export class REST extends AsyncEventEmitter<RestEvents> {
365
365
  }
366
366
 
367
367
  // If a JSON body was added as well, attach it to the form data, using payload_json unless otherwise specified
368
- // eslint-disable-next-line no-eq-null, eqeqeq
369
368
  if (request.body != null) {
370
369
  if (request.appendToFormData) {
371
370
  for (const [key, value] of Object.entries(request.body as Record<string, unknown>)) {
@@ -382,7 +381,6 @@ export class REST extends AsyncEventEmitter<RestEvents> {
382
381
  // Set the final body to the form data
383
382
  finalBody = formData;
384
383
 
385
- // eslint-disable-next-line no-eq-null, eqeqeq
386
384
  } else if (request.body != null) {
387
385
  if (request.passThroughBody) {
388
386
  finalBody = request.body as any;
@@ -81,7 +81,6 @@ export class BurstHandler implements IHandler {
81
81
 
82
82
  // Retry requested
83
83
  if (res === null) {
84
- // eslint-disable-next-line no-param-reassign
85
84
  return this.runRequest(routeId, url, options, requestData, ++retries);
86
85
  }
87
86
 
@@ -143,7 +142,6 @@ export class BurstHandler implements IHandler {
143
142
  } else {
144
143
  const handled = await handleErrors(this.manager, res, method, url, requestData, retries, routeId);
145
144
  if (handled === null) {
146
- // eslint-disable-next-line no-param-reassign
147
145
  return this.runRequest(routeId, url, options, requestData, ++retries);
148
146
  }
149
147
 
@@ -215,7 +215,6 @@ export class SequentialHandler implements IHandler {
215
215
  limit = this.manager.options.globalRequestsPerSecond;
216
216
  timeout = this.manager.globalReset + offset - Date.now();
217
217
  // If this is the first task to reach the global timeout, set the global delay
218
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
219
218
  if (!this.manager.globalDelay) {
220
219
  // The global delay function clears the global delay state when it is resolved
221
220
  this.manager.globalDelay = this.globalDelayFor(timeout);
@@ -273,7 +272,6 @@ export class SequentialHandler implements IHandler {
273
272
 
274
273
  // Retry requested
275
274
  if (res === null) {
276
- // eslint-disable-next-line no-param-reassign
277
275
  return this.runRequest(routeId, url, options, requestData, ++retries);
278
276
  }
279
277
 
@@ -406,7 +404,6 @@ export class SequentialHandler implements IHandler {
406
404
  this.#sublimitPromise = null;
407
405
  await sleep(sublimitTimeout);
408
406
  let resolve: () => void;
409
- // eslint-disable-next-line no-promise-executor-return
410
407
  const promise = new Promise<void>((res) => (resolve = res));
411
408
  this.#sublimitPromise = { promise, resolve: resolve! };
412
409
  if (firstSublimit) {
@@ -421,7 +418,6 @@ export class SequentialHandler implements IHandler {
421
418
  } else {
422
419
  const handled = await handleErrors(this.manager, res, method, url, requestData, retries, routeId);
423
420
  if (handled === null) {
424
- // eslint-disable-next-line no-param-reassign
425
421
  return this.runRequest(routeId, url, options, requestData, ++retries);
426
422
  }
427
423