mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +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
|
||||
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',
|
||||
'export { template }'
|
||||
].join('\n')
|
||||
|
Loading…
Reference in New Issue
Block a user