Type Parameters

  • K

  • V

Hierarchy

  • Map<K, V>
    • default

Constructors

  • Type Parameters

    • K

    • V

    Parameters

    • hash: ((key: K) => string)
        • (key: K): string
        • Parameters

          • key: K

          Returns string

    Returns default<K, V>

Methods

  • Returns void

  • Parameters

    • key: K

    Returns boolean

  • Parameters

    • key: K

    Returns undefined | V

  • If the given key is present in this map, returns the value associated with it. If the given key is not present, the defaultGenerator parameter is called and returned.

    Type Parameters

    • K2

    • V2

    Parameters

    • key: K2

      The key.

    • defaultGenerator: ((key: K2) => V2)

      A function which will return the value for this key if it is not present.

        • (key: K2): V2
        • Parameters

          • key: K2

          Returns V2

    Returns V2 extends never[] ? V extends any[] ? V : V extends V2 ? V : V | V2 : V extends V2 ? V : V | V2

  • If the given key is present in this map, returns the value associated with it. If the given key is not present, the defaultGenerator parameter is called and returned.

    Type Parameters

    • K2

    Parameters

    • key: K2

      The key.

    • defaultGenerator: ((key: K2) => V)

      A function which will return the value for this key if it is not present.

        • (key: K2): V
        • Parameters

          • key: K2

          Returns V

    • assign: true

      Whether the generated default will be stored in the map.

    Returns V

  • Parameters

    • key: K

    Returns boolean

  • Retains the entries from this map that match the given predicate function, any other entries will be deleted.

    Returns

    whether any entries remain.

    Parameters

    • predicate: ((val: V, key: K) => any)

      A predicate that takes a key and a value, and returns a value which will be checked for truthiness.

        • (val: V, key: K): any
        • Parameters

          • val: V
          • key: K

          Returns any

    Returns boolean

  • If this map contains the given key, checks whether the entry matches the given predicate. If it does, it is kept. If not, it's deleted.

    Returns

    whether any entries remain in this map.

    Parameters

    • key: K
    • predicate: ((val: V, key: K) => any)

      A predicate that takes a key and a value, and returns a value which will be checked for truthiness.

        • (val: V, key: K): any
        • Parameters

          • val: V
          • key: K

          Returns any

    Returns boolean

  • Parameters

    • key: K
    • value: V

    Returns default<K, V>

Generated using TypeDoc