chore: update to stricter types

This commit is contained in:
Daniel Roe 2024-09-10 22:38:20 +01:00
parent 2159e11e10
commit 1f391bfec9
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
2 changed files with 2 additions and 2 deletions

View File

@ -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),
}

View File

@ -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,
})