Clarify conditional

This commit is contained in:
Jesper 2022-04-13 17:35:46 +02:00
parent 1fdb4e6f50
commit 4dffac3dcf

View File

@ -54,7 +54,8 @@ function updateItemSellIn({ name, sellIn }: Item) {
}
function updateExpiredItemQuality({ quality, name, sellIn }: Item): number {
if (sellIn >= 0) return quality
const isExpired = sellIn < 0
if (!isExpired) return quality
switch (name) {
case 'Sulfuras, Hand of Ragnaros': return quality