From e5cb862987493a92e3df4bf8697964ce88bfea52 Mon Sep 17 00:00:00 2001 From: Joe Sweeney Date: Fri, 10 May 2024 17:23:37 -0600 Subject: [PATCH] jsr unhappy, bring back middleware declaration --- deno.json | 2 +- deps.ts | 2 +- src/Middleware.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deno.json b/deno.json index 4a687cb..36dd3ff 100644 --- a/deno.json +++ b/deno.json @@ -1,5 +1,5 @@ { "name": "@jcs224/hono-sessions", - "version": "0.5.0", + "version": "0.5.1", "exports": "./mod.ts" } \ No newline at end of file diff --git a/deps.ts b/deps.ts index 3022cc0..47cb4fc 100644 --- a/deps.ts +++ b/deps.ts @@ -1,4 +1,4 @@ -export type { Context } from 'npm:hono@^4.0.0' +export type { Context, MiddlewareHandler } from 'npm:hono@^4.0.0' export { createMiddleware } from 'npm:hono@^4.0.0/factory' export { getCookie, setCookie } from 'npm:hono@^4.0.0/cookie' export type { CookieOptions } from 'npm:hono@^4.0.0/utils/cookie' diff --git a/src/Middleware.ts b/src/Middleware.ts index a7bd931..9d4281a 100644 --- a/src/Middleware.ts +++ b/src/Middleware.ts @@ -1,4 +1,4 @@ -import { getCookie, setCookie, createMiddleware } from '../deps.ts' +import { getCookie, setCookie, createMiddleware, MiddlewareHandler } from '../deps.ts' import Store from './store/Store.ts' import CookieStore from './store/CookieStore.ts' import { Session, SessionData, encrypt, decrypt } from '../mod.ts' @@ -13,7 +13,7 @@ interface SessionOptions { } /** Function that returns a Hono-compatible session middleware */ -export function sessionMiddleware(options: SessionOptions) { +export function sessionMiddleware(options: SessionOptions): MiddlewareHandler { const store = options.store const encryptionKey = options.encryptionKey