import Papa from 'papaparse';
const parseResponseData = async function parseResponseData(response) {
  const contentType = response.headers.get('content-type');
  if (contentType === 'text/csv' || contentType === 'text/plain') {
    const text = await response.text();
    return Papa.parse(text.trim()).data;
  }
  return response.json();
};
export default parseResponseData;