2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Moving stuff to helpers/

This commit is contained in:
mzabriskie
2014-09-22 11:12:24 -06:00
parent edb0c3ce24
commit 1b803fb233
14 changed files with 18 additions and 19 deletions
+19
View File
@@ -0,0 +1,19 @@
'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) {
utils.forEach(fns, function (fn) {
data = fn(data, headers);
});
return data;
};