SchemaOptions: {
    compat?: string | Tags | null;
    customTags?: Tags | ((tags) => Tags) | null;
    merge?: boolean;
    resolveKnownTags?: boolean;
    schema?: string | yaml.Schema;
    sortMapEntries?: boolean | ((a, b) => number);
    toStringDefaults?: ToStringOptions;

Type declaration

  • Optional compat?: string | Tags | null

    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

  • Optional customTags?: Tags | ((tags) => Tags) | null

    Array of additional tags to include in the schema, or a function that may modify the schema's base tag array.

  • Optional merge?: boolean

    Enable support for << merge keys.

    Default: false for YAML 1.2, true for earlier versions

  • Optional resolveKnownTags?: boolean

    When 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.Schema

    The 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 schema

    If 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 sortMapEntries?: boolean | ((a, b) => number)

    When 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 toStringDefaults?: ToStringOptions

    Override default values for toString() options.

Generated using TypeDoc