Class MultiKeyMap<K, V>

A convenience class for managing a "map of maps" of arbitrary depth

Type Parameters

  • K
  • V

Constructors

Properties

keyLength: number
rootMap: Map<any, any> = ...

Methods

  • Deletes the value with the given key from the map

    Parameters

    • key: readonly K[]

      the key to remove. It can have a length < the key length

    Returns boolean

    whether the key was present in the map

  • Parameters

    • handler: ((value, key) => void)
        • (value, key): void
        • Parameters

          • value: V
          • key: K[]

          Returns void

    • currentMap: Map<any, any>
    • keys: K[]

    Returns void

  • Iterates over all entries in the map. The ordering semantics are like iterating over a map of maps.

    Parameters

    • handler: ((value, key) => void)

      Handler for each entry

        • (value, key): void
        • Parameters

          • value: V
          • key: K[]

          Returns void

    Returns void

  • Checks whether the given key is present in the map

    Parameters

    • key: readonly K[]

      the key to test. It can have a length < the key length

    Returns boolean

    whether the key exists