This commit is contained in:
MARCROCK22 2024-03-22 18:42:14 -04:00
parent 31937e948e
commit 4047279a7b

View File

@ -48,7 +48,7 @@ export interface MakeURLOptions {
* *
* @defaultValue `'webp'` * @defaultValue `'webp'`
*/ */
extension?: string | undefined; extension?: ImageExtension | StickerExtension | undefined;
/** /**
* The size specified in the image URL * The size specified in the image URL
*/ */
@ -306,9 +306,6 @@ export class CDN {
route: string, route: string,
{ allowedExtensions = ALLOWED_EXTENSIONS, extension = 'webp', size }: Readonly<MakeURLOptions> = {}, { allowedExtensions = ALLOWED_EXTENSIONS, extension = 'webp', size }: Readonly<MakeURLOptions> = {},
): string { ): string {
// eslint-disable-next-line no-param-reassign
extension = String(extension).toLowerCase();
if (!allowedExtensions.includes(extension)) { if (!allowedExtensions.includes(extension)) {
throw new RangeError(`Invalid extension provided: ${extension}\nMust be one of: ${allowedExtensions.join(', ')}`); throw new RangeError(`Invalid extension provided: ${extension}\nMust be one of: ${allowedExtensions.join(', ')}`);
} }