Class HashMap<TKey, TVal>

A Map implementation that maps the Key object to a string using the provided hash function. This ensures that equal objects that are not the same instance are mapped to the same value.

Type Parameters

  • TKey = any

  • TVal = any

Hierarchy

Implements

  • Map<TKey, TVal>

Constructors

  • Type Parameters

    • TKey = any

    • TVal = any

    Parameters

    • hashFn: ((key) => string)
        • (key): string
        • Parameters

          • key: TKey

          Returns string

    • Optional iterable: Iterable<readonly [TKey, TVal]>

    Returns HashMap<TKey, TVal>

Properties

[toStringTag]: "HashMap" = 'HashMap'
hashFn: ((key) => string)

Type declaration

    • (key): string
    • Parameters

      • key: TKey

      Returns string

hashMap: Map<string, Entry<TKey, TVal>>

Accessors

Methods

  • Returns IterableIterator<[TKey, TVal]>

  • Returns IterableIterator<[TKey, TVal]>

  • Parameters

    • callbackfn: ((value, key, map) => void)
        • (value, key, map): void
        • Parameters

          • value: TVal
          • key: TKey
          • map: Map<TKey, TVal>

          Returns void

    • Optional thisArg: any

    Returns void

  • Parameters

    • key: TKey

    Returns undefined | TVal

  • Returns IterableIterator<TVal>