default
constdefault:object
Defined in: src/js-yaml-compat.ts:325
Type Declaration
Section titled “Type Declaration”CORE_SCHEMA
Section titled “CORE_SCHEMA”CORE_SCHEMA:
Schema
Stub — see FAILSAFE_SCHEMA.
defineMappingTag
Section titled “defineMappingTag”defineMappingTag: (
tagName,_opts) =>TagDefinition
Stub mirroring js-yaml v5’s defineMappingTag. Nothing reads the result yet.
Parameters
Section titled “Parameters”tagName
Section titled “tagName”string
_opts?
Section titled “_opts?”Record<string, unknown> = {}
Returns
Section titled “Returns”defineScalarTag
Section titled “defineScalarTag”defineScalarTag: (
tagName,_opts) =>TagDefinition
Stub mirroring js-yaml v5’s defineScalarTag. Nothing reads the result yet.
Parameters
Section titled “Parameters”tagName
Section titled “tagName”string
_opts?
Section titled “_opts?”Record<string, unknown> = {}
Returns
Section titled “Returns”defineSequenceTag
Section titled “defineSequenceTag”defineSequenceTag: (
tagName,_opts) =>TagDefinition
Stub mirroring js-yaml v5’s defineSequenceTag. Nothing reads the result yet.
Parameters
Section titled “Parameters”tagName
Section titled “tagName”string
_opts?
Section titled “_opts?”Record<string, unknown> = {}
Returns
Section titled “Returns”dump: (
obj,_opts?) =>string
Delegates to our stringify.
Parameters
Section titled “Parameters”unknown
_opts?
Section titled “_opts?”Returns
Section titled “Returns”string
FAILSAFE_SCHEMA
Section titled “FAILSAFE_SCHEMA”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
Section titled “JSON_SCHEMA”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).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”unknown
loadAll
Section titled “loadAll”loadAll: (
input,iterator?,opts?) =>unknown[] |undefined
Parameters
Section titled “Parameters”string
iterator?
Section titled “iterator?”((doc) => void) | null
Returns
Section titled “Returns”unknown[] | undefined
Schema
Section titled “Schema”Schema: typeof
Schema
YAML11_SCHEMA
Section titled “YAML11_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
Section titled “YAMLException”YAMLException: typeof
YAMLException