var assertOkResponseCode = (response => {
  if (!response.ok) {
    return Promise.reject(new Error(response.statusText));
  }
  return response;
});

function encodeQueryParams(attributes) {
  try {
    const params = Object.keys(attributes).filter(key => attributes[key] === false || attributes[key]).map(key => `${key}=${attributes[key]}`);
    return `?${params.join('&')}`;
  } catch (error) {
    // eslint-disable-next-line no-console
    console.error('Error encoding query parameters', error);
    return '';
  }
}

export { assertOkResponseCode as a, encodeQueryParams as e };
//# sourceMappingURL=encodeQueryParams-96e87b36.js.map
