2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Using more strict eslint rules

This commit is contained in:
Matt Zabriskie
2015-12-14 20:06:57 -07:00
parent 2b147fb0b7
commit f28a4a8248
16 changed files with 230 additions and 93 deletions
+5 -4
View File
@@ -8,8 +8,8 @@ var DEFAULT_CONTENT_TYPE = {
};
module.exports = {
transformRequest: [function (data, headers) {
if(utils.isFormData(data)) {
transformRequest: [function transformResponseJSON(data, headers) {
if (utils.isFormData(data)) {
return data;
}
if (utils.isArrayBuffer(data)) {
@@ -21,7 +21,7 @@ module.exports = {
if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {
// Set application/json if no Content-Type has been specified
if (!utils.isUndefined(headers)) {
utils.forEach(headers, function (val, key) {
utils.forEach(headers, function processContentTypeHeader(val, key) {
if (key.toLowerCase() === 'content-type') {
headers['Content-Type'] = val;
}
@@ -36,7 +36,8 @@ module.exports = {
return data;
}],
transformResponse: [function (data) {
transformResponse: [function transformResponseJSON(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
data = data.replace(PROTECTION_PREFIX, '');
try {