diff --git a/src/session/mod.ts b/src/session/mod.ts index 7917237..953f079 100644 --- a/src/session/mod.ts +++ b/src/session/mod.ts @@ -1,7 +1,7 @@ import type { PageProps } from '$fresh/server.ts' import { getCookies } from '@std/http/cookie' -type SessionEntry = { +type SessionEntry = { accessCount: number flash: boolean value: T @@ -84,7 +84,7 @@ class Session { return this.#timestamp } - get(key: string): T | undefined { + get(key: string): T | undefined { this.#updateTimestamp() const entry = this.#db.get(key) @@ -103,7 +103,7 @@ class Session { this.#db.set(key, entry) return entry.value as T } - set(key: string, value: T): void { + set(key: string, value: T): void { this.#updateTimestamp() const entry = this.#db.get(key) as SessionEntry | undefined @@ -132,7 +132,7 @@ class Session { const keys = [...this.#db.keys()] return keys.map((key) => ([key, this.get(key)] as [string, unknown])) } - flash(key: string, value: T) { + flash(key: string, value: T) { this.#updateTimestamp() const entry = this.#db.get(key) as SessionEntry | undefined