From 66438c271f85e9eb6834dcaec2de9c1be8fa9ed6 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 2 Mar 2023 18:26:40 +0100 Subject: [PATCH] fix: add more explicit return types (#49567) --- api/middleware/index.ts | 4 ++-- api/utils/index.ts | 2 +- client/src/components/Header/index.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/middleware/index.ts b/api/middleware/index.ts index 2e7134540f1..59fb5108041 100644 --- a/api/middleware/index.ts +++ b/api/middleware/index.ts @@ -5,7 +5,7 @@ export async function auth0Verify( this: FastifyInstance, request: FastifyRequest, reply: FastifyReply -) { +): Promise { await this.authenticate(request, reply); } @@ -16,7 +16,7 @@ export function testMiddleware( req: MiddieRequest, res: MiddieResponse, next: NextFunction -) { +): void { console.log('Test middleware running'); console.log(req.headers); console.log(req.query); diff --git a/api/utils/index.ts b/api/utils/index.ts index 17899676d89..fbe8447a59c 100644 --- a/api/utils/index.ts +++ b/api/utils/index.ts @@ -1,6 +1,6 @@ import { randomBytes, createHash } from 'crypto'; -export function base64URLEncode(buf: Buffer) { +export function base64URLEncode(buf: Buffer): string { return buf .toString('base64') .replace(/\+/g, '-') diff --git a/client/src/components/Header/index.tsx b/client/src/components/Header/index.tsx index 37a93dcce75..d55e39a397e 100644 --- a/client/src/components/Header/index.tsx +++ b/client/src/components/Header/index.tsx @@ -72,7 +72,7 @@ export class Header extends React.Component< } // elementToFocus must be a link in the language menu - showLanguageMenu(elementToFocus: HTMLButtonElement | null) { + showLanguageMenu(elementToFocus: HTMLButtonElement | null): void { this.setState({ isLanguageMenuDisplayed: true }, () => elementToFocus?.focus() );