mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
chore: update to stricter types
This commit is contained in:
parent
2159e11e10
commit
1f391bfec9
@ -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),
|
||||
}
|
||||
|
@ -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,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user