mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-26 02:47:34 +00:00
10 lines
311 B
TypeScript
10 lines
311 B
TypeScript
import type { SchemaDefinition } from '@nuxt/schema'
|
|
import { useNuxt } from '../context'
|
|
|
|
export function extendNuxtSchema (def: SchemaDefinition | (() => SchemaDefinition)) {
|
|
const nuxt = useNuxt()
|
|
nuxt.hook('schema:extend', (schemas) => {
|
|
schemas.push(typeof def === 'function' ? def() : def)
|
|
})
|
|
}
|