import { toArray } from "./utils"; export default function (params, evolver = Object.create(null)) { const query = Object.keys(params) .map(key => [key, params[key]]) .map(([key, value]) => [key, Object.prototype.hasOwnProperty.call(evolver, key) ? evolver[key](value) : value]) .filter(([key, value]) => value != null) .map(([key, value]) => toArray(value).map(v => `${key}=${v}`).join('&')) .join('&'); return query.length ? `?${query}` : ''; } ; //# sourceMappingURL=query.js.map