-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.25.1
Plugin version
7.1.0
Node.js version
20.9.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
The types don't work properly.
e.g.:
declare module "@fastify/secure-session" {
interface SessionData {
userID: number;
}
}
async function login(
request: FastifyRequest,
reply: FastifyReply,
): Promise<FastifyReply> {
request.session.set("usersID", 123);
}In the above code snippet, we made a typo, and typed it as "usersID" instead of "userID". Oops! But we don't get a compiler error - it just works, and the bug makes its way to production.
Is there some way for a declaration merge to get rid of the string index signature? Because that's the root cause of the bug.
Metadata
Metadata
Assignees
Labels
No labels