mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
9eeafb8c15
commit
7c37f5d8b6
19 changed files with 101 additions and 116 deletions
|
|
@ -239,4 +239,4 @@ export function d1ConfigStore(db: D1Database, kv: KVNamespace): ConfigStore {
|
|||
groupsCache = null;
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,5 @@
|
|||
* while production eagerly routes through D1.
|
||||
*/
|
||||
export function canUseD1(db: D1Database | undefined | null): boolean {
|
||||
return (
|
||||
typeof db?.prepare === "function" &&
|
||||
typeof (db as D1Database).batch === "function"
|
||||
);
|
||||
}
|
||||
return typeof db?.prepare === "function" && typeof (db as D1Database).batch === "function";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ export function r2PayloadStore(env: Env): PayloadStore {
|
|||
return {
|
||||
async put(payload: string, ttl?: number): Promise<string> {
|
||||
const key = generateKey();
|
||||
const expires = new Date(
|
||||
Date.now() + (ttl ?? DEFAULT_TTL_SECONDS) * 1000,
|
||||
);
|
||||
const expires = new Date(Date.now() + (ttl ?? DEFAULT_TTL_SECONDS) * 1000);
|
||||
await bucket.put(key, payload, {
|
||||
httpMetadata: { contentType: "application/json" },
|
||||
customMetadata: { expires: expires.toISOString() },
|
||||
|
|
@ -61,4 +59,4 @@ export function r2PayloadStore(env: Env): PayloadStore {
|
|||
await bucket.delete(key);
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue