Skip to main content
Version: v0.0.2

Function: unknownCarc()

unknownCarc(position, code): X12ParseWarning

Build an X12_UNKNOWN_CARC warning. Emitted when a CAS adjustment carries a CARC code outside the bundled snapshot (see "../code-lists/carc.js".CARC). The verbatim code is still preserved on the parsed adjustment - only the description is missing. The code value is shape-validated against [A-Z0-9]{1,5} before echoing in the message; a hostile non-conformant value collapses to the literal (non-spec) so the parser never echoes arbitrary bytes (H-PHI invariant).

Parameters

position

X12Position

code

string

Returns

X12ParseWarning

Example

import { unknownCarc } from "@cosyte/x12";
const w = unknownCarc(
{ segmentIndex: 14, interchangeIndex: 0, groupIndex: 0, transactionIndex: 0 },
"9999",
);