Skip to content

Commit

Permalink
Update type diff name
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyfallWasTaken committed Jun 29, 2024
1 parent 302423c commit b813c4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ async function runScrape(env: Env) {

function formatDiff(diff: DetailedDiff, oldItems: ShopItem[]): string {
let result = "";
Object.values(diff.added).forEach((value: ShopItem) => {
Object.values(diff.added).forEach((value: ShopItemDiff) => {
result += formatItemDiff("Added", value);
});
Object.values(diff.updated).forEach((value: ShopItem) => {
Object.values(diff.updated).forEach((value: ShopItemDiff) => {
// FIXME: incredibly inefficent
result += formatItemDiff(
"Updated",
value,
oldItems.find((item) => item.id === value.id),
);
});
Object.values(diff.deleted).forEach((value: ShopItem) => {
Object.values(diff.deleted).forEach((value: ShopItemDiff) => {
result += formatItemDiff("Updated", value);
});

Expand Down

0 comments on commit b813c4a

Please sign in to comment.