Skip to content

Graphorin API reference v0.8.0


Graphorin API reference / @graphorin/tools / outbound / splitByWrapEnvelope

Function: splitByWrapEnvelope()

ts
function splitByWrapEnvelope(
   text, 
   open, 
   close): readonly {
  kind: "wrapped" | "plain";
  text: string;
}[];

Defined in: packages/tools/src/outbound/commentary-patterns.ts:158

Split a body into already-wrapped + plain segments so a sanitizer never re-scans inside an existing wrap envelope. This is the idempotency primitive that makes layered outbound sanitization (storage-write, wire-emission, channel delivery) composable: a second pass over previously-sanitized output is bytes-equal.

Parameters

ParameterType
textstring
openstring
closestring

Returns

readonly { kind: "wrapped" | "plain"; text: string; }[]

Stable