frontend / api/inventory/normalizers / normalizeInventoryRow
Function: normalizeInventoryRow()
normalizeInventoryRow(
raw):InventoryRow|null
Defined in: api/inventory/normalizers.ts:38
Normalize raw backend response into typed InventoryRow. Returns null if required fields (id) are missing. Uses defensive field picking with fallback chains for flexibility.
Parameters
raw
unknown
Unknown backend response data
Returns
InventoryRow
| null
Normalized InventoryRow or null if validation fails
Enterprise
- Accepts multiple field name variations from backend
- Gracefully handles missing optional fields
- Never throws; returns null for invalid data