Use guard

This commit is contained in:
Jesper 2022-04-13 17:17:54 +02:00
parent 03379118c6
commit 88982514b1

View File

@ -31,9 +31,8 @@ export class GildedRose {
}
function updateSellIn(item: Item) {
if (item.name != 'Sulfuras, Hand of Ragnaros') {
item.sellIn = item.sellIn - 1;
}
if (item.name == 'Sulfuras, Hand of Ragnaros') return
item.sellIn = item.sellIn - 1;
}
function updateItemQuality({name, quality, sellIn, ...rest}: Item): number {