"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const utils = require("../utils.js");
const index = require("../defaults/index.js");
const AxiosHeaders = require("./AxiosHeaders.js");
function transformData(fns, response) {
  const config = this || index.default;
  const context = response || config;
  const headers = AxiosHeaders.default.from(context.headers);
  let data = context.data;
  utils.default.forEach(fns, function transform(fn) {
    data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  });
  headers.normalize();
  return data;
}
exports.default = transformData;
