1
0
mirror of https://github.com/MisskeyIO/misskey synced 2025-01-11 12:23:46 +09:00
MisskeyIO/packages/client/src/scripts/media-proxy.ts

14 lines
378 B
TypeScript
Raw Normal View History

import { query } from '@/scripts/url';
import { url } from '@/config';
export function getProxiedImageUrl(imageUrl: string): string {
return `${url}/proxy/image.webp?${query({
url: imageUrl,
})}`;
}
export function getProxiedImageUrlNullable(imageUrl: string | null | undefined): string | null {
if (imageUrl == null) return null;
return getProxiedImageUrl(imageUrl);
}