Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / normalizeJson

Function: normalizeJson()

normalizeJson(json): Json

Defined in: rcml/src/email/validate-rcml-json.ts:263

Normalize RCML content JSON to canonical form.

  • Removes marks: [] (empty marks arrays should be omitted).
  • Removes empty text nodes (text: "").
  • Merges adjacent text nodes that share identical mark sets.

Parameters

json

Json

A structurally valid RCML document.

Returns

Json

A new Json object in canonical form. The input is not mutated.