kopia lustrzana https://github.com/cloudflare/wildebeest
fix DocumentHeadValue being modified as readonly
rodzic
a97dbfa814
commit
55c780ad02
|
@ -10,6 +10,8 @@ type DocumentHeadData = {
|
|||
}
|
||||
}
|
||||
|
||||
type NoReadonly<T> = { -readonly [P in keyof T]: NoReadonly<T[P]> }
|
||||
|
||||
/**
|
||||
* Generates a head to provide to QwikCity
|
||||
*
|
||||
|
@ -18,7 +20,7 @@ type DocumentHeadData = {
|
|||
* @returns the QwikCity head ready to use
|
||||
*/
|
||||
export function getDocumentHead(data: DocumentHeadData, head?: DocumentHeadValue) {
|
||||
const result: DocumentHeadValue = { meta: [] }
|
||||
const result: NoReadonly<DocumentHeadValue> = { meta: [] }
|
||||
|
||||
const setMeta = (name: string, content: string) => {
|
||||
if (head?.meta?.some((meta) => meta.name === name)) {
|
||||
|
|
Ładowanie…
Reference in New Issue