mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: correctly build cdn route
This commit is contained in:
parent
f1068817c0
commit
35bd23b160
@ -43,14 +43,12 @@ export const CDNRouter = {
|
||||
return new Proxy(noop, {
|
||||
get: (_, key: string) => {
|
||||
if (key === 'get') {
|
||||
return (value: string | CDNUrlOptions | undefined, options?: CDNUrlOptions) => {
|
||||
return (value: string | number | CDNUrlOptions | undefined, options?: CDNUrlOptions) => {
|
||||
const lastRoute = `${CDN_URL}/${route.join('/')}`;
|
||||
let routeResult = lastRoute;
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
routeResult = `${lastRoute}${value ? `/${value}` : ''}`;
|
||||
return parseCDNURL(routeResult, options);
|
||||
return parseCDNURL(`${lastRoute}/${value}`, options);
|
||||
}
|
||||
return parseCDNURL(routeResult, value);
|
||||
return parseCDNURL(lastRoute, value);
|
||||
};
|
||||
}
|
||||
return this.createProxy([...route, key]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user