import utils from "../utils.mjs";
import defaults from "../defaults/index.mjs";
import AxiosHeaders from "./AxiosHeaders.mjs";
function transformData(fns, response) {
  const config = this || defaults;
  const context = response || config;
  const headers = AxiosHeaders.from(context.headers);
  let data = context.data;
  utils.forEach(fns, function transform(fn) {
    data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  });
  headers.normalize();
  return data;
}
export {
  transformData as default
};
