fix(prettier): Properly handle lint-stage files (#6970)
Now handles top level files and recursive files in folders. Set max line length to be 100
This commit is contained in:
@@ -47,18 +47,13 @@ const encodeBody = function ({ body, headers = {} }) {
|
||||
} else {
|
||||
/* istanbul ignore next */
|
||||
if (contentTypeKeys.length > 1) {
|
||||
log.error(
|
||||
'Parse.Cloud.httpRequest',
|
||||
'multiple content-type headers are set.'
|
||||
);
|
||||
log.error('Parse.Cloud.httpRequest', 'multiple content-type headers are set.');
|
||||
}
|
||||
// There maybe many, we'll just take the 1st one
|
||||
var contentType = contentTypeKeys[0];
|
||||
if (headers[contentType].match(/application\/json/i)) {
|
||||
body = JSON.stringify(body);
|
||||
} else if (
|
||||
headers[contentType].match(/application\/x-www-form-urlencoded/i)
|
||||
) {
|
||||
} else if (headers[contentType].match(/application\/x-www-form-urlencoded/i)) {
|
||||
body = querystring.stringify(body);
|
||||
}
|
||||
}
|
||||
@@ -137,10 +132,7 @@ module.exports = function httpRequest(options) {
|
||||
requestOptions.agent = options.agent;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = client.request(
|
||||
requestOptions,
|
||||
makeCallback(resolve, reject, options)
|
||||
);
|
||||
const req = client.request(requestOptions, makeCallback(resolve, reject, options));
|
||||
if (options.body) {
|
||||
req.write(options.body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user