Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 18 lines 408 B view raw
1import { LENS_MEDIA_SNAPSHOT_URL } from "@hey/data/constants"; 2 3const imageKit = (url: string, name?: string): string => { 4 if (!url) { 5 return ""; 6 } 7 8 if (url.includes(LENS_MEDIA_SNAPSHOT_URL)) { 9 const splitUrl = url.split("/"); 10 const path = splitUrl[splitUrl.length - 1]; 11 12 return name ? `${LENS_MEDIA_SNAPSHOT_URL}/${name}/${path}` : url; 13 } 14 15 return url; 16}; 17 18export default imageKit;