Use Prettier JS (#5017)

* Adds prettier

* Run lint before tests
This commit is contained in:
Florent Vilmart
2018-09-01 13:58:06 -04:00
committed by GitHub
parent 189cd259ee
commit d83a0b6808
240 changed files with 41098 additions and 29020 deletions

View File

@@ -12,7 +12,7 @@ export default class HTTPResponse {
let _text, _data;
this.status = response.statusCode;
this.headers = response.headers || {};
this.cookies = this.headers["set-cookie"];
this.cookies = this.headers['set-cookie'];
if (typeof body == 'string') {
_text = body;
@@ -29,29 +29,33 @@ export default class HTTPResponse {
_text = JSON.stringify(_data);
}
return _text;
}
};
const getData = () => {
if (!_data) {
try {
_data = JSON.parse(getText());
} catch (e) { /* */ }
} catch (e) {
/* */
}
}
return _data;
}
};
Object.defineProperty(this, 'body', {
get: () => { return body }
get: () => {
return body;
},
});
Object.defineProperty(this, 'text', {
enumerable: true,
get: getText
get: getText,
});
Object.defineProperty(this, 'data', {
enumerable: true,
get: getData
get: getData,
});
}
}