@fulldevlabs/fullui
Version:
A component library built for Astro
11 lines (9 loc) • 375 B
text/typescript
import type { CollectionKey } from 'astro:content'
import { getCollection } from 'astro:content'
export const getAllCollections = async (names: CollectionKey[]) => {
const promises = names.map((name) => getCollection(name))
const resolved = await Promise.all(promises)
const flattened = resolved.flat()
const filtered = flattened.filter(Boolean)
return filtered
}