@ianlucas/cs2-lib 3.0.0 → 3.1.0

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/dist/economy.d.ts CHANGED
@@ -63,6 +63,10 @@ export declare const CS_NAMETAG_TOOL_DEF = 1200;
63
63
  export declare const CS_STATTRAK_SWAP_TOOL_DEF = 1324;
64
64
  export declare const CS_STORAGE_UNIT_TOOL_DEF = 1201;
65
65
  export declare const CS_NONE = 0;
66
+ export declare const CS_WEAPON_CASE_ID = 9129;
67
+ export declare const CS_STICKER_CAPSULE_ID = 9134;
68
+ export declare const CS_GRAFFITI_BOX_ID = 11234;
69
+ export declare const CS_SOUVENIR_CASE_ID = 9147;
66
70
  type CS_EconomyPredicate = Partial<CS_Item> & {
67
71
  team?: CS_Team;
68
72
  };
@@ -108,6 +112,10 @@ export declare class CS_EconomyInstance {
108
112
  getWearLabel(wear: number): string;
109
113
  getStickerCategories(): string[];
110
114
  getStickers(): CS_Item[];
115
+ isWeaponCase(item: CS_Item): boolean;
116
+ isStickerCapsule(item: CS_Item): boolean;
117
+ isGraffitiBox(item: CS_Item): boolean;
118
+ isSouvenirCase(item: CS_Item): boolean;
111
119
  resolveItemImage(baseUrl: string, item: number | CS_Item, wear?: number): string;
112
120
  resolveCollectionImage(baseUrl: string, item: number | CS_Item): string;
113
121
  isCase(item: number | CS_Item): boolean;
package/dist/economy.js CHANGED
@@ -36,6 +36,10 @@ export const CS_NAMETAG_TOOL_DEF = 1200;
36
36
  export const CS_STATTRAK_SWAP_TOOL_DEF = 1324;
37
37
  export const CS_STORAGE_UNIT_TOOL_DEF = 1201;
38
38
  export const CS_NONE = 0;
39
+ export const CS_WEAPON_CASE_ID = 9129;
40
+ export const CS_STICKER_CAPSULE_ID = 9134;
41
+ export const CS_GRAFFITI_BOX_ID = 11234;
42
+ export const CS_SOUVENIR_CASE_ID = 9147;
39
43
  function filterItems(predicate) {
40
44
  return function filter(item) {
41
45
  return (compare(predicate.type, item.type) &&
@@ -297,6 +301,18 @@ export class CS_EconomyInstance {
297
301
  getStickers() {
298
302
  return Array.from(this.stickers);
299
303
  }
304
+ isWeaponCase(item) {
305
+ return item.category === this.getById(CS_WEAPON_CASE_ID).category;
306
+ }
307
+ isStickerCapsule(item) {
308
+ return item.category === this.getById(CS_STICKER_CAPSULE_ID).category;
309
+ }
310
+ isGraffitiBox(item) {
311
+ return item.category === this.getById(CS_GRAFFITI_BOX_ID).category;
312
+ }
313
+ isSouvenirCase(item) {
314
+ return item.category === this.getById(CS_SOUVENIR_CASE_ID).category;
315
+ }
300
316
  resolveItemImage(baseUrl, item, wear) {
301
317
  item = this.get(item);
302
318
  const { id, image } = item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ianlucas/cs2-lib",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A TypeScript library for manipulating Counter-Strike 2 data",
5
5
  "license": "MIT",
6
6
  "author": "Ian Lucas",