mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
Extract _updateSellIn
This commit is contained in:
parent
cde87568f5
commit
bb67302d3a
@ -33,9 +33,7 @@ class Shop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
this._updateSellIn(item)
|
||||||
item.sellIn = item.sellIn - 1;
|
|
||||||
}
|
|
||||||
if (item.sellIn < 0) {
|
if (item.sellIn < 0) {
|
||||||
if (item.name != 'Aged Brie') {
|
if (item.name != 'Aged Brie') {
|
||||||
if (item.name != 'Backstage passes to a TAFKAL80ETC concert') {
|
if (item.name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||||
@ -54,6 +52,12 @@ class Shop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_updateSellIn(item) {
|
||||||
|
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
||||||
|
item.sellIn = item.sellIn - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Shop
|
Shop
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user