Files
WT-Offline/packages/local-service/src/char/actions/payload-params.ts
T
N0VAN0M4LY 08b5c1e51c feat(research): add vehicle research and purchases
Recompute unlocked ranks, prerequisites, and unit states before serving
profiles. Add research target selection, research conversion, vehicle
and slot purchases, and the price table. Support editing convertible RP
and restrict hidden vehicle visibility to eligible entries.

The client still displays zero purchase prices pending price table
integration.
2026-11-24 21:04:19 +08:00

13 lines
555 B
TypeScript

/** Typed reads of a char request's BLK parameters; a missing or differently typed parameter reads as undefined. */
import { findParam, type BlkBlock } from '@wto/blk';
export function stringParam(payload: BlkBlock, name: string): string | undefined {
const value = findParam(payload, name)?.value;
return value?.type === 'string' ? value.value : undefined;
}
export function intParam(payload: BlkBlock, name: string): number | undefined {
const value = findParam(payload, name)?.value;
return value?.type === 'int' ? value.value : undefined;
}