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

@@ -1,10 +1,7 @@
const DEFAULT_CACHE_TTL = 5 * 1000;
export class InMemoryCache {
constructor({
ttl = DEFAULT_CACHE_TTL
}) {
constructor({ ttl = DEFAULT_CACHE_TTL }) {
this.ttl = ttl;
this.cache = Object.create(null);
}
@@ -32,8 +29,8 @@ export class InMemoryCache {
var record = {
value: value,
expire: ttl + Date.now()
}
expire: ttl + Date.now(),
};
if (!isNaN(record.expire)) {
record.timeout = setTimeout(() => {
@@ -59,7 +56,6 @@ export class InMemoryCache {
clear() {
this.cache = Object.create(null);
}
}
export default InMemoryCache;