chore: use satisfies where applicable (#8884)

* chore: use satisfies where applicable

* chore: remove unneeded eslint ignores

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Suneet Tipirneni
2022-12-15 21:12:38 -05:00
committed by GitHub
parent 7a5134459c
commit 273ba45e27
5 changed files with 13 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ import type { RESTOptions } from '../REST.js';
export const DefaultUserAgent = `DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])`;
export const DefaultRestOptions: Required<RESTOptions> = {
export const DefaultRestOptions = {
get agent() {
return new Agent({
connect: {
@@ -28,7 +28,7 @@ export const DefaultRestOptions: Required<RESTOptions> = {
hashSweepInterval: 14_400_000, // 4 Hours
hashLifetime: 86_400_000, // 24 Hours
handlerSweepInterval: 3_600_000, // 1 Hour
};
} as const satisfies Required<RESTOptions>;
/**
* The events that the REST manager emits
@@ -42,9 +42,9 @@ export const enum RESTEvents {
Response = 'response',
}
export const ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'] as const;
export const ALLOWED_STICKER_EXTENSIONS = ['png', 'json'] as const;
export const ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1_024, 2_048, 4_096] as const;
export const ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'] as const satisfies readonly string[];
export const ALLOWED_STICKER_EXTENSIONS = ['png', 'json'] as const satisfies readonly string[];
export const ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1_024, 2_048, 4_096] as const satisfies readonly number[];
export type ImageExtension = typeof ALLOWED_EXTENSIONS[number];
export type StickerExtension = typeof ALLOWED_STICKER_EXTENSIONS[number];