Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/nuxt/src/head/runtime/components.ts
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
import { defineComponent } from 'vue'
import { defineComponent, PropType } from 'vue'
import type { SetupContext } from 'vue'
import { useHead } from './composables'

type Props = Readonly<Record<string, any>>

type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'

const removeUndefinedProps = (props: Props) =>
Object.fromEntries(Object.entries(props).filter(([, value]) => value !== undefined))

Expand DownExpand Up@@ -73,7 +75,7 @@ export const Script = defineComponent({
integrity: String,
nomodule: Boolean,
nonce: String,
referrerpolicy: String,
referrerpolicy: String as PropType<ReferrerPolicy>,
src: String,
type: String,
/** @deprecated **/
Expand DownExpand Up@@ -128,7 +130,7 @@ export const Link = defineComponent({
type: Boolean,
default: undefined
},
referrerpolicy: String,
referrerpolicy: String as PropType<ReferrerPolicy>,
rel: String,
sizes: String,
title: String,
Expand Down