mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Use guard
This commit is contained in:
parent
03379118c6
commit
88982514b1
@ -31,9 +31,8 @@ export class GildedRose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateSellIn(item: Item) {
|
function updateSellIn(item: Item) {
|
||||||
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
if (item.name == 'Sulfuras, Hand of Ragnaros') return
|
||||||
item.sellIn = item.sellIn - 1;
|
item.sellIn = item.sellIn - 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateItemQuality({name, quality, sellIn, ...rest}: Item): number {
|
function updateItemQuality({name, quality, sellIn, ...rest}: Item): number {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user