Hierarchy

Constructors

Properties

[NODE_TYPE]: symbol
add: ((pair, overwrite?) => void)

Type declaration

    • (pair, overwrite?): void
    • Parameters

      • pair: Pair<any, any> | {
            key: any;
            value: any;
        }
      • Optional overwrite: boolean

      Returns void

anchor?: string

An optional anchor on this node. Used by alias nodes.

comment?: null | string

A comment on or immediately after this

commentBefore?: null | string

A comment before this

delete: ((key) => boolean)

Type declaration

    • (key): boolean
    • Parameters

      • key: unknown

      Returns boolean

flow?: boolean

If true, stringify this and all child nodes using flow rather than block styles.

get: {
    (key, keepScalar): undefined | Scalar<any>;
    (key, keepScalar?): any;
    (key, keepScalar?): any;
}

Type declaration

    • (key, keepScalar): undefined | Scalar<any>
    • Parameters

      • key: unknown
      • keepScalar: true

      Returns undefined | Scalar<any>

    • (key, keepScalar?): any
    • Parameters

      • key: unknown
      • Optional keepScalar: false

      Returns any

    • (key, keepScalar?): any
    • Parameters

      • key: unknown
      • Optional keepScalar: boolean

      Returns any

has: ((key) => boolean)

Type declaration

    • (key): boolean
    • Parameters

      • key: unknown

      Returns boolean

items: unknown[]
range?: null | Range

The [start, value-end, node-end] character offsets for the part of the source parsed into this node (undefined if not parsed). The value-end and node-end positions are themselves not included in their respective ranges.

schema: undefined | yaml.Schema
set: ((key, value) => void)

Type declaration

    • (key, value): void
    • Parameters

      • key: any
      • value: any

      Returns void

spaceBefore?: boolean

A blank line before this node and its commentBefore

srcToken?: yaml.CST.Token

The CST token that was composed into this node.

tag?: string

A fully qualified tag, if required

maxFlowStringSingleLineLength: number
tag: string

Accessors

  • get tagName(): "tag:yaml.org,2002:seq"
  • Returns "tag:yaml.org,2002:seq"

Methods

  • Adds a value to the collection. For !!map and !!omap the value must be a Pair instance or a { key, value } object, which may not have a key that already exists in the map.

    Parameters

    • path: Iterable<unknown>
    • value: unknown

    Returns void

  • Create a copy of this collection.

    Parameters

    • Optional schema: yaml.Schema

      If defined, overwrites the original's schema

    Returns Collection

  • Removes a value from the collection.

    Parameters

    • path: Iterable<unknown>

    Returns boolean

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

    Parameters

    • path: Iterable<unknown>
    • Optional keepScalar: boolean

    Returns unknown

  • Parameters

    • Optional allowScalar: boolean

    Returns boolean

  • Checks if the collection includes a value with the key key.

    Parameters

    • path: Iterable<unknown>

    Returns boolean

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

    Parameters

    • path: Iterable<unknown>
    • value: unknown

    Returns void

  • If ctx is given, the return type is actually Map<unknown, unknown>, but TypeScript won't allow widening the signature of a child method.

    Parameters

    • Optional _: unknown
    • Optional ctx: ToJSContext

    Returns unknown[]

  • Parameters

    • Optional ctx: StringifyContext
    • Optional onComment: (() => void)
        • (): void
        • Returns void

    • Optional onChompKeep: (() => void)
        • (): void
        • Returns void

    Returns string

Generated using TypeDoc