Skip to content

render

render(items: readonly readonly [Document, string][], transforms: readonly Transform[], opts: object): Rendered[]

Render every [document, path] pair to YAML.

Invariants:

  • Transforms apply in list order: index 0 first, last index last. This is the whole ordering contract — the pipeline does not sort or reorder.
  • Each document is rendered from an independent deep clone; the caller’s models are never mutated.
  • header and autoDedent are threaded straight into toYaml on every document (ADR-0002: no global carries them).
Parameter Type

items

readonly readonly [Document, string][]

transforms

readonly Transform[]

opts

{ autoDedent: boolean; header: string | ((vars: HeaderVariables) => string) | null | undefined; }

opts.autoDedent

boolean

opts.header

string | ((vars: HeaderVariables) => string) | null | undefined

Rendered[]