Skip to main content
Version: v0.0.2

Interface: X12ParseOptions

Options accepted by parseX12 to tune lenient/strict behaviour. Every field is optional; parseX12(raw, {}) is valid and produces the library defaults.

Remarks

With exactOptionalPropertyTypes: true, callers cannot pass { strict: undefined } - either omit the key or pass a boolean.

Example

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

Properties

onWarning?

readonly optional onWarning?: OnWarningCallback


profile?

readonly optional profile?: X12Profile | null

A trading-partner X12Profile to attach to the result. An explicit profile ALWAYS wins over any process-scoped default; pass null to opt out of the default for a single call. When omitted, parseX12 consults getDefaultProfile(). The profile is attached as ix.profile for attribution and consumed by partitionWarnings; it does not alter the lenient parse itself (v1 profiles are descriptive - see the profile subsystem docs).


strict?

readonly optional strict?: boolean