Skip to main content
Version: v0.0.2

Function: groupCountMismatch()

groupCountMismatch(position, declared, actual): X12ParseWarning

Build an X12_GROUP_COUNT_MISMATCH warning. Emitted when IEA-01 does not equal the actual number of GS..GE groups present in the interchange. Trading partners use this to detect transmission truncation; the parser surfaces both values verbatim and never silently corrects them.

Parameters

position

X12Position

declared

string

actual

number

Returns

X12ParseWarning

Example

import { groupCountMismatch } from "@cosyte/x12";
const w = groupCountMismatch(
{ segmentIndex: 5, interchangeIndex: 0, elementIndex: 1 },
"2",
1,
);