Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored and astrobot-houston committed Apr 11, 2024
1 parent 742866c commit ae12a7e
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions packages/astro/src/content/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ae12a7e

Please sign in to comment.