Optionalvalue: anyOptionaloptions: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptionsOptionaloptions: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptionsReadonly[A comment immediately after this Document
A comment before this Document
The document contents.
Errors encountered during parsing.
OptionalrangeThe [start, value-end, node-end] character offsets for the part of the
source parsed into this document (undefined if not parsed). The value-end
and node-end positions are themselves not included in their respective
ranges.
The schema used with the document. Use setSchema() to change.
Warnings encountered during parsing.
Adds a value to the document.
Create a new Alias node, ensuring that the target node has the required anchor.
If node already has an anchor, name is ignored.
Otherwise, the node.anchor value will be set to name,
or if an anchor with that name is already present in the document,
name will be used as a prefix for a new unique anchor.
If name is undefined, the generated anchor will use 'a' as a prefix.
Convert any value into a Node using the current schema, recursively
turning objects into collections.
Optionaloptions: CreateNodeOptionsConvert any value into a Node using the current schema, recursively
turning objects into collections.
Optionaloptions: CreateNodeOptionsRemoves a value from the document.
true if the item was found and removed.
Removes a value from the document.
true if the item was found and removed.
Returns item at key, or undefined if not found. By default unwraps
scalar values from their surrounding node; to disable set keepScalar to
true (collections are always returned intact).
OptionalkeepScalar: booleanReturns item at path, or undefined if not found. By default unwraps
scalar values from their surrounding node; to disable set keepScalar to
true (collections are always returned intact).
OptionalkeepScalar: booleanChecks if the document includes a value with the key key.
Checks if the document includes a value at path.
Sets a value in this document. For !!set, value needs to be a
boolean to add/remove the item from the set.
Sets a value in this document. For !!set, value needs to be a
boolean to add/remove the item from the set.
Change the YAML version and schema used by the document.
A null version disables support for directives, explicit tags, anchors, and aliases.
It also requires the schema option to be given as a Schema instance value.
Overrides all previously set schema options.
Optionaloptions: SchemaOptionsA plain JavaScript representation of the document contents.
Optionalopt: ToJSOptions & { [ignored: string]: unknown }A JSON representation of the document contents.
OptionaljsonArg: stringUsed by JSON.stringify to indicate the array index or
property name.
OptionalonAnchor: (value: unknown, count: number) => void
The initial value for the document, which will be wrapped in a Node container.