Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 2, 2023
1 parent ebce3bb commit 24b2904
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/next/src/lib/metadata/generate/meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ export function Meta({
return null
}

export function MetaFilter<T extends {} | {}[]>(
items: (T | null)[]
): NonNullable<T>[] {
return items.filter(
(item): item is NonNullable<T> =>
nonNullable(item) && !(Array.isArray(item) && item.length === 0)
)
}

type ExtendMetaContent = Record<
string,
undefined | string | URL | number | boolean | null | undefined
Expand Down Expand Up @@ -113,12 +122,3 @@ export function MultiMeta({
})
)
}

export function MetaFilter<T extends {} | {}[]>(
items: (T | null)[]
): NonNullable<T>[] {
return items.filter(
(item): item is NonNullable<T> =>
nonNullable(item) && !(Array.isArray(item) && item.length === 0)
)
}

0 comments on commit 24b2904

Please sign in to comment.