Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/windmill/node_modules/yaml/browser/dist/doc/Document.js>Document

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
class Document
import { Document } from "https://deno.land/x/windmill@v1.309.2/node_modules/yaml/browser/dist/doc/Document.js";

Constructors

new
Document(
value,
replacer,
options,
)

Methods

add(value)

Adds a value to the document.

addIn(path, value)

Adds a value to the document.

Create a deep copy of this Document and its contents.

Custom Node values that inherit from Object still refer to their original instances.

createAlias(node, name)

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.

createNode(
value,
replacer,
options,
)
createPair(
key,
value,
options?,
)

Convert a key and a value into a Pair using the current schema, recursively wrapping all values as Scalar or Collection nodes.

delete(key)

Removes a value from the document.

deleteIn(path)

Removes a value from the document.

get(key, keepScalar)

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).

getIn(path, keepScalar)

Returns 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).

has(key)

Checks if the document includes a value with the key key.

hasIn(path)

Checks if the document includes a value at path.

set(key, value)

Sets a value in this document. For !!set, value needs to be a boolean to add/remove the item from the set.

setIn(path, value)

Sets a value in this document. For !!set, value needs to be a boolean to add/remove the item from the set.

setSchema(version, options?)

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.

toJS(unnamed 0?)
toJSON(jsonArg, onAnchor)

A JSON representation of the document contents.

toString(options?)

A YAML representation of the document.