mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
fix: handle empty message object when generating declaration
This commit is contained in:
parent
5f6e505ea4
commit
c398e4177e
@ -129,7 +129,7 @@ export const RenderPlugin = () => {
|
|||||||
|
|
||||||
// Generate types
|
// Generate types
|
||||||
const types = [
|
const types = [
|
||||||
`export type DefaultMessages = Record<${Object.keys(messages).map(a => `"${a}"`).join(' | ')}, string | boolean | number >`,
|
`export type DefaultMessages = Record<${Object.keys(messages).map(a => `"${a}"`).join(' | ') || 'string'}, string | boolean | number >`,
|
||||||
'declare const template: (data: Partial<DefaultMessages>) => string',
|
'declare const template: (data: Partial<DefaultMessages>) => string',
|
||||||
'export { template }'
|
'export { template }'
|
||||||
].join('\n')
|
].join('\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user