From 021d9e689bda780acf4e27463b242d8e6a65b878 Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Mon, 17 Jun 2024 12:43:00 +0200 Subject: [PATCH] refactor: :recycle: remove unnecessary unknown extends in generic --- src/session/mod.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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