Type Alias: OnWarningCallback
OnWarningCallback = (
warning) =>void
Callback invoked inline each time the parser emits a Tier-2 warning.
Always fires BEFORE the warning is appended to X12Interchange.warnings
so consumers observe warnings in the same order the parser discovered them.
Parameters
warning
Returns
void
Example
import { parseX12, type OnWarningCallback } from "@cosyte/x12";
const onWarning: OnWarningCallback = (w) => {
console.warn(w.code, w.message);
};
parseX12(raw, { onWarning });