If a tag has multiple forms that should be parsed and/or stringified
differently, use format
to identify them.
The identifier for your data type, with which its stringified form will be
prefixed. Should either be a !-prefixed local !tag
, or a fully qualified
tag:domain,date:foo
.
Together with default
allows for values to be stringified without an
explicit tag and detected using a regular expression. For most cases, it's
unlikely that you'll actually want to use these, even if you first think
you do.
Used by YAML.createNode
to detect your data type, e.g. using typeof
or
instanceof
.
Turns a value into an AST node.
If returning a non-Node
value, the output will be wrapped as a Scalar
.
Optional function stringifying a Scalar node. If your data includes a
suitable .toString()
method, you can probably leave this undefined and
use the default stringifier.
The node being stringified.
Contains the stringifying context variables.
Callback to signal that the stringifier includes the item's comment in its output.
Callback to signal that the output uses a block scalar
type with the +
chomping indicator.
Generated using TypeDoc
If
true
, together withtest
allows for values to be stringified without an explicit tag. For most cases, it's unlikely that you'll actually want to use this, even if you first think you do.