mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-24 07:03:07 +02:00
Eliminate if-statement (#3556)
This commit is contained in:
parent
706d47ec32
commit
fb8b0c291d
1 changed files with 1 additions and 5 deletions
|
@ -61,11 +61,7 @@ export default abstract class Chart<T> {
|
||||||
|
|
||||||
constructor(name: string, grouped = false) {
|
constructor(name: string, grouped = false) {
|
||||||
this.collection = db.get<Log<T>>(`chart.${name}`);
|
this.collection = db.get<Log<T>>(`chart.${name}`);
|
||||||
if (grouped) {
|
this.collection.createIndex({ span: -1, date: -1, group: grouped ? -1 : undefined }, { unique: true });
|
||||||
this.collection.createIndex({ span: -1, date: -1, group: -1 }, { unique: true });
|
|
||||||
} else {
|
|
||||||
this.collection.createIndex({ span: -1, date: -1 }, { unique: true });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
Loading…
Reference in a new issue