@juice789/tf2items 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fromEconItem.js +4 -4
- package/package.json +1 -1
package/fromEconItem.js
CHANGED
|
@@ -102,7 +102,7 @@ const killstreakTier = item => {
|
|
|
102
102
|
|
|
103
103
|
function effect(item) {
|
|
104
104
|
if (item?.app_data?.quality !== '5') return null
|
|
105
|
-
const desc = (item.descriptions
|
|
105
|
+
const desc = (item.descriptions || []).find(d => d.color === 'ffd700')
|
|
106
106
|
if (!desc) return null
|
|
107
107
|
return particleEffectsInv[desc.value.replace('★ Unusual Effect: ', '')] ?? '-1'
|
|
108
108
|
}
|
|
@@ -114,12 +114,12 @@ const elevated = item =>
|
|
|
114
114
|
.includes('Strange')
|
|
115
115
|
|
|
116
116
|
const uncraftable = item =>
|
|
117
|
-
Boolean((item.descriptions
|
|
117
|
+
Boolean((item.descriptions || []).find(d => d.value === '( Not Usable in Crafting )'))
|
|
118
118
|
|
|
119
119
|
const paintOptions = Object.keys(paintDefindex).map(name => `Paint Color: ${name}`)
|
|
120
120
|
|
|
121
121
|
const paintColor = item => {
|
|
122
|
-
const desc = (item.descriptions
|
|
122
|
+
const desc = (item.descriptions || []).find(d => paintOptions.includes(d.value))
|
|
123
123
|
if (!desc) return desc
|
|
124
124
|
return paintDefindex[desc.value.split('Paint Color: ')[1]]
|
|
125
125
|
}
|
|
@@ -127,7 +127,7 @@ const paintColor = item => {
|
|
|
127
127
|
const spellOptions = Object.keys(spellDefindex).map(name => `Halloween: ${name} (spell only active during event)`)
|
|
128
128
|
|
|
129
129
|
const halloweenSpell = item => {
|
|
130
|
-
const spells = (item.descriptions
|
|
130
|
+
const spells = (item.descriptions || [])
|
|
131
131
|
.filter(d => spellOptions.includes(d.value))
|
|
132
132
|
.map(d => spellDefindex[d.value.split('Halloween: ')[1].replace(' (spell only active during event)', '')])
|
|
133
133
|
return spells.length === 0 ? null : spells.join('_')
|