assignment-values.ts
Language TypeScript750 B26 lines
/*** Placeholders Plinth writes for "no one is assigned".** The live API sends `--`; the vendor's own example showed `---`. Keep the* whole family: a plain truthiness check would turn `--` into a designer named* "--" holding dozens of order lines. "Nobody holds this" and "somebody called -- holds this" lead to* opposite actions.*/export const UNASSIGNED_VALUES = new Set(['','-','--','---','n/a','na','none','null','unassigned',])/** Sentinel-aware read of an assignment value: `--` and friends become null. */export function assignedPerson(raw: string | null): string | null {if (raw === null) return nullconst v = raw.trim()return UNASSIGNED_VALUES.has(v.toLowerCase()) ? null : v || null}