/** * Normalizes the non-fatal ERP `warnings` a connector returned for a labor ticket to * the `string[]` the NATS reply promises: non-empty strings only. Anything else (a * bare string, `null`, non-string entries) yields `[]`, so a connector that bypasses * the types (e.g. behind `@ts-ignore`) cannot put a non-array on the reply. */ export const normalizeLaborTicketWarnings = (raw: unknown): string[] => Array.isArray(raw) ? raw.filter((w): w is string => typeof w === "string" && w.trim() !== "") : [];