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.
Extends
Section titled “Extends”TagBase
Properties
Section titled “Properties”collection?
Section titled “collection?”
optionalcollection?:undefined
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:40
createNode?
Section titled “createNode?”
optionalcreateNode?: (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.
Parameters
Section titled “Parameters”schema
Section titled “schema”unknown
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”TagBase.createNode
default?
Section titled “default?”
optionaldefault?: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.
Inherited from
Section titled “Inherited from”TagBase.default
format?
Section titled “format?”
optionalformat?: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.
Inherited from
Section titled “Inherited from”TagBase.format
identify?
Section titled “identify?”
optionalidentify?: (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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”TagBase.identify
nodeClass?
Section titled “nodeClass?”
optionalnodeClass?:undefined
Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/schema/types.d.ts:41
stringify?
Section titled “stringify?”
optionalstringify?: (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.
Parameters
Section titled “Parameters”The node being stringified.
Contains the stringifying context variables.
onComment?
Section titled “onComment?”() => void
Callback to signal that the stringifier includes the item’s comment in its output.
onChompKeep?
Section titled “onChompKeep?”() => void
Callback to signal that the output uses a block scalar
type with the + chomping indicator.
Returns
Section titled “Returns”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.
Inherited from
Section titled “Inherited from”TagBase.tag
optionaltest?: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.
Methods
Section titled “Methods”resolve()
Section titled “resolve()”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.
Parameters
Section titled “Parameters”string
onError
Section titled “onError”(message) => void
options
Section titled “options”ParseOptions
Returns
Section titled “Returns”unknown