function clearQuery(query) {
  return Object.entries(query)
    .filter(([, value]) => value !== "")
    .reduce((merged, [key, value]) => ({ ...merged, [key]: value }), {});
}
/**
 * Remove empty keys from query
 * @param {Object} query The query to clear
 * @returns {Object} Cleared query
 */
Remove empty keys from query
@param {Object} query The query to clear
@returns {Object} Cleared query
Remove empty keys from query @param { Object } query The query to clear @returns { Object } Cleared query
function clearQuery(query) {
  return Object.entries(query)
    .filter(([, value]) => value !== "")
    .reduce((merged, [key, value]) => ({ ...merged, [key]: value }), {});
}
function clearQuery ( query ) { return Object . entries ( query ) . filter ( ( [ , value ] ) => value !== "" ) . reduce ( ( merged , [ key , value ] ) => ( { ... merged , [ key ] : value } ) , { } ) ; }
Remove empty keys from query
 @param {Object} query The query to clear
 @returns {Object} Cleared query
Remove empty keys from query @param { Object } query The query to clear @returns { Object } Cleared query