Run Prettier JS (#6795)

This commit is contained in:
Diamond Lewis
2020-07-13 13:06:52 -05:00
committed by GitHub
parent ebb0727793
commit e6a6354b29
47 changed files with 313 additions and 329 deletions

View File

@@ -10,9 +10,9 @@ const clients = {
};
function makeCallback(resolve, reject) {
return function(response) {
return function (response) {
const chunks = [];
response.on('data', chunk => {
response.on('data', (chunk) => {
chunks.push(chunk);
});
response.on('end', () => {
@@ -30,11 +30,11 @@ function makeCallback(resolve, reject) {
};
}
const encodeBody = function({ body, headers = {} }) {
const encodeBody = function ({ body, headers = {} }) {
if (typeof body !== 'object') {
return { body, headers };
}
var contentTypeKeys = Object.keys(headers).filter(key => {
var contentTypeKeys = Object.keys(headers).filter((key) => {
return key.match(/content-type/i) != null;
});
@@ -118,7 +118,7 @@ module.exports = function httpRequest(options) {
followRedirects: options.followRedirects === true,
};
if (requestOptions.headers) {
Object.keys(requestOptions.headers).forEach(key => {
Object.keys(requestOptions.headers).forEach((key) => {
if (typeof requestOptions.headers[key] === 'undefined') {
delete requestOptions.headers[key];
}
@@ -144,7 +144,7 @@ module.exports = function httpRequest(options) {
if (options.body) {
req.write(options.body);
}
req.on('error', error => {
req.on('error', (error) => {
reject(error);
});
req.end();