You've already forked joplin
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:
@ -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] = {
|
||||
|
Reference in New Issue
Block a user