diff options
Diffstat (limited to 'node_modules/axios/lib/core/transformData.js')
-rw-r--r-- | node_modules/axios/lib/core/transformData.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/axios/lib/core/transformData.js b/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..e0653620e --- /dev/null +++ b/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,20 @@ +'use strict'; + +var utils = require('./../utils'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; +}; |