Skip to content

toData

toData(model: Model, options?: ToDataOptions): unknown

Emit any Model to a plain POJO / array / scalar tree — the supported observation surface. Keys are YAML keys in canonical order (from the spec), extras merged after ordered keys, Raw unwrapped to its inner value.

  • comments: false (default): Commented wrappers are unwrapped to their values; the returned tree contains no framework wrapper types, so it is safe for toEqual.
  • comments: true: a node that carries a comment is returned as a CommentNode.

Any model may be passed (step, job, on, …). Unlike toYaml, this does not run the yaml-backend passes (block-literal promotion, comment spacing) or postProcess; assert those via the YAML string.

Parameter Type

model

Model

options?

ToDataOptions

unknown