diff options
author | 2024-04-11 14:41:22 +0000 | |
---|---|---|
committer | 2024-04-11 14:41:22 +0000 | |
commit | ae12a7e32cbd3471e7f8fcea0cd8d3bbfee79c3e (patch) | |
tree | 617da38676909c1035e7861053d13117668838cf | |
parent | 742866c5669a2be4f8b5a4c861cadb933c381415 (diff) | |
download | astro-ae12a7e32cbd3471e7f8fcea0cd8d3bbfee79c3e.tar.gz astro-ae12a7e32cbd3471e7f8fcea0cd8d3bbfee79c3e.tar.zst astro-ae12a7e32cbd3471e7f8fcea0cd8d3bbfee79c3e.zip |
[ci] format
-rw-r--r-- | packages/astro/src/content/runtime.ts | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts index 0ad74de3e..c4fc85739 100644 --- a/packages/astro/src/content/runtime.ts +++ b/packages/astro/src/content/runtime.ts @@ -83,29 +83,31 @@ export function createGetCollection({ } else { const limit = pLimit(10); entries = await Promise.all( - lazyImports.map((lazyImport) => limit(async () => { - const entry = await lazyImport(); - return type === 'content' - ? { - id: entry.id, - slug: entry.slug, - body: entry.body, - collection: entry.collection, - data: entry.data, - async render() { - return render({ - collection: entry.collection, - id: entry.id, - renderEntryImport: await getRenderEntryImport(collection, entry.slug), - }); - }, - } - : { - id: entry.id, - collection: entry.collection, - data: entry.data, - }; - })) + lazyImports.map((lazyImport) => + limit(async () => { + const entry = await lazyImport(); + return type === 'content' + ? { + id: entry.id, + slug: entry.slug, + body: entry.body, + collection: entry.collection, + data: entry.data, + async render() { + return render({ + collection: entry.collection, + id: entry.id, + renderEntryImport: await getRenderEntryImport(collection, entry.slug), + }); + }, + } + : { + id: entry.id, + collection: entry.collection, + data: entry.data, + }; + }) + ) ); cacheEntriesByCollection.set(collection, entries); } |