import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
export const user = async ({ token, id }: {
token?: string;
id: string;
}): Promise<{
id: string;
username: string;
bio: string;
profileImageUrl: string;
}> =>
await (await fetch(`${API_URL}/v1/users/${id}`, {
headers: token
? {
Authorization: `Bearer ${token}`,
}
: {},
})).json();