export function request( url: string, config: RequestInit = {}, ): Promise { return fetch(url, config) .then((response) => response.json()) .then((data) => data as TResponse); } export function buildQueryString(query: Record): string { return Object.entries(query) .map(([key, value]) => key && value ? `${encodeURIComponent(key)}=${encodeURIComponent(value)}` : "", ) .join("&"); }