mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-23 09:00:31 +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 { Nitro, NitroDevEventHandler, NitroEventHandler } from 'nitropack'
|
||||||
import type { Import } from 'unimport'
|
import type { Import } from 'unimport'
|
||||||
import { normalize } from 'pathe'
|
import { normalize } from 'pathe'
|
||||||
|
import type { HTTPMethod } from 'h3'
|
||||||
import { useNuxt } from './context'
|
import { useNuxt } from './context'
|
||||||
import { toArray } from './utils'
|
import { toArray } from './utils'
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ function normalizeHandlerMethod (handler: NitroEventHandler) {
|
|||||||
// retrieve method from handler file name
|
// retrieve method from handler file name
|
||||||
const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || []
|
const [, method = undefined] = handler.handler.match(/\.(get|head|patch|post|put|delete|connect|options|trace)(\.\w+)*$/) || []
|
||||||
return {
|
return {
|
||||||
method,
|
method: method as HTTPMethod,
|
||||||
...handler,
|
...handler,
|
||||||
handler: normalize(handler.handler),
|
handler: normalize(handler.handler),
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,6 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
|
|
||||||
// Init nitro
|
// Init nitro
|
||||||
const nitro = await createNitro(nitroConfig, {
|
const nitro = await createNitro(nitroConfig, {
|
||||||
// @ts-expect-error this will be valid in a future version of Nitro
|
|
||||||
compatibilityDate: nuxt.options.compatibilityDate,
|
compatibilityDate: nuxt.options.compatibilityDate,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user