2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Updating forEach to handle non iterable values

This commit is contained in:
Matt Zabriskie
2014-08-27 14:05:27 -06:00
parent 0c7236b292
commit d49cb34591
7 changed files with 113 additions and 42 deletions
-4
View File
@@ -11,10 +11,6 @@ var forEach = require('./forEach');
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
if (typeof fns === 'function') {
return fns(data, headers);
}
forEach(fns, function (fn) {
data = fn(data, headers);
});