1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Tools: Apply rule @typescript-eslint/type-annotation-spacing

This commit is contained in:
Laurent Cozic
2020-11-12 19:13:28 +00:00
parent 62feb7ff60
commit d20694e52c
291 changed files with 2205 additions and 2203 deletions

View File

@ -15,21 +15,21 @@ interface Record {
}
interface Records {
[key:string]: Record;
[key: string]: Record;
}
interface ExpirableKeys {
[key:string]: boolean,
[key: string]: boolean,
}
export default class Cache {
private maxRecords_:number;
private records_:Records = {};
private expirableKeys_:ExpirableKeys = {};
private recordKeyHistory_:string[] = [];
private maxRecords_: number;
private records_: Records = {};
private expirableKeys_: ExpirableKeys = {};
private recordKeyHistory_: string[] = [];
constructor(maxRecords:number = 50) {
constructor(maxRecords: number = 50) {
this.maxRecords_ = maxRecords;
}
@ -55,14 +55,14 @@ export default class Cache {
}
}
public value(key:string, defaultValue:any = undefined):any {
public value(key: string, defaultValue: any = undefined): any {
this.checkExpiredRecords();
if (key in this.records_) return this.records_[key].value;
return defaultValue;
}
public setValue(key:string, value:any, ttl:number = 0) {
public setValue(key: string, value: any, ttl: number = 0) {
this.checkExpiredRecords();
this.records_[key] = {