Commit 644f6583 authored by Janka Uryga's avatar Janka Uryga

better types in collectStaticImagesFiles

parent 36c289ca
...@@ -565,12 +565,12 @@ function createSegmentProps( ...@@ -565,12 +565,12 @@ function createSegmentProps(
async function collectStaticImagesFiles( async function collectStaticImagesFiles(
metadata: AppDirModules['metadata'], metadata: AppDirModules['metadata'],
props: SegmentProps, props: SegmentProps,
type: keyof NonNullable<AppDirModules['metadata']> type: 'icon' | 'apple' | 'openGraph' | 'twitter'
) { ) {
if (!metadata?.[type]) return undefined if (!metadata?.[type]) return undefined
const iconPromises = metadata[type as 'icon' | 'apple'].map( const iconPromises = metadata[type].map(
async (imageModule: (p: any) => Promise<MetadataImageModule[]>) => async (imageModule: (p: SegmentProps) => Promise<MetadataImageModule[]>) =>
await imageModule(props) await imageModule(props)
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment