From 0dd49fdfc1bd3cdf07d8d131b4b1cbcb783b5723 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Thu, 13 Aug 2026 18:57:49 +0200 Subject: [PATCH] fix: avoid runtime secure-session import --- src/flash.ts | 4 ++-- src/index.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flash.ts b/src/flash.ts index 0fec638..ed1f0f4 100644 --- a/src/flash.ts +++ b/src/flash.ts @@ -1,13 +1,13 @@ import { format } from 'node:util' import type { FastifyRequest, FastifyReply } from 'fastify' +import type { SessionData } from '@fastify/secure-session' declare module '@fastify/secure-session' { interface SessionData { flash: { [k: string]: string[] } } } - -type FlashData = { [k: string]: string[] } +type FlashData = SessionData['flash'] export type ReplyReturn = FlashData | string[] export function flashFactory () { diff --git a/src/index.ts b/src/index.ts index e7047c0..9d5ddf8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ import fp = require('fastify-plugin') import { flashFactory } from './flash' -import '@fastify/secure-session' declare module 'fastify' { export interface FastifyRequest {