Skip to main content
Version: v0.0.2

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

X12ParseWarning

Returns

void

Example

import { parseX12, type OnWarningCallback } from "@cosyte/x12";
const onWarning: OnWarningCallback = (w) => {
console.warn(w.code, w.message);
};
parseX12(raw, { onWarning });