Skip to content

Commit

Permalink
chore: fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Sep 10, 2023
1 parent b8c852e commit e4809d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/unhead/src/plugins/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ export default defineHeadPlugin({
mode: 'server',
hooks: {
'tags:resolve': function (ctx) {
const payload: { titleTemplate: string | ((s: string) => string); templateParams: Record<string, string>; title: string } = {}
const payload: { titleTemplate?: string | ((s: string) => string); templateParams?: Record<string, string>; title?: string } = {}
ctx.tags.filter(tag => ['titleTemplate', 'templateParams', 'title'].includes(tag.tag) && tag._m === 'server')
.forEach((tag) => {
// @ts-expect-error untyped
payload[tag.tag] = tag.tag.startsWith('title') ? tag.textContent : tag.props
})
// add tag for rendering
Expand Down

0 comments on commit e4809d8

Please sign in to comment.