diff --git a/packages/storage/storage-json/src/unit.ts b/packages/storage/storage-json/src/unit.ts index 1bf272ec19..9591c30573 100644 --- a/packages/storage/storage-json/src/unit.ts +++ b/packages/storage/storage-json/src/unit.ts @@ -56,13 +56,14 @@ class JsonKvUnit implements KvUnit { private readonly onClose: () => void, ) {} - loadAll(): Promise<{ tables: Record>; global: unknown }> { + // eslint-disable-next-line @typescript-eslint/require-await -- async keeps the closed guard a rejection, not a synchronous throw + async loadAll(): Promise<{ tables: Record>; global: unknown }> { this.assertOpen() const tables: Record> = {} for (const [table, records] of this.state.tables) { tables[table] = Object.fromEntries(records) } - return Promise.resolve({ tables, global: this.state.global }) + return { tables, global: this.state.global } } async putRecord(table: string, key: string, value: unknown): Promise {