/** * The cost-code rule, kept on its own so BOTH sides can use it without dragging a * server-only dependency in behind it. * * The plant register writes `SS02`; a purchase order prints `SS-02`. Stripping * non-alphanumerics is the whole job — this is the same code typed two ways, NOT a * guess at a machine. `lib/purchase-parser.ts` imports pdfjs and `node:module`, so * anything a CLIENT component needs must live here instead. */ export function normaliseCostCode(raw: string): string { return (raw || "").toUpperCase().replace(/[^A-Z0-9]/g, ""); }