@ianlucas/cs2-lib 5.0.0-rc.4 → 5.0.0-rc.5
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 +2 -2
- package/dist/inventory.js +5 -5
- package/package.json +1 -1
package/dist/inventory.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ export declare class CS2InventoryItem extends CS2EconomyItem implements Interfac
|
|
|
110
110
|
constructor(inventory: CS2Inventory, uid: number, baseInventoryItem: CS2BaseInventoryItem, { economy, item, language }: CS2EconomyItem);
|
|
111
111
|
edit(...sources: Partial<CS2BaseInventoryItem>[]): void;
|
|
112
112
|
}
|
|
113
|
-
export declare function mapAllStickers(stickers: CS2InventoryItem["stickers"]):
|
|
113
|
+
export declare function mapAllStickers(stickers: CS2InventoryItem["stickers"]): [number, MapValue<typeof stickers> | undefined][];
|
|
114
114
|
export declare function mapStickers(stickers: CS2InventoryItem["stickers"]): [number, MapValue<typeof stickers>][];
|
|
115
|
-
export declare function mapAllPatches(patches: CS2InventoryItem["patches"]):
|
|
115
|
+
export declare function mapAllPatches(patches: CS2InventoryItem["patches"]): [number, number | undefined][];
|
|
116
116
|
export declare function mapPatches(patches: CS2InventoryItem["patches"]): [number, number][];
|
package/dist/inventory.js
CHANGED
|
@@ -7,7 +7,7 @@ import { CS2ItemType } from "./economy-types.js";
|
|
|
7
7
|
import { CS2Economy, CS2EconomyItem } from "./economy.js";
|
|
8
8
|
import { resolveInventoryData } from "./inventory-upgrader.js";
|
|
9
9
|
import { CS2Team } from "./teams.js";
|
|
10
|
-
import { assert, ensure, float
|
|
10
|
+
import { assert, ensure, float } from "./utils.js";
|
|
11
11
|
export const CS2_INVENTORY_VERSION = 1;
|
|
12
12
|
export const CS2_INVENTORY_TIMESTAMP = 1707696138408;
|
|
13
13
|
// prettier-ignore
|
|
@@ -446,21 +446,21 @@ export function mapAllStickers(stickers) {
|
|
|
446
446
|
const entries = [];
|
|
447
447
|
for (let slot = 0; slot < CS2_MAX_STICKERS; slot++) {
|
|
448
448
|
const sticker = stickers?.get(slot);
|
|
449
|
-
entries.push(
|
|
449
|
+
entries.push([slot, sticker]);
|
|
450
450
|
}
|
|
451
451
|
return entries;
|
|
452
452
|
}
|
|
453
453
|
export function mapStickers(stickers) {
|
|
454
|
-
return mapAllStickers(stickers).filter(
|
|
454
|
+
return mapAllStickers(stickers).filter((value) => value[1] !== undefined);
|
|
455
455
|
}
|
|
456
456
|
export function mapAllPatches(patches) {
|
|
457
457
|
const entries = [];
|
|
458
458
|
for (let slot = 0; slot < CS2_MAX_PATCHES; slot++) {
|
|
459
459
|
const patch = patches?.get(slot);
|
|
460
|
-
entries.push(
|
|
460
|
+
entries.push([slot, patch]);
|
|
461
461
|
}
|
|
462
462
|
return entries;
|
|
463
463
|
}
|
|
464
464
|
export function mapPatches(patches) {
|
|
465
|
-
return mapAllPatches(patches).filter(
|
|
465
|
+
return mapAllPatches(patches).filter((value) => value[1] !== undefined);
|
|
466
466
|
}
|