params.js 225 B

12345678
  1. export function buildQuery(params) {
  2. const searchParams = new URLSearchParams(params);
  3. for (let [key, value] of searchParams.entries()) {
  4. if (!value) searchParams.delete(key);
  5. }
  6. return searchParams.toString();
  7. }