Enable prefer-const lint rule (#3202)
This commit is contained in:
committed by
Florent Vilmart
parent
a6c988176e
commit
ca286b7108
@@ -14,7 +14,7 @@ export default class HTTPResponse {
|
||||
_data = body;
|
||||
}
|
||||
|
||||
let getText = () => {
|
||||
const getText = () => {
|
||||
if (!_text && this.buffer) {
|
||||
_text = this.buffer.toString('utf-8');
|
||||
} else if (!_text && _data) {
|
||||
@@ -23,7 +23,7 @@ export default class HTTPResponse {
|
||||
return _text;
|
||||
}
|
||||
|
||||
let getData = () => {
|
||||
const getData = () => {
|
||||
if (!_data) {
|
||||
try {
|
||||
_data = JSON.parse(getText());
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = function(options) {
|
||||
}
|
||||
return promise.reject(error);
|
||||
}
|
||||
let httpResponse = new HTTPResponse(response, body);
|
||||
const httpResponse = new HTTPResponse(response, body);
|
||||
|
||||
// Consider <200 && >= 400 as errors
|
||||
if (httpResponse.status < 200 || httpResponse.status >= 400) {
|
||||
|
||||
Reference in New Issue
Block a user