Interface: X12ParseWarning
Data shape for every Tier-2 warning emitted by the parser. Warnings are
plain data (distinct from X12ParseError, which is a thrown Error
subclass) so they can be safely accumulated on X12Interchange.warnings
and passed to onWarning callbacks.
message is always a member of ALL_WARNING_MESSAGES: it names
the deviation, never the bytes that caused it. position says where to
look and the bytes stay on the model. A warning has no snippet.
Example
import type { X12ParseWarning } from "@cosyte/x12";
declare const w: X12ParseWarning;
w.code; // "X12_PRE_005010"
w.position; // { segmentIndex: 0, interchangeIndex: 0, elementIndex: 12 }
Properties
code
readonlycode:X12WarningCode
message
readonlymessage:string
position
readonlyposition:X12Position