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

fix linting errors

This commit is contained in:
Jorik Tangelder
2016-01-03 12:17:43 +01:00
parent 85a3f7ba82
commit ef6bfe8cb2
+4 -4
View File
@@ -19,7 +19,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
// For IE 8/9 CORS support // For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers. // Only supports POST and GET calls and doesn't returns the response headers.
if (window.XDomainRequest && !("withCredentials" in request) && !isURLSameOrigin(config.url)) { if (window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
request = new window.XDomainRequest(); request = new window.XDomainRequest();
} }
@@ -41,7 +41,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
return; return;
} }
// Prepare the response // Prepare the response
var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response; var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;
var response = { var response = {
data: transformData( data: transformData(
@@ -55,7 +55,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
config: config config: config
}; };
// Resolve or reject the Promise based on the status // Resolve or reject the Promise based on the status
((request.status >= 200 && request.status < 300) || (!("status" in request) && request.responseText) ? ((request.status >= 200 && request.status < 300) || (!('status' in request) && request.responseText) ?
resolve : resolve :
reject)(response); reject)(response);
@@ -80,7 +80,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
} }
// Add headers to the request // Add headers to the request
if ("setRequestHeader" in request) { if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) { utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (!requestData && key.toLowerCase() === 'content-type') { if (!requestData && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined // Remove Content-Type if data is undefined