diff --git a/bun.lockb b/bun.lockb index 0138d4e..9b786f6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c1748a8..b59415c 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "build": "unbuild", "play:basic": "bun run ./playground/basic/index.ts", "test": "npm run test:type && npm run test:unit", - "test:type": "vitest typecheck --run", + "test:type": "vitest run --typecheck", "test:unit": "vitest run", "test:coverage": "npm test -- --reporter verbose --coverage" }, @@ -71,7 +71,7 @@ "devDependencies": { "@types/node": "^20.6.0", "@types/supertest": "^2.0.12", - "@vitest/coverage-v8": "^1.0.0-beta.2", + "@vitest/coverage-v8": "^1.0.0-beta.4", "bumpp": "^9.2.0", "gh-changelogen": "^0.2.8", "h3": "^1.8.2", @@ -79,7 +79,7 @@ "supertest": "^6.3.3", "typescript": "^5.2.2", "unbuild": "^2.0.0", - "vitest": "^1.0.0-beta.2" + "vitest": "^1.0.0-beta.4a" }, "dependencies": { "@intlify/core": "^9.6.0", diff --git a/src/index.ts b/src/index.ts index 41403d5..7d722c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,11 +46,11 @@ export interface I18nMiddleware { /** * `onRequest` option of `createApp` */ - onRequest: AppOptions['onRequest'] + onRequest: NonNullable<AppOptions['onRequest']> /** * `onAfterResponse` option of `createApp` */ - onAfterResponse: AppOptions['onAfterResponse'] + onAfterResponse: NonNullable<AppOptions['onAfterResponse']> } /** @@ -101,10 +101,7 @@ export function defineI18nMiddleware< >, >( options: Options, -): { - onRequest: AppOptions['onRequest'] - onAfterResponse: AppOptions['onAfterResponse'] -} { +): I18nMiddleware { const i18n = createCoreContext(options as CoreOptions) const orgLocale = i18n.locale