mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
Clarify conditional
This commit is contained in:
parent
1fdb4e6f50
commit
4dffac3dcf
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user