From 1f391bfec93975cd02dc3dc26cf227ca9c3e2ca4 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 10 Sep 2024 22:38:20 +0100 Subject: [PATCH] chore: update to stricter types --- packages/kit/src/nitro.ts | 3 ++- packages/nuxt/src/core/nitro.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/nitro.ts b/packages/kit/src/nitro.ts index 72b3ca93f3..f23dce44d0 100644 --- a/packages/kit/src/nitro.ts +++ b/packages/kit/src/nitro.ts @@ -1,6 +1,7 @@ import type { Nitro, NitroDevEventHandler, NitroEventHandler } from 'nitropack' import type { Import } from 'unimport' import { normalize } from 'pathe' +import type { HTTPMethod } from 'h3' import { useNuxt } from './context' import { toArray } from './utils' @@ -12,7 +13,7 @@ function normalizeHandlerMethod (handler: NitroEventHandler) { // retrieve method from handler file name const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || [] return { - method, + method: method as HTTPMethod, ...handler, handler: normalize(handler.handler), } diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 72ea099e49..85b27f9270 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -395,7 +395,6 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) { // Init nitro const nitro = await createNitro(nitroConfig, { - // @ts-expect-error this will be valid in a future version of Nitro compatibilityDate: nuxt.options.compatibilityDate, })