Skip to content

default

const default: object

Defined in: src/js-yaml-compat.ts:325

CORE_SCHEMA: Schema

Stub — see FAILSAFE_SCHEMA.

defineMappingTag: (tagName, _opts) => TagDefinition

Stub mirroring js-yaml v5’s defineMappingTag. Nothing reads the result yet.

string

Record<string, unknown> = {}

TagDefinition

defineScalarTag: (tagName, _opts) => TagDefinition

Stub mirroring js-yaml v5’s defineScalarTag. Nothing reads the result yet.

string

Record<string, unknown> = {}

TagDefinition

defineSequenceTag: (tagName, _opts) => TagDefinition

Stub mirroring js-yaml v5’s defineSequenceTag. Nothing reads the result yet.

string

Record<string, unknown> = {}

TagDefinition

dump: (obj, _opts?) => string

Delegates to our stringify.

unknown

DumpOptions

string

FAILSAFE_SCHEMA: Schema

Stub so import { FAILSAFE_SCHEMA } still works. We always parse as YAML 1.2 core, so the schema you pass has no effect.

JSON_SCHEMA: Schema

Stub — see FAILSAFE_SCHEMA.

load: (input, opts?) => unknown

NOTE: js-yaml v4’s load("") (and a few other near-empty inputs) returned undefined, quirkily — e.g. load(" ") and load("\n") were undefined too, but load(" \n \n") and load("# comment\n") were null. js-yaml v5 changed this again: load("") now THROWS a YAMLException (“an empty stream has no document, and load has no output value to signal its absence” — per the v5 migration guide), rather than returning anything. We always return null for an empty document, matching our own parse()’s documented contract, in BOTH cases — reproducing either v4’s quirk or v5’s new throw isn’t worth it for a compat shim. Tracked as a known, low-impact divergence (see bench/conformance/compat.ts).

string

LoadOptions

unknown

loadAll: (input, iterator?, opts?) => unknown[] | undefined

string

((doc) => void) | null

LoadOptions

unknown[] | undefined

Schema: typeof Schema

YAML11_SCHEMA: Schema

Stub. Does NOT turn on YAML 1.1 typing — yes/no/on/off and sexagesimals stay plain values, because we always parse as YAML 1.2 core. See FAILSAFE_SCHEMA.

YAMLException: typeof YAMLException