Skip to content

YamlMap

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:12

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.

  • Collection

K = unknown

V = unknown

new YamlMap<K, V>(schema?): YAMLMap<K, V>

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:22

YamlSchema

YAMLMap<K, V>

Collection.constructor

[NODE_TYPE]: symbol

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:8

Collection.[NODE_TYPE]


optional addToJSMap?: (ctx, map, value) => void

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:44

Customize the way that a key-value pair is resolved. Used for YAML 1.1 !!merge << handling.

YamlToJsContext | undefined

MapLike

unknown

void

Collection.addToJSMap


optional anchor?: string

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:11

An optional anchor on this node. Used by alias nodes.

Collection.anchor


optional comment?: string | null

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:24

A comment on or immediately after this

Collection.comment


optional commentBefore?: string | null

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:26

A comment before this

Collection.commentBefore


optional flow?: boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:16

If true, stringify this and all child nodes using flow rather than block styles.

Collection.flow


items: YamlPair<K, V>[]

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:21

Collection.items


optional range?: YamlRange | null

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:33

The [start, value-end, node-end] character offsets for the part of the source parsed into this node (undefined if not parsed). The value-end and node-end positions are themselves not included in their respective ranges.

Collection.range


schema: YamlSchema | undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:7

Collection.schema


optional spaceBefore?: boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:35

A blank line before this node and its commentBefore

Collection.spaceBefore


optional srcToken?: Token

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:37

The CST token that was composed into this node.

Collection.srcToken


optional tag?: string

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:39

A fully qualified tag, if required

Collection.tag

get static tagName(): "tag:yaml.org,2002:map"

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:20

"tag:yaml.org,2002:map"

add(pair, overwrite?): void

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:34

Adds a value to the collection.

YamlPair<K, V> | { key: K; value: V; }

boolean

If not set true, using a key that is already in the collection will throw. Otherwise, overwrites the previous value.

void

Collection.add


addIn(path, value): void

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:51

Adds a value to the collection. For !!map and !!omap the value must be a Pair instance or a { key, value } object, which may not have a key that already exists in the map.

Iterable<unknown>

unknown

void

Collection.addIn


clone(schema?): Collection

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:23

Create a copy of this collection.

YamlSchema

If defined, overwrites the original’s schema

Collection

Collection.clone


delete(key): boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:38

Removes a value from the collection.

unknown

boolean

true if the item was found and removed.

Collection.delete


deleteIn(path): boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:56

Removes a value from the collection.

Iterable<unknown>

boolean

true if the item was found and removed.

Collection.deleteIn


get(key, keepScalar): YamlScalar<V> | undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:39

Returns item at key, or undefined if not found. By default unwraps scalar values from their surrounding node; to disable set keepScalar to true (collections are always returned intact).

unknown

true

YamlScalar<V> | undefined

Collection.get

get(key, keepScalar?): V | undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:40

unknown

false

V | undefined

Collection.get

get(key, keepScalar?): V | YamlScalar<V> | undefined

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:41

unknown

boolean

V | YamlScalar<V> | undefined

Collection.get


getIn(path, keepScalar?): unknown

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:62

Returns item at key, or undefined if not found. By default unwraps scalar values from their surrounding node; to disable set keepScalar to true (collections are always returned intact).

Iterable<unknown>

boolean

unknown

Collection.getIn


has(key): boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:42

Checks if the collection includes a value with the key key.

unknown

boolean

Collection.has


hasAllNullValues(allowScalar?): boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:63

boolean

boolean

Collection.hasAllNullValues


hasIn(path): boolean

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:67

Checks if the collection includes a value with the key key.

Iterable<unknown>

boolean

Collection.hasIn


set(key, value): void

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:43

Sets a value in this collection. For !!set, value needs to be a boolean to add/remove the item from the set.

K

V

void

Collection.set


setIn(path, value): void

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Collection.d.ts:72

Sets a value in this collection. For !!set, value needs to be a boolean to add/remove the item from the set.

Iterable<unknown>

unknown

void

Collection.setIn


toJS(doc, __namedParameters?): any

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/Node.d.ts:52

A plain JavaScript representation of this node.

YamlDocument<YamlNode<unknown>, boolean>

ToJSOptions

any

Collection.toJS


toJSON<T>(_?, ctx?, Type?): any

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:49

T extends MapLike = Map<unknown, unknown>

unknown

YamlToJsContext

Conversion context, originally set in Document#toJS()

() => T

If set, forces the returned collection type

any

Instance of Type, Map, or Object

Collection.toJSON


toString(ctx?, onComment?, onChompKeep?): string

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:52

YamlStringifyContext

() => void

() => void

string

Collection.toString


static from(schema, obj, ctx): YAMLMap

Defined in: node_modules/.store/yaml-npm-2.9.1-d61da744fe/package/dist/nodes/YAMLMap.d.ts:27

A generic collection parsing method that can be extended to other node classes that inherit from YAMLMap

YamlSchema

unknown

YamlCreateNodeContext

YAMLMap