@juice789/tf2items 1.0.31 → 1.0.33

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/sku753.js ADDED
@@ -0,0 +1,28 @@
1
+ const skuFromItem753 = ({
2
+ market_hash_name,
3
+ game,
4
+ border,
5
+ type,
6
+ }) => [
7
+ 753,
8
+ type === '2' ? `${type}-${border}` : type,
9
+ game,
10
+ encodeURIComponent(market_hash_name)
11
+ ].filter(Boolean).join(';')
12
+
13
+ const itemFromSku753 = (sku) => {
14
+ const [x, type, game, market_hash_name] = sku.split(';')
15
+ const item = {
16
+ type,
17
+ border: type[1],
18
+ game,
19
+ market_hash_name: decodeURIComponent(market_hash_name)
20
+ }
21
+ item.sku = sku
22
+ return item
23
+ }
24
+
25
+ module.exports = {
26
+ skuFromItem753,
27
+ itemFromSku753
28
+ }