text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = parseResponse;
  function parseResponse(res) {
    return res.text().then(function (resText) {
      var response = res;
  
      if (!response.ok) {
        var error = new Error(response.statusText);
        error.status = response.status;
  
        throw error;
      }
  
      try {
        response.bodyParsed = JSON.parse(resText);
      } catch (e) {
        response.bodyParsed = resText;
      }
  
      return response;
    });
  }