@ianlucas/cs2-lib 5.5.0 → 5.6.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/inventory.d.ts +1 -0
- package/dist/inventory.js +7 -4
- package/package.json +1 -1
package/dist/inventory.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare class CS2Inventory {
|
|
|
83
83
|
getAll(): CS2InventoryItem[];
|
|
84
84
|
getAllAsBase(): CS2BaseInventoryItem[];
|
|
85
85
|
setAll(items: Map<number, CS2InventoryItem>): this;
|
|
86
|
+
getData(): CS2InventoryData;
|
|
86
87
|
size(): number;
|
|
87
88
|
move(options?: Partial<CS2InventorySpec>): CS2Inventory;
|
|
88
89
|
}
|
package/dist/inventory.js
CHANGED
|
@@ -95,10 +95,7 @@ export class CS2Inventory {
|
|
|
95
95
|
return Object.fromEntries(Array.from(items).map(([key, value]) => [key, value.asBase()]));
|
|
96
96
|
}
|
|
97
97
|
stringify() {
|
|
98
|
-
return JSON.stringify(
|
|
99
|
-
items: this.toBaseInventoryItems(this.items),
|
|
100
|
-
version: CS2_INVENTORY_VERSION
|
|
101
|
-
});
|
|
98
|
+
return JSON.stringify(this.getData());
|
|
102
99
|
}
|
|
103
100
|
isFull() {
|
|
104
101
|
return this.items.size >= this.options.maxItems;
|
|
@@ -374,6 +371,12 @@ export class CS2Inventory {
|
|
|
374
371
|
this.items = items;
|
|
375
372
|
return this;
|
|
376
373
|
}
|
|
374
|
+
getData() {
|
|
375
|
+
return {
|
|
376
|
+
items: this.toBaseInventoryItems(this.items),
|
|
377
|
+
version: CS2_INVENTORY_VERSION
|
|
378
|
+
};
|
|
379
|
+
}
|
|
377
380
|
size() {
|
|
378
381
|
return this.items.size;
|
|
379
382
|
}
|
package/package.json
CHANGED