Skip to main content
Version: v0.0.7

Variable: UNEXPECTED_SEGMENT_CONTEXTS

const UNEXPECTED_SEGMENT_CONTEXTS: object

Which structural rule an out-of-place segment broke. A closed, library-owned set. The segment's own id is deliberately NOT part of it: a segment that is not where it belongs is exactly the case where its first element is arbitrary sender bytes rather than a spec name.

Type Declaration

BODY_OUTSIDE_TRANSACTION

readonly BODY_OUTSIDE_TRANSACTION: "body-outside-transaction" = "body-outside-transaction"

A body segment appeared outside any open transaction set.

GE_WITHOUT_GS

readonly GE_WITHOUT_GS: "ge-without-gs" = "ge-without-gs"

A GE appeared with no open GS.

SE_WITHOUT_ST

readonly SE_WITHOUT_ST: "se-without-st" = "se-without-st"

An SE appeared with no open transaction set.

ST_WITHOUT_GS

readonly ST_WITHOUT_GS: "st-without-gs" = "st-without-gs"

An ST appeared with no open functional group.

TA1_INSIDE_GROUP

readonly TA1_INSIDE_GROUP: "ta1-inside-group" = "ta1-inside-group"

A TA1 (envelope-level by spec) appeared inside an open functional group.

Example

import { unexpectedSegment, UNEXPECTED_SEGMENT_CONTEXTS } from "@cosyte/x12";
const w = unexpectedSegment({ segmentIndex: 12 }, UNEXPECTED_SEGMENT_CONTEXTS.GE_WITHOUT_GS);