mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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
|
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 {
|
export interface NuxtAppConfig {
|
||||||
head: Serializable<AppHeadMetaObject>
|
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'),
|
title: Promise.resolve('Nuxt Fixture'),
|
||||||
// @ts-expect-error Functions are not allowed
|
// @ts-expect-error Functions are not allowed
|
||||||
titleTemplate: title => 'test',
|
titleTemplate: title => 'test',
|
||||||
|
meta: [
|
||||||
|
{
|
||||||
|
// Allows unknown property
|
||||||
|
property: 'og:thing',
|
||||||
|
content: '1234567890',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
pageTransition: {
|
pageTransition: {
|
||||||
// @ts-expect-error Functions are not allowed
|
// @ts-expect-error Functions are not allowed
|
||||||
|
Loading…
Reference in New Issue
Block a user