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:
+5
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user