Skip to content

v7.0.0

Choose a tag to compare

@akiver akiver released this 03 Oct 12:37
· 4 commits to main since this release

Features

  • Decode and encode crosshair codes from the CS2 30/09/2026 update (1.41.8.8).

⚠️ Breaking changes

  • version is replaced by format, a string discriminant named <container>-v<version byte>:
    'legacy-v1' | 'legacy-v3' | 'legacy-v4' | 'cs2-v1'.

  • The crosshair interfaces are renamed after their format:

    v6.0.0 v7.0.0 format
    CrosshairV1 CrosshairLegacyV1 legacy-v1
    CrosshairV3 CrosshairLegacyV3 legacy-v3
    CrosshairV4 CrosshairLegacyV4 legacy-v4
    - CrosshairV1 cs2-v1

    [!WARNING]
    CrosshairV1 still exists but it now describes the cs2-v1 crosshair. Code importing it keeps
    compiling while meaning something else, rename it to CrosshairLegacyV1.

  • encodeCrosshair throws InvalidCrosshairShareCode on an unknown format. In v6.0.0 an object
    with no version was silently encoded as a V4 code.

Migration

- import { decodeCrosshairShareCode, type CrosshairV1 } from 'csgo-sharecode';
+ import { decodeCrosshairShareCode, type CrosshairLegacyV1 } from 'csgo-sharecode';

- const crosshair: CrosshairV1 = { version: 1, ... };
+ const crosshair: CrosshairLegacyV1 = { format: 'legacy-v1', ... };