chore: type check

This commit is contained in:
harlan 2025-02-14 18:22:20 +11:00
parent e78d763def
commit 071a11fbca
2 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@ import destr from 'destr'
import { getQuery as getURLQuery, joinURL, withoutTrailingSlash } from 'ufo'
import { renderToString as _renderToString } from 'vue/server-renderer'
import { createHead as createServerHead, propsToString, renderSSRHead } from '@unhead/vue/server'
import type { Head, HeadEntryOptions, Link, Script, Style } from '@unhead/vue/types'
import type { Head, HeadEntryOptions, Link, Script, Style, ResolvedHead } from '@unhead/vue/types'
import { defineRenderHandler, getRouteRules, useNitroApp, useRuntimeConfig, useStorage } from 'nitro/runtime'
import type { NuxtPayload, NuxtSSRContext } from 'nuxt/app'
@ -471,14 +471,16 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
// Response for component islands
if (isRenderingIsland && islandContext) {
const islandHead: Head = {}
const islandHead: ResolvedHead = {}
for (const tag of tags) {
const currentValue = islandHead[tag.tag as keyof Head]
if (['meta', 'link', 'style', 'script', 'noscript'].includes(tag.tag)) {
const value = currentValue || []
value.push(tag.props)
;(value as any[]).push(tag.props)
// @ts-expect-error type juggling
islandHead[tag.tag as keyof Head] = value
} else {
// @ts-expect-error type juggling
islandHead[tag.tag as keyof Head] = tag.props
}
}

View File

@ -6,8 +6,6 @@ import { isCI, isWindows } from 'std-env'
import { join, normalize } from 'pathe'
import { $fetch as _$fetch, createPage, fetch, isDev, setup, startServer, url, useTestContext } from '@nuxt/test-utils/e2e'
import { $fetchComponent } from '@nuxt/test-utils/experimental'
import { resolveUnrefHeadInput } from '@unhead/vue'
import { expectNoClientErrors, expectWithPolling, gotoPath, isRenderingJson, parseData, parsePayload, renderPage } from './utils'
import type { NuxtIslandResponse } from '#app'
@ -2406,7 +2404,7 @@ describe('component islands', () => {
if (key === 'link') {
result.head[key] = result.head[key]?.map((h) => {
if (h.href) {
h.href = resolveUnrefHeadInput(h.href).replace(fixtureDir, '/<rootDir>').replaceAll('//', '/')
h.href = String(h.href).replace(fixtureDir, '/<rootDir>').replaceAll('//', '/')
}
return h
})