2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

Adding ESLint

This commit is contained in:
mzabriskie
2015-03-17 14:14:26 -06:00
parent 7387829d33
commit a98c61f458
17 changed files with 128 additions and 77 deletions
+3 -3
View File
@@ -1,5 +1,3 @@
'use strict';
var utils = require('./utils');
var JSON_START = /^\s*(\[|\{[^\{])/;
@@ -11,6 +9,7 @@ var DEFAULT_CONTENT_TYPE = {
module.exports = {
transformRequest: [function (data, headers) {
'use strict';
if (utils.isArrayBuffer(data)) {
return data;
}
@@ -28,6 +27,7 @@ module.exports = {
}],
transformResponse: [function (data) {
'use strict';
if (typeof data === 'string') {
data = data.replace(PROTECTION_PREFIX, '');
if (JSON_START.test(data) && JSON_END.test(data)) {
@@ -48,4 +48,4 @@ module.exports = {
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN'
};
};