Class XMapBase<K, V>Abstract

Type Parameters

  • K
  • V

Hierarchy (View Summary)

Constructors

Properties

Constructors

Properties

delete: (key: K) => void

Deletes a value at the given key in the XMap or XWeakMap.

get: (key: K) => undefined | V

Returns the value at the given key in the XMap or XWeakMap.

has: (key: K) => boolean

Returns true if the XMap or XWeakMap contains the given key.

prune: (sk: K, ...rest: unknown[]) => void

Deletes empty keys in the XMap or XWeakMap starting at the final nested path and checking the level above after deletion.

A key is considered empty if it's value is undefined or it's an empty Map, Set, Array, etc (anything with size or length property equal to 0).

set: (key: K, value: V) => void

Sets a value at the given key in the XMap or XWeakMap.

sGet: (key: K) => V

Like get except that if the key is not found in the map, then it will set and return a default value by calling getDefaultV passed to the constructor.