cs2-inventory-resolver 0.3.1 → 0.3.3
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/data/inventory.json +39 -39
- package/dist/index.d.ts +1 -1
- package/dist/resolver.d.ts +0 -26
- package/dist/resolver.js +3 -5
- package/dist/resolver.test.js +86 -77
- package/package.json +13 -1
package/data/inventory.json
CHANGED
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
"color": "#8847ff"
|
|
440
440
|
},
|
|
441
441
|
"marketable": true,
|
|
442
|
-
"image": "https://
|
|
442
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL1m5fn8Sdk6_evb6hoH_aaHGKS0-t3pOlgQS6MmRQguynLn9ircSiTPFUgCJAkQbELsxXtktDkMurk4lTZ39hEyn_-3HsbvXxj4fFCD_RcNNN-xQ"
|
|
443
443
|
}
|
|
444
444
|
},
|
|
445
445
|
"2": {
|
|
@@ -1273,7 +1273,7 @@
|
|
|
1273
1273
|
"color": "#4b69ff"
|
|
1274
1274
|
},
|
|
1275
1275
|
"marketable": true,
|
|
1276
|
-
"image": "https://
|
|
1276
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL3l4Dl7idN6vyRbq17JeOWGGKe_v55vPhkSjuMkRw1uAKJk4jxNWWVaw9yAsF3R-cItkTqx9HiY-23tFeN3oNFyS_9jn4a5i5o5b0AB6B35OSJ2MsRWanJ"
|
|
1277
1277
|
}
|
|
1278
1278
|
},
|
|
1279
1279
|
"4": {
|
|
@@ -1845,7 +1845,7 @@
|
|
|
1845
1845
|
"color": "#eb4b4b"
|
|
1846
1846
|
},
|
|
1847
1847
|
"marketable": true,
|
|
1848
|
-
"image": "https://
|
|
1848
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL2kpnj9h1c4_2tY5tnJOCWC2yvzedxuPUnS3HqzR9152_UyNigeSqWa1BxW8ElRLJfshfpkNHuZO_n4ADd2IxBxDK-0H3ID5Y8zA"
|
|
1849
1849
|
}
|
|
1850
1850
|
},
|
|
1851
1851
|
"7": {
|
|
@@ -2437,7 +2437,7 @@
|
|
|
2437
2437
|
"color": "#d32ce6"
|
|
2438
2438
|
},
|
|
2439
2439
|
"marketable": true,
|
|
2440
|
-
"image": "https://
|
|
2440
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLwlcK3wiNQu6WRa7ZsLvWsCGuZxuZij-1gSCGn20wksT7Xzo6ueX6VOgUmWZQiTO5btxDrldbmNru05QLfiN5EmHmsj3hXrnE8mi375M8"
|
|
2441
2441
|
}
|
|
2442
2442
|
},
|
|
2443
2443
|
"8": {
|
|
@@ -3381,7 +3381,7 @@
|
|
|
3381
3381
|
"color": "#eb4b4b"
|
|
3382
3382
|
},
|
|
3383
3383
|
"marketable": true,
|
|
3384
|
-
"image": "https://
|
|
3384
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLwiYbf_DVL0OO7baFjM8-UD2qSyPpJvOhuRz39kUpw42zWntiteSiVaQYhCJJzEeIOukSwl4XmPrmw4VHXjtpExC_33zQJsHjNnJgjQA"
|
|
3385
3385
|
}
|
|
3386
3386
|
},
|
|
3387
3387
|
"10": {
|
|
@@ -4547,7 +4547,7 @@
|
|
|
4547
4547
|
"color": "#8847ff"
|
|
4548
4548
|
},
|
|
4549
4549
|
"marketable": true,
|
|
4550
|
-
"image": "https://
|
|
4550
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL2n5rp8SNJ0PWvZK1hH_eSAm6XwPp5ot5lRi67gVN_42_VydytcX3BbQ8pCsB0ReMCtEG_lYLuNuji4AGPjt8Qynj4jXlI8G81tMQ6bFYi"
|
|
4551
4551
|
}
|
|
4552
4552
|
},
|
|
4553
4553
|
"14": {
|
|
@@ -4809,7 +4809,7 @@
|
|
|
4809
4809
|
"color": "#4b69ff"
|
|
4810
4810
|
},
|
|
4811
4811
|
"marketable": true,
|
|
4812
|
-
"image": "https://
|
|
4812
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL8zMK5wi8Ju6uRaqhiI_uAMXeF0_56td5lRi67gVNw4juHnIr_JSmeOwQnXsd1RbZYtkTpkoDjY7nm5Vfci4NDxS__jyoY8G81tOB68LmM"
|
|
4813
4813
|
}
|
|
4814
4814
|
},
|
|
4815
4815
|
"16": {
|
|
@@ -5311,7 +5311,7 @@
|
|
|
5311
5311
|
"color": "#4b69ff"
|
|
5312
5312
|
},
|
|
5313
5313
|
"marketable": true,
|
|
5314
|
-
"image": "https://
|
|
5314
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL8ypexwi8P7qaRcrFvIeOHB2Sb_uxhj-1gSCGn208j5WqDw9ascn6VOlQoCJV0RbVb5xO5l4fgY-Pk5waMitpHzS79jiJXrnE8cY5TeGQ"
|
|
5315
5315
|
}
|
|
5316
5316
|
},
|
|
5317
5317
|
"17": {
|
|
@@ -6385,7 +6385,7 @@
|
|
|
6385
6385
|
"color": "#d32ce6"
|
|
6386
6386
|
},
|
|
6387
6387
|
"marketable": true,
|
|
6388
|
-
"image": "https://
|
|
6388
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLhx8bf7XsL0ParabBlJ_GJC1icyOl-pK85GHy1kEh3627Tntn6dC-SOgFyXJR3RO8Jt0a7lIG1M-PksgLZjNoT02yg2XMB6aCz"
|
|
6389
6389
|
}
|
|
6390
6390
|
},
|
|
6391
6391
|
"23": {
|
|
@@ -7079,7 +7079,7 @@
|
|
|
7079
7079
|
"color": "#4b69ff"
|
|
7080
7080
|
},
|
|
7081
7081
|
"marketable": true,
|
|
7082
|
-
"image": "https://
|
|
7082
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLkk4a0qB1O4uKRbrZsJ_2WAHOvzedxuPUnGH3qwxtzsjzczN-odXqePQN0C5EiFrUK50G7lYXkP7jh71bXjdlEyDK-0H3tn7dQwA"
|
|
7083
7083
|
}
|
|
7084
7084
|
},
|
|
7085
7085
|
"25": {
|
|
@@ -7903,7 +7903,7 @@
|
|
|
7903
7903
|
"color": "#4b69ff"
|
|
7904
7904
|
},
|
|
7905
7905
|
"marketable": true,
|
|
7906
|
-
"image": "https://
|
|
7906
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLzl4zv8x1Z5uihZpt_LeisAm6Xyfo45OI7S37gwEhx4WiGnt_8eS2RPw4nX8AkTeNftkS8ltLkNePj5gyI3ZUFk3vfJ75LcA"
|
|
7907
7907
|
}
|
|
7908
7908
|
},
|
|
7909
7909
|
"27": {
|
|
@@ -8879,7 +8879,7 @@
|
|
|
8879
8879
|
"color": "#4b69ff"
|
|
8880
8880
|
},
|
|
8881
8881
|
"marketable": true,
|
|
8882
|
-
"image": "https://
|
|
8882
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLin4Hl-S1d6c29abNoJP-VCFiW1P1_v-9WQyC0nQlp4WiHyY79eHmXOw4mW5JwQ-Jc5hO7koXjML_jsgSK2oJHmyz82ilB7DErvbjU0C2wDw"
|
|
8883
8883
|
}
|
|
8884
8884
|
},
|
|
8885
8885
|
"30": {
|
|
@@ -10167,7 +10167,7 @@
|
|
|
10167
10167
|
"color": "#8847ff"
|
|
10168
10168
|
},
|
|
10169
10169
|
"marketable": true,
|
|
10170
|
-
"image": "https://
|
|
10170
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL8jsHf8DIM0POjaqF_LPmdC1icyOl-pK9rTCzlzBx14m-AyNupdXqfaQElXsN0QLICsxSxw4HjZuzm4gePjY5C02yg2Z3LgsMw"
|
|
10171
10171
|
}
|
|
10172
10172
|
},
|
|
10173
10173
|
"34": {
|
|
@@ -10619,7 +10619,7 @@
|
|
|
10619
10619
|
"color": "#8847ff"
|
|
10620
10620
|
},
|
|
10621
10621
|
"marketable": true,
|
|
10622
|
-
"image": "https://
|
|
10622
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL8js_f8DIC0Oe8aqVjH-OcGGKCxOdxvt5lRi67gVMi4m6DmY2hcXLFPAMiA8NxQ-9cshK_m9yyYem04ACLg9hAzH6q239I8G81tD9Ib4M_"
|
|
10623
10623
|
}
|
|
10624
10624
|
},
|
|
10625
10625
|
"35": {
|
|
@@ -11643,7 +11643,7 @@
|
|
|
11643
11643
|
"color": "#d32ce6"
|
|
11644
11644
|
},
|
|
11645
11645
|
"marketable": true,
|
|
11646
|
-
"image": "https://
|
|
11646
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLhzMOwwjIJuqKRY61jNOOGCW6vzedxuPUnHXrikBkh4jjXzd76I36VPQF2CJV2FOYLthC5k9DiNuOwswKLj4JHxTK-0H3jhNNozg"
|
|
11647
11647
|
}
|
|
11648
11648
|
},
|
|
11649
11649
|
"38": {
|
|
@@ -13221,7 +13221,7 @@
|
|
|
13221
13221
|
"color": "#8847ff"
|
|
13222
13222
|
},
|
|
13223
13223
|
"marketable": true,
|
|
13224
|
-
"image": "https://
|
|
13224
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyL8ypexwjFS4_ega6F_H_3HDzaD_ut6teJ9XTy-qhEutDWR1Iz4cnjCag51DZQlEOIMtEa7k9TiNbmw51OP3tlBxCr8iCsY6C5t6uwcEf1y--utkZE"
|
|
13225
13225
|
}
|
|
13226
13226
|
},
|
|
13227
13227
|
"61": {
|
|
@@ -13663,7 +13663,7 @@
|
|
|
13663
13663
|
"color": "#4b69ff"
|
|
13664
13664
|
},
|
|
13665
13665
|
"marketable": true,
|
|
13666
|
-
"image": "https://
|
|
13666
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Dx60noTyLkjYbf7itX6vytbbZSNeODHViDyOJzvvVWTSaqqhEutDWR1Nf8cn_CPAQmW8Z5Ee8P4UbuxILmMLu3tAXYj4hByyWsjCscvy89sOYcEf1yCvXTIoM"
|
|
13667
13667
|
}
|
|
13668
13668
|
},
|
|
13669
13669
|
"63": {
|
|
@@ -20183,7 +20183,7 @@
|
|
|
20183
20183
|
"color": "#eb4b4b"
|
|
20184
20184
|
},
|
|
20185
20185
|
"marketable": true,
|
|
20186
|
-
"image": "https://
|
|
20186
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOvw-t3tPZmXSKMkRQmvjKLnpzGMT7VLlp1Zc4pEr9OrBWxxofvNOLitQKPid5Hznr-3C9JvHtu4uxTVKMlqaPQilrAM7Fr6cQdZKHwBJ-GjQo"
|
|
20187
20187
|
},
|
|
20188
20188
|
"1406": {
|
|
20189
20189
|
"name": "★ Sport Gloves | Frosty",
|
|
@@ -20193,7 +20193,7 @@
|
|
|
20193
20193
|
"color": "#eb4b4b"
|
|
20194
20194
|
},
|
|
20195
20195
|
"marketable": true,
|
|
20196
|
-
"image": "https://
|
|
20196
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOvwu97v95-RienkA8YvzSCkpu3dXqfbA5zW5N0F-dcu0K8ldDnMuPk4wHdjN9EniWthn4av31v4eoHWL1lpPOyBkNpPQ"
|
|
20197
20197
|
},
|
|
20198
20198
|
"1407": {
|
|
20199
20199
|
"name": "★ Sport Gloves | Blaze",
|
|
@@ -20203,7 +20203,7 @@
|
|
|
20203
20203
|
"color": "#eb4b4b"
|
|
20204
20204
|
},
|
|
20205
20205
|
"marketable": true,
|
|
20206
|
-
"image": "https://
|
|
20206
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOvx-J3veR6cCahlBMgtgKJk4jxNWWXblAgDJUiTeJZtBHpktDuY7m2sQPf2YNAxXn5iysf6Cc_67oGA6Ah5OSJ2AmILwG6"
|
|
20207
20207
|
},
|
|
20208
20208
|
"1408": {
|
|
20209
20209
|
"name": "★ Sport Gloves | Creme Pinstripe",
|
|
@@ -20213,7 +20213,7 @@
|
|
|
20213
20213
|
"color": "#eb4b4b"
|
|
20214
20214
|
},
|
|
20215
20215
|
"marketable": true,
|
|
20216
|
-
"image": "https://
|
|
20216
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOv0ed4o_V7Rjm2qh8rsj6OpYPwJiPTcAdzW5V2E-4IsBnswNHuZbznsQfXg4NCny_4hnhOvS04suoDVvZx86zJz1aWnYsnB-o"
|
|
20217
20217
|
},
|
|
20218
20218
|
"1409": {
|
|
20219
20219
|
"name": "★ Sport Gloves | Red Racer",
|
|
@@ -20223,7 +20223,7 @@
|
|
|
20223
20223
|
"color": "#eb4b4b"
|
|
20224
20224
|
},
|
|
20225
20225
|
"marketable": true,
|
|
20226
|
-
"image": "https://
|
|
20226
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOv0-91tfNWXSy3qhEutDWR1I77dC7GbQ4kWZNwEOJY5xLtwYHuN7yz7lPe2YgTniz2jn5Nv3lj5O0cEf1yHxfMKhM"
|
|
20227
20227
|
},
|
|
20228
20228
|
"1410": {
|
|
20229
20229
|
"name": "★ Sport Gloves | Ultra Violent",
|
|
@@ -20233,7 +20233,7 @@
|
|
|
20233
20233
|
"color": "#eb4b4b"
|
|
20234
20234
|
},
|
|
20235
20235
|
"marketable": true,
|
|
20236
|
-
"image": "https://
|
|
20236
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOv1et1uN5uXSi3nBgppwKHiIb-KT_4Ml93UtZuTOcLtUW8lNDvZL634FfYi4pCyiX5iXka6Htr4uhQVqt3_vfRiAzDZap9v8fuC2Vr0A"
|
|
20237
20237
|
},
|
|
20238
20238
|
"1417": {
|
|
20239
20239
|
"name": "★ Sport Gloves | Occult",
|
|
@@ -20243,7 +20243,7 @@
|
|
|
20243
20243
|
"color": "#eb4b4b"
|
|
20244
20244
|
},
|
|
20245
20245
|
"marketable": true,
|
|
20246
|
-
"image": "https://
|
|
20246
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk5UvzWCL2kpn2-DFk6P6hfqFSM-CcHHOv1-t6puR9cDu2kSIrujqNjsGody2XPQVzWZslEe5euxS_lYC0Yu7l4wLfj99MmCv4jXka6Slp6-4ET-N7rUuG7GIq"
|
|
20247
20247
|
},
|
|
20248
20248
|
"10018": {
|
|
20249
20249
|
"name": "★ Sport Gloves | Superconductor",
|
|
@@ -20375,7 +20375,7 @@
|
|
|
20375
20375
|
"color": "#eb4b4b"
|
|
20376
20376
|
},
|
|
20377
20377
|
"marketable": true,
|
|
20378
|
-
"image": "https://
|
|
20378
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wv0ud6u95tXSi0mhMYpDWMjorGLSLANkI-ApsmQrFbtkPux4bgMuvg7gzWjI0Xnyz-23lI6i5s4bpWUqMl-6PQ2xaBb-Mdlpgj5g"
|
|
20379
20379
|
},
|
|
20380
20380
|
"1399": {
|
|
20381
20381
|
"name": "★ Driver Gloves | Brocade Crane",
|
|
@@ -20385,7 +20385,7 @@
|
|
|
20385
20385
|
"color": "#eb4b4b"
|
|
20386
20386
|
},
|
|
20387
20387
|
"marketable": true,
|
|
20388
|
-
"image": "https://
|
|
20388
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wvw_x5s-BtShawhxwptgKXn4vGLSLANkI-XMN2Qu4OsEG6lYK2M-OwtgPf2IMRzXio3yMY7yhptbxRAKIkq_bVhhaBb-OYO4AFQA"
|
|
20389
20389
|
},
|
|
20390
20390
|
"1400": {
|
|
20391
20391
|
"name": "★ Driver Gloves | Brocade Flowers",
|
|
@@ -20395,7 +20395,7 @@
|
|
|
20395
20395
|
"color": "#eb4b4b"
|
|
20396
20396
|
},
|
|
20397
20397
|
"marketable": true,
|
|
20398
|
-
"image": "https://
|
|
20398
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wvw_x5s-BtSha1mRIwti-6iIr9HifOOV5kFJJ5TeMK5xTsltSyM-m07wLW2Y4Uy32ohiJKuy9r4L1UWKAj-qGF3gzfcepq2gO2jDs"
|
|
20399
20399
|
},
|
|
20400
20400
|
"1401": {
|
|
20401
20401
|
"name": "★ Driver Gloves | Dragon Fists",
|
|
@@ -20405,7 +20405,7 @@
|
|
|
20405
20405
|
"color": "#eb4b4b"
|
|
20406
20406
|
},
|
|
20407
20407
|
"marketable": true,
|
|
20408
|
-
"image": "https://
|
|
20408
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wvxfx3t-5ncDqwlBEijC-AnrD1KCzPKhgkCZdwTeIL4ES5wdXjPrm251Pdi98QzST3jy0d6nxp4e5QAKsk_q3RkUifZohUdPsK"
|
|
20409
20409
|
},
|
|
20410
20410
|
"1402": {
|
|
20411
20411
|
"name": "★ Driver Gloves | Garden",
|
|
@@ -20415,7 +20415,7 @@
|
|
|
20415
20415
|
"color": "#eb4b4b"
|
|
20416
20416
|
},
|
|
20417
20417
|
"marketable": true,
|
|
20418
|
-
"image": "https://
|
|
20418
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3WvxON0ou5gSyyhkBkYtTGKjYrrMhTTO1d8Zc4pEr9OrES-w9exZuzrsgyLi4lEzij2in9KvHpj6u9XU6J2_aGDjwzCY709t8YdZKHwRXCqB8U"
|
|
20419
20419
|
},
|
|
20420
20420
|
"1404": {
|
|
20421
20421
|
"name": "★ Driver Gloves | Seigaiha",
|
|
@@ -20425,7 +20425,7 @@
|
|
|
20425
20425
|
"color": "#eb4b4b"
|
|
20426
20426
|
},
|
|
20427
20427
|
"marketable": true,
|
|
20428
|
-
"image": "https://
|
|
20428
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wv0u13vO1mXxa-kAkmvzGMmbD7LT7CAVp5Xco0W-dZuhe6wNDuP-q05g2NiYlFmSn5iS1N7yxj4LxUWPJx-6yCiFqUNOIjoc5UtEcI9GU"
|
|
20429
20429
|
},
|
|
20430
20430
|
"1412": {
|
|
20431
20431
|
"name": "★ Driver Gloves | Plum Quill",
|
|
@@ -20435,7 +20435,7 @@
|
|
|
20435
20435
|
"color": "#eb4b4b"
|
|
20436
20436
|
},
|
|
20437
20437
|
"marketable": true,
|
|
20438
|
-
"image": "https://
|
|
20438
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3Wvzv1iouhqRxajgA83vzi6lob-KT-JawEjXMZyQuQMs0Xpl4fvMrvn4FOI2N5Dnn78jnxI5yZj5-tXWfEs8rqX0V_DSgKUxA"
|
|
20439
20439
|
},
|
|
20440
20440
|
"1439": {
|
|
20441
20441
|
"name": "★ Driver Gloves | Hand Sweaters",
|
|
@@ -20445,7 +20445,7 @@
|
|
|
20445
20445
|
"color": "#eb4b4b"
|
|
20446
20446
|
},
|
|
20447
20447
|
"marketable": true,
|
|
20448
|
-
"image": "https://
|
|
20448
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5T441rsfhr9kYDl7h1c4_24bZtpMvmFC3WvyuB_pN5oXS6qmRgYtC-An4HGLSLANkI-CZJzROEM4xa7lYbgM7i07lOP3okXmCn4iypM7idt4udXU6p0rqHS3haBb-PCGCVNWw"
|
|
20449
20449
|
},
|
|
20450
20450
|
"10013": {
|
|
20451
20451
|
"name": "★ Driver Gloves | Lunar Weave",
|
|
@@ -20821,7 +20821,7 @@
|
|
|
20821
20821
|
"color": "#eb4b4b"
|
|
20822
20822
|
},
|
|
20823
20823
|
"marketable": true,
|
|
20824
|
-
"image": "https://
|
|
20824
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MlB80py-EmZvGJjnCO1hPVssnHaMUtRTqwNK2Nrzr71aLi4sUzS_8iCJMuic54eoFVvVw-fGGiwySY7Q1t45DeqjW0uKN1w"
|
|
20825
20825
|
},
|
|
20826
20826
|
"1414": {
|
|
20827
20827
|
"name": "★ Specialist Gloves | Blackbook",
|
|
@@ -20831,7 +20831,7 @@
|
|
|
20831
20831
|
"color": "#eb4b4b"
|
|
20832
20832
|
},
|
|
20833
20833
|
"marketable": true,
|
|
20834
|
-
"image": "https://
|
|
20834
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2Mkg8mtTuMjobGIyfGPV1PVssnHaMUthC9l9e2Mei25wTajN5EziT_2CodvSxs5ugBWKp2rvDX2Q6QMOc8tI5DeqjzpbB7FA"
|
|
20835
20835
|
},
|
|
20836
20836
|
"1415": {
|
|
20837
20837
|
"name": "★ Specialist Gloves | Chocolate Chesterfield",
|
|
@@ -20841,7 +20841,7 @@
|
|
|
20841
20841
|
"color": "#eb4b4b"
|
|
20842
20842
|
},
|
|
20843
20843
|
"marketable": true,
|
|
20844
|
-
"image": "https://
|
|
20844
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MhAguvymAnrD7LSrENWl8U8UoAfkNu0Ttx4CxP-zr4wDbjN4XmX79j3xM7SdisbkLBPB0q6LWiwnHM7Zs_9Bdc2KEwswI"
|
|
20845
20845
|
},
|
|
20846
20846
|
"1416": {
|
|
20847
20847
|
"name": "★ Specialist Gloves | Sunburst",
|
|
@@ -20851,7 +20851,7 @@
|
|
|
20851
20851
|
"color": "#eb4b4b"
|
|
20852
20852
|
},
|
|
20853
20853
|
"marketable": true,
|
|
20854
|
-
"image": "https://
|
|
20854
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MhggpsSiXiZvGMy7DAVp5Xco0W-VesRKwxtLvMbm07gLbiI1GmX33hywd7Hk45ewEAPIiqfXW2Q7FMLIjoc5U0NHpGGE"
|
|
20855
20855
|
},
|
|
20856
20856
|
"1437": {
|
|
20857
20857
|
"name": "★ Specialist Gloves | Big Swell",
|
|
@@ -20861,7 +20861,7 @@
|
|
|
20861
20861
|
"color": "#eb4b4b"
|
|
20862
20862
|
},
|
|
20863
20863
|
"marketable": true,
|
|
20864
|
-
"image": "https://
|
|
20864
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MghwxtgKHlpr8HifOOV5kFJJyFOVZuhC8l9XjNL-3tgHcg41HzHr4hntBuntpse0LUvZwr_bX3QjfcepqIIhMOUI"
|
|
20865
20865
|
},
|
|
20866
20866
|
"1438": {
|
|
20867
20867
|
"name": "★ Specialist Gloves | Pillow Punchers",
|
|
@@ -20871,7 +20871,7 @@
|
|
|
20871
20871
|
"color": "#eb4b4b"
|
|
20872
20872
|
},
|
|
20873
20873
|
"marketable": true,
|
|
20874
|
-
"image": "https://
|
|
20874
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MhAguvymAnrDuKSLTO2l8U8UoAfkK5BKxkNyyZu7r4VGP3Y8UzSX_iC4av3trtbtWV_Vxq6SEh1mVN7c9_9Bdc6ulT-fJ"
|
|
20875
20875
|
},
|
|
20876
20876
|
"1440": {
|
|
20877
20877
|
"name": "★ Specialist Gloves | Cloud Chaser",
|
|
@@ -20881,7 +20881,7 @@
|
|
|
20881
20881
|
"color": "#eb4b4b"
|
|
20882
20882
|
},
|
|
20883
20883
|
"marketable": true,
|
|
20884
|
-
"image": "https://
|
|
20884
|
+
"image": "https://community.akamai.steamstatic.com/economy/image/i0CoZ81Ui0m-9KwlBY1L_18myuGuq1wfhWSaZgMttyVfPaERSR0Wqmu7LAocGIGz3UqlXOLrxM-vMGmW8VNxu5Tk71ruQBH4jYLf-i5U-fe9V6NhL-aWMXSAxO1_se1gXD2MkQ8mtDKLpY31NC74Ml93UtZuQe4L40bsl9HgM-Lr5lffgtgWnCT63H5O6XxqtehUVaIl-vCDjwiXMKp9v8dT8uAEag"
|
|
20885
20885
|
},
|
|
20886
20886
|
"10030": {
|
|
20887
20887
|
"name": "★ Specialist Gloves | Forest DDPAT",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { resolveItem, getAttributeUint32 } from './resolver.js';
|
|
2
|
-
export type { ItemEntity, ResolvedItemData, GcItemInput, ItemEntry } from './types.js';
|
|
2
|
+
export type { ItemEntity, ResolvedItemData, GcItemInput, ItemEntry, InventoryData } from './types.js';
|
package/dist/resolver.d.ts
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
import type { GcItemInput, ResolvedItemData } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Return the wear tier name for a given paint wear float.
|
|
4
|
-
*
|
|
5
|
-
* @param paintWear - A float between 0.0 and 1.0.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getWearName(paintWear: number): string;
|
|
8
|
-
/**
|
|
9
|
-
* Check whether a GC item has a specific attribute by def_index.
|
|
10
|
-
*/
|
|
11
|
-
export declare function hasAttribute(item: {
|
|
12
|
-
attribute?: {
|
|
13
|
-
def_index: number;
|
|
14
|
-
}[];
|
|
15
|
-
}, attrDefIndex: number): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Build the full decorated name for a skin.
|
|
18
|
-
*
|
|
19
|
-
* The base name from inventory.json already includes `★` for knives/gloves
|
|
20
|
-
* (quality 3). For StatTrak knives the market name is `★ StatTrak™ Karambit | Fade`,
|
|
21
|
-
* so we insert the qualifier after `★ ` rather than before it.
|
|
22
|
-
*
|
|
23
|
-
* - `StatTrak™ ` if attribute 80 exists.
|
|
24
|
-
* - `Souvenir ` if attribute 140 exists.
|
|
25
|
-
* - ` (WearName)` suffix if `paint_wear` is present.
|
|
26
|
-
*/
|
|
27
|
-
export declare function buildSkinName(name: string, gcItem: GcItemInput): string;
|
|
28
2
|
/**
|
|
29
3
|
* Resolve a raw GC item into a name, image, and entity.
|
|
30
4
|
*
|
package/dist/resolver.js
CHANGED
|
@@ -4,7 +4,7 @@ import { getData } from './data-loader.js';
|
|
|
4
4
|
*
|
|
5
5
|
* @param paintWear - A float between 0.0 and 1.0.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
function getWearName(paintWear) {
|
|
8
8
|
if (paintWear <= 0.07)
|
|
9
9
|
return 'Factory New';
|
|
10
10
|
if (paintWear <= 0.15)
|
|
@@ -18,7 +18,7 @@ export function getWearName(paintWear) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Check whether a GC item has a specific attribute by def_index.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
function hasAttribute(item, attrDefIndex) {
|
|
22
22
|
return (item.attribute || []).some(a => a.def_index === attrDefIndex);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -32,7 +32,7 @@ export function hasAttribute(item, attrDefIndex) {
|
|
|
32
32
|
* - `Souvenir ` if attribute 140 exists.
|
|
33
33
|
* - ` (WearName)` suffix if `paint_wear` is present.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
function buildSkinName(name, gcItem) {
|
|
36
36
|
let qualifier = '';
|
|
37
37
|
if (hasAttribute(gcItem, 80))
|
|
38
38
|
qualifier = 'StatTrak™ ';
|
|
@@ -88,8 +88,6 @@ function makeResult(entry, gcItem, entity) {
|
|
|
88
88
|
*/
|
|
89
89
|
export function resolveItem(gcItem) {
|
|
90
90
|
const data = getData();
|
|
91
|
-
if (!data)
|
|
92
|
-
return null;
|
|
93
91
|
const defIdx = String(gcItem.def_index);
|
|
94
92
|
const musicIndex = getAttributeUint32(gcItem, 166);
|
|
95
93
|
const graffitiTint = getAttributeUint32(gcItem, 233);
|
package/dist/resolver.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { resolveItem, getAttributeUint32
|
|
2
|
+
import { resolveItem, getAttributeUint32 } from './resolver.js';
|
|
3
3
|
import { getData } from './data-loader.js';
|
|
4
4
|
/** Build an attribute entry with a uint32 LE-encoded value. */
|
|
5
5
|
function makeAttr(defIndex, value) {
|
|
@@ -35,83 +35,15 @@ describe('getAttributeUint32', () => {
|
|
|
35
35
|
const item = { attribute: [makeAttr(100, 1), makeAttr(166, 99), makeAttr(200, 3)] };
|
|
36
36
|
expect(getAttributeUint32(item, 166)).toBe(99);
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
describe('getWearName', () => {
|
|
43
|
-
it('returns Factory New for wear <= 0.07', () => {
|
|
44
|
-
expect(getWearName(0.05)).toBe('Factory New');
|
|
45
|
-
expect(getWearName(0.07)).toBe('Factory New');
|
|
46
|
-
});
|
|
47
|
-
it('returns Minimal Wear for wear <= 0.15', () => {
|
|
48
|
-
expect(getWearName(0.10)).toBe('Minimal Wear');
|
|
49
|
-
expect(getWearName(0.15)).toBe('Minimal Wear');
|
|
50
|
-
});
|
|
51
|
-
it('returns Field-Tested for wear <= 0.38', () => {
|
|
52
|
-
expect(getWearName(0.30)).toBe('Field-Tested');
|
|
53
|
-
expect(getWearName(0.38)).toBe('Field-Tested');
|
|
54
|
-
});
|
|
55
|
-
it('returns Well-Worn for wear <= 0.45', () => {
|
|
56
|
-
expect(getWearName(0.40)).toBe('Well-Worn');
|
|
57
|
-
expect(getWearName(0.45)).toBe('Well-Worn');
|
|
58
|
-
});
|
|
59
|
-
it('returns Battle-Scarred for wear > 0.45', () => {
|
|
60
|
-
expect(getWearName(0.80)).toBe('Battle-Scarred');
|
|
61
|
-
expect(getWearName(1.0)).toBe('Battle-Scarred');
|
|
38
|
+
it('returns 0 for a zero-filled 4-byte buffer', () => {
|
|
39
|
+
const buf = Buffer.alloc(4, 0);
|
|
40
|
+
expect(getAttributeUint32({ attribute: [{ def_index: 166, value_bytes: buf }] }, 166)).toBe(0);
|
|
62
41
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
it('returns true when the attribute exists', () => {
|
|
69
|
-
expect(hasAttribute({ attribute: [makeAttr(80, 1)] }, 80)).toBe(true);
|
|
70
|
-
});
|
|
71
|
-
it('returns false when the attribute does not exist', () => {
|
|
72
|
-
expect(hasAttribute({ attribute: [makeAttr(80, 1)] }, 140)).toBe(false);
|
|
73
|
-
});
|
|
74
|
-
it('returns false when attribute array is empty', () => {
|
|
75
|
-
expect(hasAttribute({ attribute: [] }, 80)).toBe(false);
|
|
76
|
-
});
|
|
77
|
-
it('returns false when attribute array is missing', () => {
|
|
78
|
-
expect(hasAttribute({}, 80)).toBe(false);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
// ---------------------------------------------------------------------------
|
|
82
|
-
// buildSkinName
|
|
83
|
-
// ---------------------------------------------------------------------------
|
|
84
|
-
describe('buildSkinName', () => {
|
|
85
|
-
it('returns name with wear for a normal skin', () => {
|
|
86
|
-
expect(buildSkinName('AK-47 | Redline', { def_index: 7, paint_wear: 0.30 })).toBe('AK-47 | Redline (Field-Tested)');
|
|
87
|
-
});
|
|
88
|
-
it('prefixes StatTrak™ for regular skins', () => {
|
|
89
|
-
expect(buildSkinName('AK-47 | Redline', {
|
|
90
|
-
def_index: 7,
|
|
91
|
-
paint_wear: 0.30,
|
|
92
|
-
attribute: [makeAttr(80, 1)],
|
|
93
|
-
})).toBe('StatTrak™ AK-47 | Redline (Field-Tested)');
|
|
94
|
-
});
|
|
95
|
-
it('prefixes Souvenir for regular skins', () => {
|
|
96
|
-
expect(buildSkinName('AK-47 | Redline', {
|
|
97
|
-
def_index: 7,
|
|
98
|
-
paint_wear: 0.30,
|
|
99
|
-
attribute: [makeAttr(140, 1)],
|
|
100
|
-
})).toBe('Souvenir AK-47 | Redline (Field-Tested)');
|
|
101
|
-
});
|
|
102
|
-
it('knife name keeps ★ from data without duplication', () => {
|
|
103
|
-
expect(buildSkinName('★ Karambit | Fade', { def_index: 507, quality: 3, paint_wear: 0.01 })).toBe('★ Karambit | Fade (Factory New)');
|
|
104
|
-
});
|
|
105
|
-
it('inserts StatTrak™ after ★ for quality 3 knives', () => {
|
|
106
|
-
expect(buildSkinName('★ Karambit | Fade', {
|
|
107
|
-
def_index: 507,
|
|
108
|
-
quality: 3,
|
|
109
|
-
paint_wear: 0.01,
|
|
110
|
-
attribute: [makeAttr(80, 1)],
|
|
111
|
-
})).toBe('★ StatTrak™ Karambit | Fade (Factory New)');
|
|
112
|
-
});
|
|
113
|
-
it('returns name without wear suffix when paint_wear is absent', () => {
|
|
114
|
-
expect(buildSkinName('AK-47 | Redline', { def_index: 7 })).toBe('AK-47 | Redline');
|
|
42
|
+
it('reads only the first 4 bytes from a longer buffer', () => {
|
|
43
|
+
const buf = Buffer.alloc(8);
|
|
44
|
+
buf.writeUInt32LE(123, 0);
|
|
45
|
+
buf.writeUInt32LE(999, 4);
|
|
46
|
+
expect(getAttributeUint32({ attribute: [{ def_index: 166, value_bytes: buf }] }, 166)).toBe(123);
|
|
115
47
|
});
|
|
116
48
|
});
|
|
117
49
|
// ---------------------------------------------------------------------------
|
|
@@ -366,3 +298,80 @@ describe('resolveItem — edge cases', () => {
|
|
|
366
298
|
expect(result.entity).toBe('crate');
|
|
367
299
|
});
|
|
368
300
|
});
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
// Wear-name boundaries via resolveItem (AK-47 Redline, def 7 paint 282)
|
|
303
|
+
// ---------------------------------------------------------------------------
|
|
304
|
+
describe('resolveItem — wear-name boundaries', () => {
|
|
305
|
+
const skin = { def_index: 7, paint_index: 282 };
|
|
306
|
+
it('Factory New at boundary (0.07)', () => {
|
|
307
|
+
const result = resolveItem({ ...skin, paint_wear: 0.07 });
|
|
308
|
+
expect(result.name).toContain('(Factory New)');
|
|
309
|
+
});
|
|
310
|
+
it('Minimal Wear just above Factory New boundary (0.071)', () => {
|
|
311
|
+
const result = resolveItem({ ...skin, paint_wear: 0.071 });
|
|
312
|
+
expect(result.name).toContain('(Minimal Wear)');
|
|
313
|
+
});
|
|
314
|
+
it('Minimal Wear at boundary (0.15)', () => {
|
|
315
|
+
const result = resolveItem({ ...skin, paint_wear: 0.15 });
|
|
316
|
+
expect(result.name).toContain('(Minimal Wear)');
|
|
317
|
+
});
|
|
318
|
+
it('Field-Tested just above Minimal Wear boundary (0.151)', () => {
|
|
319
|
+
const result = resolveItem({ ...skin, paint_wear: 0.151 });
|
|
320
|
+
expect(result.name).toContain('(Field-Tested)');
|
|
321
|
+
});
|
|
322
|
+
it('Field-Tested at boundary (0.38)', () => {
|
|
323
|
+
const result = resolveItem({ ...skin, paint_wear: 0.38 });
|
|
324
|
+
expect(result.name).toContain('(Field-Tested)');
|
|
325
|
+
});
|
|
326
|
+
it('Well-Worn just above Field-Tested boundary (0.381)', () => {
|
|
327
|
+
const result = resolveItem({ ...skin, paint_wear: 0.381 });
|
|
328
|
+
expect(result.name).toContain('(Well-Worn)');
|
|
329
|
+
});
|
|
330
|
+
it('Well-Worn at boundary (0.45)', () => {
|
|
331
|
+
const result = resolveItem({ ...skin, paint_wear: 0.45 });
|
|
332
|
+
expect(result.name).toContain('(Well-Worn)');
|
|
333
|
+
});
|
|
334
|
+
it('Battle-Scarred just above Well-Worn boundary (0.451)', () => {
|
|
335
|
+
const result = resolveItem({ ...skin, paint_wear: 0.451 });
|
|
336
|
+
expect(result.name).toContain('(Battle-Scarred)');
|
|
337
|
+
});
|
|
338
|
+
it('Battle-Scarred at 1.0', () => {
|
|
339
|
+
const result = resolveItem({ ...skin, paint_wear: 1.0 });
|
|
340
|
+
expect(result.name).toContain('(Battle-Scarred)');
|
|
341
|
+
});
|
|
342
|
+
it('Factory New at 0.0', () => {
|
|
343
|
+
const result = resolveItem({ ...skin, paint_wear: 0.0 });
|
|
344
|
+
expect(result.name).toContain('(Factory New)');
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
// ---------------------------------------------------------------------------
|
|
348
|
+
// Numeric edge cases
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
describe('resolveItem — numeric edge cases', () => {
|
|
351
|
+
it('NaN paint_wear still resolves as a skin', () => {
|
|
352
|
+
const result = resolveItem({ def_index: 7, paint_index: 282, paint_wear: NaN });
|
|
353
|
+
expect(result).not.toBeNull();
|
|
354
|
+
expect(result.entity).toBe('skin');
|
|
355
|
+
// NaN fails all <= checks, so falls through to Battle-Scarred
|
|
356
|
+
expect(result.name).toContain('(Battle-Scarred)');
|
|
357
|
+
});
|
|
358
|
+
it('Infinity paint_wear resolves as Battle-Scarred', () => {
|
|
359
|
+
const result = resolveItem({ def_index: 7, paint_index: 282, paint_wear: Infinity });
|
|
360
|
+
expect(result).not.toBeNull();
|
|
361
|
+
expect(result.name).toContain('(Battle-Scarred)');
|
|
362
|
+
});
|
|
363
|
+
it('negative paint_wear resolves as Factory New', () => {
|
|
364
|
+
const result = resolveItem({ def_index: 7, paint_index: 282, paint_wear: -1 });
|
|
365
|
+
expect(result).not.toBeNull();
|
|
366
|
+
expect(result.name).toContain('(Factory New)');
|
|
367
|
+
});
|
|
368
|
+
it('fractional def_index is coerced to string for lookup', () => {
|
|
369
|
+
// 7.5 becomes "7.5" which won't match any key → null
|
|
370
|
+
const result = resolveItem({ def_index: 7.5 });
|
|
371
|
+
expect(result).toBeNull();
|
|
372
|
+
});
|
|
373
|
+
it('negative def_index returns null', () => {
|
|
374
|
+
const result = resolveItem({ def_index: -1 });
|
|
375
|
+
expect(result).toBeNull();
|
|
376
|
+
});
|
|
377
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cs2-inventory-resolver",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Resolve CS2 Game Coordinator protobuf items into human-readable names, images, and categories",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cs2",
|
|
7
|
+
"csgo",
|
|
8
|
+
"counter-strike",
|
|
9
|
+
"steam",
|
|
10
|
+
"inventory",
|
|
11
|
+
"skins",
|
|
12
|
+
"game-coordinator",
|
|
13
|
+
"protobuf",
|
|
14
|
+
"resolver",
|
|
15
|
+
"valve"
|
|
16
|
+
],
|
|
5
17
|
"type": "module",
|
|
6
18
|
"main": "./dist/index.js",
|
|
7
19
|
"types": "./dist/index.d.ts",
|