Skip to content

YamlCollectionTag

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:68

The yaml node, tag and visitor model, re-exported so a caller can write a custom tag without taking its own dependency on yaml.

Names are Yaml-prefixed rather than kept as upstream. This package’s index is a flat export *, so a bare Node, Document, Scalar or Schema would sit beside YamlParseStream and parseYaml under names that say nothing about YAML — and Node and Document are DOM globals, which this package, being portable, is expected to be imported alongside.

  • TagBase

collection: "map" | "seq"

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:72

The source collection type supported by this tag.


optional createNode?: (schema, value, ctx) => YamlNode

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:13

An optional factory function, used e.g. by collections when wrapping JS objects as AST nodes.

YamlSchema

unknown

YamlCreateNodeContext

YamlNode

TagBase.createNode


optional default?: boolean | "key"

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:21

If true, allows for values to be stringified without an explicit tag together with test. If 'key', this only applies if the value is used as a mapping key. For most cases, it’s unlikely that you’ll actually want to use this, even if you first think you do.

TagBase.default


optional format?: string

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:26

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

TagBase.format


optional identify?: (value) => boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:31

Used by YAML.createNode to detect your data type, e.g. using typeof or instanceof.

unknown

boolean

TagBase.identify


optional nodeClass?: {(schema?): YamlNode; from?: (schema, obj, ctx) => YamlNode; }

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:80

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

If the class provides a static from method, then that will be used if the tag object doesn’t have a createNode method.

YamlSchema

YamlNode

optional from?: (schema, obj, ctx) => YamlNode

YamlSchema

unknown

YamlCreateNodeContext

YamlNode


optional resolve?: (value, onError, options) => unknown

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:90

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

Note: this is required if nodeClass is not provided.

Parsed<YamlParsedNode, YamlParsedNode | null> | Parsed<YamlParsedNode>

(message) => void

ParseOptions

unknown


optional stringify?: undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:69


tag: string

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:37

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.

TagBase.tag


optional test?: undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:70