mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(schema): don't narrow head string types to literals (#27540)
This commit is contained in:
parent
14fecc9f73
commit
1d94bac0af
@ -141,7 +141,7 @@ export interface AppConfigInput extends CustomAppConfig {
|
||||
server?: never
|
||||
}
|
||||
|
||||
type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T
|
||||
type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends string & {} ? T : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T
|
||||
|
||||
export interface NuxtAppConfig {
|
||||
head: Serializable<AppHeadMetaObject>
|
||||
|
7
test/fixtures/basic-types/nuxt.config.ts
vendored
7
test/fixtures/basic-types/nuxt.config.ts
vendored
@ -21,6 +21,13 @@ export default defineNuxtConfig({
|
||||
title: Promise.resolve('Nuxt Fixture'),
|
||||
// @ts-expect-error Functions are not allowed
|
||||
titleTemplate: title => 'test',
|
||||
meta: [
|
||||
{
|
||||
// Allows unknown property
|
||||
property: 'og:thing',
|
||||
content: '1234567890',
|
||||
},
|
||||
],
|
||||
},
|
||||
pageTransition: {
|
||||
// @ts-expect-error Functions are not allowed
|
||||
|
Loading…
Reference in New Issue
Block a user