mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 14:06:07 +00:00
fix: parseCDNURL extension
This commit is contained in:
parent
4221d5995b
commit
34482e4fd6
@ -71,10 +71,10 @@ export interface CDNUrlOptions extends BaseCDNUrlOptions {
|
||||
forceStatic?: boolean;
|
||||
}
|
||||
|
||||
export function parseCDNURL(route: string, options: CDNUrlOptions = { forceStatic: false }) {
|
||||
export function parseCDNURL(route: string, options: CDNUrlOptions = {}) {
|
||||
if (options.forceStatic && route.includes('a_')) options.extension = 'png';
|
||||
|
||||
const url = new URL(`${route}.${options.extension}`);
|
||||
const url = new URL(`${route}.${options.extension || 'png'}`);
|
||||
|
||||
if (options.size) url.searchParams.set('size', `${options.size}`);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user