Skip to main content
Version: v0.0.2

Function: serializeX12()

serializeX12(interchange, opts?): string

Serialize an X12Interchange back to an X12 byte stream. Pure function - never throws, never mutates the input, never performs I/O. See the module header for the two emit modes.

Parameters

interchange

X12Interchange

opts?

SerializeOptions = {}

Returns

string

Example

import { parseX12, serializeX12 } from "@cosyte/x12";
const ix = parseX12(raw);
const bytes = serializeX12(ix); // byte-faithful for a Tier-1 input