Extract _updateSellIn

This commit is contained in:
Dan Holmes 2020-12-03 14:30:34 +00:00
parent cde87568f5
commit bb67302d3a

View File

@ -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