Skip to content

YamlScalarTag

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

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

optional collection?: undefined

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


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?: undefined

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


optional stringify?: (item, ctx, onComment?, onChompKeep?) => string

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

Optional function stringifying a Scalar node. If your data includes a suitable .toString() method, you can probably leave this undefined and use the default stringifier.

YamlScalar

The node being stringified.

YamlStringifyContext

Contains the stringifying context variables.

() => void

Callback to signal that the stringifier includes the item’s comment in its output.

() => void

Callback to signal that the output uses a block scalar type with the + chomping indicator.

string


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?: RegExp

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

Together with default allows for values to be stringified without an explicit tag and detected using a regular expression. For most cases, it’s unlikely that you’ll actually want to use these, even if you first think you do.

resolve(value, onError, options): unknown

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

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

string

(message) => void

ParseOptions

unknown