Optional
compat?: string | Tags | nullOptional
customArray of additional tags to include in the schema, or a function that may modify the schema's base tag array.
Optional
merge?: booleanEnable support for <<
merge keys.
Default: false
for YAML 1.2, true
for earlier versions
Optional
resolveWhen using the 'core'
schema, support parsing values with these
explicit YAML 1.1 tags:
!!binary
, !!omap
, !!pairs
, !!set
, !!timestamp
.
Default true
Optional
schema?: string | yaml.SchemaThe base schema to use.
The core library has built-in support for the following:
'failsafe'
: A minimal schema that parses all scalars as strings'core'
: The YAML 1.2 core schema'json'
: The YAML 1.2 JSON schema, with minimal rules for JSON compatibility'yaml-1.1'
: The YAML 1.1 schemaIf using another (custom) schema, the customTags
array needs to
fully define the schema's tags.
Default: 'core'
for YAML 1.2, 'yaml-1.1'
for earlier versions
Optional
sortWhen adding to or stringifying a map, sort the entries.
If true
, sort by comparing key values with <
.
Does not affect item order when parsing.
Default: false
Optional
toOverride default values for toString()
options.
When parsing, warn about compatibility issues with the given schema. When stringifying, use scalar styles that are parsed correctly by the
compat
schema as well as the actual schema.Default:
null