Capy-Bearer Documentation

yaml_encode

lib call

Capy

function yaml_encode(value : any) string

Description

yaml_encode() encodes an any as YAML. Maps retain insertion order. Empty maps and lists keep their kinds.

Cycles, values beyond the BRRB nesting or node limits, and unsupported nodes cause the complete encoding to fail. Opaque handles and callables are unsupported. Failure returns an empty string, not partial YAML or a null replacement. This API does not expose a structured encoding error.

Parameters

value : value to encode

Return Values

The YAML source, or an empty string on encoding failure.

Example

Capy

print(yaml_encode({name: "Ada"}))

Output

name: Ada