Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • TagBase
    • CollectionTag

Index

Properties

collection

collection: "map" | "seq"

The source collection type supported by this tag.

Optional default

default?: boolean

If true, together with test 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.

Optional format

format?: string

If a tag has multiple forms that should be parsed and/or stringified differently, use format to identify them.

Optional nodeClass

nodeClass?: new () => yaml.Node<unknown>

Type declaration

    • The Node child class that implements this tag. If set, used to select this tag when stringifying.

      Returns yaml.Node<unknown>

Optional stringify

stringify?: undefined

tag

tag: string

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.

Optional test

test?: undefined

Methods

Optional createNode

  • createNode(schema: yaml.Schema, value: unknown, ctx: CreateNodeContext): yaml.Node<unknown>
  • An optional factory function, used e.g. by collections when wrapping JS objects as AST nodes.

    Parameters

    • schema: yaml.Schema
    • value: unknown
    • ctx: CreateNodeContext

    Returns yaml.Node<unknown>

Optional identify

  • identify(value: unknown): boolean
  • Used by YAML.createNode to detect your data type, e.g. using typeof or instanceof.

    Parameters

    • value: unknown

    Returns boolean

resolve

  • Turns a value into an AST node. If returning a non-Node value, the output will be wrapped as a Scalar.

    Parameters

    Returns unknown

Generated using TypeDoc