Skip to content

Commit

Permalink
refactor(scrape): simplify result type constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Dec 15, 2024
1 parent 01192f3 commit f2e0753
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/data/quoteRecords/_scrape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ for (const [currency, rateByDate] of rateByDateByCurrency) {
}
quotes.sort(([aDate], [bDate]) => Date.parse(aDate) - Date.parse(bDate));

const contents: QuoteRecord = Object.fromEntries(quotes);
await file.truncate();
await file.write(
JSON.stringify(Object.fromEntries(quotes) satisfies QuoteRecord, null, 2) +
"\n",
0,
);
await file.write(JSON.stringify(contents, null, 2) + "\n", 0);
}

0 comments on commit f2e0753

Please sign in to comment.