chore: lint and fmt

This commit is contained in:
Julien Calixte
2026-03-28 09:38:55 +01:00
parent 8e8706e258
commit 5f48aa5690
108 changed files with 726 additions and 680 deletions

View File

@@ -21,7 +21,7 @@ class Data {
constructor() {
try {
this.locale = new PouchDb("remanso", {
adapter: "indexeddb",
adapter: "indexeddb"
})
} catch (error) {
console.warn("data error", error)
@@ -40,7 +40,7 @@ class Data {
}
public async update<DT extends DataType, T extends Model<DT>>(
model: T,
model: T
): Promise<boolean> {
try {
if (!model._id) {
@@ -71,7 +71,7 @@ class Data {
}
const result = await this.locale?.put({
...doc,
_deleted: true,
_deleted: true
})
return result?.ok ?? false
} catch {
@@ -80,7 +80,7 @@ class Data {
}
public async get<DT extends DataType, T extends Model<DT>>(
id: string,
id: string
): Promise<T | null> {
try {
return ((await this.locale?.get(id)) as T) || null
@@ -91,7 +91,7 @@ class Data {
public async getOrCreate<DT extends DataType, T extends Model<DT>>(
id: string,
initialValue: T,
initialValue: T
): Promise<T> {
const element = await this.get<DT, T>(id)
@@ -108,7 +108,7 @@ class Data {
prefix,
includeDocs = true,
includeAttachments = false,
keys = [],
keys = []
}: GetAllParams): Promise<T[]> {
if (!this.locale) {
return []
@@ -118,7 +118,7 @@ class Data {
const response = await this.locale.allDocs({
include_docs: includeDocs,
attachments: includeAttachments,
keys: keys.map((key) => this.generateId(prefix, key)),
keys: keys.map((key) => this.generateId(prefix, key))
})
if (includeDocs) {
@@ -148,7 +148,7 @@ class Data {
include_docs: includeDocs,
attachments: includeAttachments,
startkey: prefix ? prefix : undefined,
endkey: prefix ? `${prefix}\ufff0` : undefined,
endkey: prefix ? `${prefix}\ufff0` : undefined
})
return response.rows.map((row) => row.doc) as T[]