From 16ac01a757788fb4992a325f7522ad3cf44badd2 Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Sun, 29 Sep 2024 13:48:31 +0200 Subject: [PATCH] refactor: rename typed router function --- src/pages.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages.ts b/src/pages.ts index d2230aec0..12b4b780f 100644 --- a/src/pages.ts +++ b/src/pages.ts @@ -68,7 +68,7 @@ export async function setupPages({ localeCodes, options, isSSR }: I18nNuxtContex mergeLayerPages(analyzer, nuxt) if (typedRouter) { - await typedRouter.createTypedRouterContext(pages).scanPages(false) + await typedRouter.createContext(pages).scanPages(false) } const localizedPages = localizeRoutes(pages, { @@ -117,7 +117,7 @@ async function setupExperimentalTypedRoutes(userOptions: NuxtI18nOptions, nuxt: * Typed route generation from Nuxt with modifications * https://github.com/nuxt/nuxt/blob/781d8c4174c410a7aff6b809817b15eae85d3ba8/packages/nuxt/src/pages/module.ts#L160-L208 */ - function createTypedRouterContext(pages: NuxtPage[]) { + function createContext(pages: NuxtPage[]) { const typedRouteroptions: TypedRouterOptions = { routesFolder: [], dts: dtsFile, @@ -194,11 +194,9 @@ export {}` references.push({ types: './types/i18n-generated-route-types.d.ts' }) }) - await createTypedRouterContext(nuxt.apps.default?.pages ?? []).scanPages(false) + await createContext(nuxt.apps.default?.pages ?? []).scanPages(false) - return { - createTypedRouterContext - } + return { createContext } } /**