Skip to content

Commit

Permalink
fix: algolia await only works with type module
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuhito committed Jan 12, 2024
1 parent c59e0bc commit 50cfae4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "font-files",
"version": "5.0.0",
"description": "1000+ open-source fonts bundled into neat packages.",
"description": "1500+ open-source fonts bundled into neat packages.",
"type": "module",
"packageManager": "[email protected]",
"private": true,
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions scripts/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ const updateAlgoliaIndex = async (force?: boolean) => {
if (!metadata)
console.warn(`No metadata found for ${id} when updating Algolia index`);

const stats = (
const stats = (await (
await fetch(`https://api.fontsource.org/v1/stats/${id}`)
).json() as any;
).json()) as any;
const downloadCountMonthly = stats?.total?.npmDownloadMonthly;

const obj = {
Expand Down Expand Up @@ -85,4 +85,4 @@ const updateAlgoliaIndex = async (force?: boolean) => {
}
};

updateAlgoliaIndex();
await updateAlgoliaIndex();

0 comments on commit 50cfae4

Please sign in to comment.