mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-16 18:29:01 +01:00
14 lines
378 B
TypeScript
14 lines
378 B
TypeScript
|
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);
|
||
|
}
|