@juice789/tf2items 1.0.19 → 1.0.21

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/blanket.js CHANGED
@@ -22,7 +22,6 @@ const {
22
22
  allPass,
23
23
  converge,
24
24
  concat,
25
- of,
26
25
  unnest,
27
26
  pick,
28
27
  mergeRight
@@ -54,7 +53,7 @@ const unboxSkinsRemap = when(
54
53
  compose(//is an unbox skin
55
54
  allPass([
56
55
  has('texture'),
57
- complement(propEq)('item_name', 'War Paint')
56
+ complement(propEq)('War Paint', 'item_name')
58
57
  ]),
59
58
  prop(__, items),
60
59
  prop('defindex')
@@ -63,17 +62,17 @@ const unboxSkinsRemap = when(
63
62
  converge(
64
63
  concat,
65
64
  [
66
- of,
65
+ Array.of,
67
66
  compose(
68
- of,
67
+ Array.of,
69
68
  chain(assoc('defindex'), compose(
70
69
  prop('defindex'),//change defindex from unbox skin defindex to weapon defindex
71
70
  defaultTo({}),
72
71
  nth(0),
73
72
  values,
74
73
  ({ item_name }) => pickBy(allPass([
75
- propEq('item_quality', 6),
76
- propEq('item_name', item_name)
74
+ propEq(6, 'item_quality'),
75
+ propEq(item_name, 'item_name')
77
76
  ]), items),
78
77
  prop(__, items),
79
78
  prop('defindex')
@@ -87,7 +86,7 @@ const warPaintRemap = when(
87
86
  allPass([
88
87
  complement(has)('texture'),
89
88
  compose(
90
- propEq('item_name', 'War Paint'),
89
+ propEq('War Paint', 'item_name'),
91
90
  prop(__, items),
92
91
  prop('defindex')
93
92
  ),
package/fromEconItem.js CHANGED
@@ -33,7 +33,6 @@ const {
33
33
  complement,
34
34
  either,
35
35
  concat,
36
- of,
37
36
  path,
38
37
  equals,
39
38
  pick,
@@ -56,7 +55,7 @@ const removeStrings = curry((string, strings) => compose(
56
55
 
57
56
  const findTag = uncurryN(2, (tagName) => compose(
58
57
  prop('name'),
59
- find(propEq('category_name', tagName)),
58
+ find(propEq(tagName, 'category_name')),
60
59
  map(renameKeys({
61
60
  localized_category_name: 'category_name',
62
61
  localized_tag_name: 'name'
@@ -114,7 +113,7 @@ const craft = ifElse(
114
113
  )
115
114
 
116
115
  const australium = allPass([
117
- pathEq(['app_data', 'quality'], '11'),
116
+ pathEq('11', ['app_data', 'quality']),
118
117
  marketHashIncludes('Australium')
119
118
  ])
120
119
 
@@ -156,9 +155,9 @@ const killstreakTier = compose(
156
155
 
157
156
  const effect = ifElse(
158
157
  allPass([
159
- pathEq(['app_data', 'quality'], '5'),
158
+ pathEq('5', ['app_data', 'quality']),
160
159
  compose(
161
- find(propEq('color', 'ffd700')),
160
+ find(propEq('ffd700', 'color')),
162
161
  propOr([], 'descriptions')
163
162
  )
164
163
  ]),
@@ -166,14 +165,14 @@ const effect = ifElse(
166
165
  propOr('-1', __, invertObj(particleEffects)),
167
166
  replace('★ Unusual Effect: ', ''),
168
167
  prop('value'),
169
- find(propEq('color', 'ffd700')),
168
+ find(propEq('ffd700', 'color')),
170
169
  propOr([], 'descriptions')
171
170
  ),
172
171
  always(null)
173
172
  )
174
173
 
175
174
  const elevated = allPass([
176
- complement(pathEq)(['app_data', 'quality'], '11'),
175
+ complement(pathEq)('11', ['app_data', 'quality']),
177
176
  compose(
178
177
  includes('Strange'),
179
178
  ({ app_data, market_hash_name }) => replace(items[app_data.def_index].item_name, '', market_hash_name)
@@ -182,7 +181,7 @@ const elevated = allPass([
182
181
 
183
182
  const uncraftable = compose(
184
183
  Boolean,
185
- find(propEq('value', '( Not Usable in Crafting )')),
184
+ find(propEq('( Not Usable in Crafting )', 'value')),
186
185
  propOr([], 'descriptions')
187
186
  )
188
187
 
@@ -236,8 +235,8 @@ const target = ifElse(
236
235
  find(__, values(items)),
237
236
  allPass,
238
237
  concat([propSatisfies(complement(includes)(__, [0, 15]), 'item_quality')]),
239
- of,
240
- propEq('item_name'),
238
+ Array.of,
239
+ propEq(__, 'item_name'),
241
240
  ({ market_hash_name, defindex }) => removeStrings(market_hash_name, [
242
241
  'Strangifier',
243
242
  'Unusual',
@@ -275,8 +274,8 @@ const output = ({ recipe, market_hash_name, killstreakTier }) => {
275
274
  find(__, values(items)),
276
275
  allPass,
277
276
  concat([propSatisfies(complement(includes)(__, [0, 15]), 'item_quality')]),
278
- of,
279
- propEq('item_name'),
277
+ Array.of,
278
+ propEq(__, 'item_name'),
280
279
  removeStrings(__, ['Chemistry Set', "Collector's"])
281
280
  )(market_hash_name)
282
281
  default:
@@ -357,7 +356,7 @@ const fromEconItemOther = compose(
357
356
  )
358
357
 
359
358
  const fromEconItem = ifElse(
360
- propEq('appid', 440),
359
+ propEq(440, 'appid'),
361
360
  fromEconItem440,
362
361
  fromEconItemOther
363
362
  )
package/fromListingV1.js CHANGED
@@ -64,8 +64,8 @@ const effect = findValue(effectOptions)
64
64
 
65
65
  const elevated = cond(
66
66
  [
67
- [complement(propEq)('quality', 11), hasPath(['attributes', '214'])],
68
- [propEq('quality', 11), compose(isWeaponEffect, effect)],
67
+ [complement(propEq)(11, 'quality'), hasPath(['attributes', '214'])],
68
+ [propEq(11, 'quality'), compose(isWeaponEffect, effect)],
69
69
  [T, F]
70
70
  ]
71
71
  )
@@ -172,7 +172,7 @@ const remap = (fn1, fn2) => when(
172
172
 
173
173
  const remapStrangifier = remap(
174
174
  compose(
175
- propEq('item_name', 'Strangifier'),
175
+ propEq('Strangifier', 'item_name'),
176
176
  prop(__, items),
177
177
  prop('defindex')
178
178
  ),
@@ -193,12 +193,12 @@ const remapStrangifier = remap(
193
193
 
194
194
  const strangifierSets = pickBy(allPass([
195
195
  has('td'),
196
- propEq('item_name', 'Chemistry Set')
196
+ propEq('Chemistry Set', 'item_name')
197
197
  ]), items)
198
198
 
199
199
  const remapStrangifierSet = remap(
200
200
  allPass([
201
- propEq('defindex', 20001),
201
+ propEq(20001, 'defindex'),
202
202
  prop('output'),
203
203
  prop('target')
204
204
  ]),
@@ -220,12 +220,12 @@ const remapStrangifierSet = remap(
220
220
  const collectorSets = pickBy(allPass([
221
221
  complement(prop)('td'),
222
222
  prop('od'),
223
- propEq('item_name', 'Chemistry Set'),
223
+ propEq('Chemistry Set', 'item_name'),
224
224
  ]), items)
225
225
 
226
226
  const remapCollectorSet = remap(
227
227
  allPass([
228
- propEq('defindex', 20001),
228
+ propEq(20001, 'defindex'),
229
229
  complement(prop)('target')
230
230
  ]),
231
231
  compose(
@@ -282,15 +282,15 @@ const remapWeapon = when(
282
282
  )
283
283
 
284
284
  const decodeSkinQuality = cond([
285
- [allPass([propEq('quality', 15), compose(isWeaponEffect, prop('effect'))]), assoc('quality', 5)], //decorated + effect = unusual
286
- [allPass([propEq('quality', 11), compose(isWeaponEffect, prop('effect'))]), assoc('quality', 5)], //strange + effect = unusual
287
- [allPass([propEq('quality', 15), complement(prop)('effect'), prop('elevated')]), assoc('quality', 11)], //decorated + elevated = strange
285
+ [allPass([propEq(15, 'quality'), compose(isWeaponEffect, prop('effect'))]), assoc('quality', 5)], //decorated + effect = unusual
286
+ [allPass([propEq(11, 'quality'), compose(isWeaponEffect, prop('effect'))]), assoc('quality', 5)], //strange + effect = unusual
287
+ [allPass([propEq(15, 'quality'), complement(prop)('effect'), prop('elevated')]), assoc('quality', 11)], //decorated + elevated = strange
288
288
  [T, identity]
289
289
  ])
290
290
 
291
291
  const unboxedSkins = map(
292
292
  (item) => assoc('item_name', textures[item.texture] + ' ' + item.item_name, item),
293
- pickBy(propEq('item_quality', 15), items)
293
+ pickBy(propEq(15, 'item_quality'), items)
294
294
  )
295
295
 
296
296
  const unboxSkinsRemap = remap(
@@ -300,7 +300,7 @@ const unboxSkinsRemap = remap(
300
300
  flatten,
301
301
  toPairs,
302
302
  ({ defindex, texture }) => pickBy(
303
- propEq('item_name', textures[texture] + ' ' + items[defindex].item_name),
303
+ propEq(textures[texture] + ' ' + items[defindex].item_name, 'item_name'),
304
304
  unboxedSkins
305
305
  )
306
306
  )
@@ -340,7 +340,7 @@ const promoIndex = {
340
340
  const promoRemap = when(
341
341
  allPass([
342
342
  compose(has(__, promoIndex), prop('defindex')),
343
- propEq('quality', 1)
343
+ propEq(1, 'quality')
344
344
  ]),
345
345
  chain(assoc('defindex'), compose(prop(__, promoIndex), prop('defindex')))
346
346
  )
package/fromListingV2.js CHANGED
@@ -42,19 +42,19 @@ const elevated = cond(
42
42
 
43
43
  const killstreakTier = propOr(null, 'killstreakTier')
44
44
 
45
- const festivized = propEq('festivized', true)
45
+ const festivized = propEq(true, 'festivized')
46
46
 
47
47
  const texture = pathOr(null, ['texture', 'id'])
48
48
 
49
49
  const wear = pathOr(null, ['wearTier', 'id'])
50
50
 
51
- const australium = propEq('australium', true)
51
+ const australium = propEq(true, 'australium')
52
52
 
53
53
  const series = propOr(null, 'crateSeries')
54
54
 
55
55
  const target = ifElse(
56
56
  allPass([
57
- pathEq(['recipe', 'targetItem'], null),
57
+ pathEq(null, ['recipe', 'targetItem']),
58
58
  compose(equals(3), length, split('-'), prop('priceindex'))
59
59
  ]),
60
60
  compose(nth(2), split('-'), prop('priceindex')),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juice789/tf2items",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "tf2 item schema thingys",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -20,10 +20,10 @@
20
20
  "url": "https://github.com/juice789/tf2items/issues"
21
21
  },
22
22
  "peerDependencies": {
23
- "axios": "^1.6.2",
24
- "ramda": "^0.28.0",
25
- "ramda-adjunct": "^3.4.0",
26
- "redux-saga": "^1.2.3",
23
+ "axios": "^1.7.2",
24
+ "ramda": "^0.30.1",
25
+ "ramda-adjunct": "^5.0.1",
26
+ "redux-saga": "^1.3.0",
27
27
  "vdf": "^0.0.2"
28
28
  },
29
29
  "devDependencies": {