import { env } from "$env/dynamic/public"; export const proxy = (url: string, disable = false) => { const randomKey = Math.floor(Math.random() * 90) + 10; return env.PUBLIC_ANILIST_REDIRECT_URI?.includes("localhost") && !disable ? url : `https://proxy.due.moe/?d2=${btoa( url .split("") .map((char) => char.charCodeAt(0) + randomKey) .join(":"), )}${randomKey}&dh`; }; export default proxy;