export function buildQuery(params) { const searchParams = new URLSearchParams(params); for (let [key, value] of searchParams.entries()) { if (!value) searchParams.delete(key); } return searchParams.toString(); }