Class Anymap

A helper class for testing use cases where the value is of type any.

Hierarchy

  • Anymap

Constructors

Accessors

  • get dict(): Record<string, any[]>
  • Gets the elements of the anymap as a dictionary.

    Returns Record<string, any[]>

  • get entries(): [string, any][]
  • Gets all entries of the anymap as [key, value] tuples.

    Returns [string, any][]

Methods

  • Adds new elements to the anymap. If a key exists, adds the new value to the existing key.

    Returns

    The anymap with the added elements.

    Parameters

    • elements: Record<string, any[]>

      The elements to add.

    Returns Anymap

  • Combines two anymaps and returns the elements from the first that doesn't exists in the second.

    Returns

    The anymap with elements not in anymap.

    Parameters

    • anymap: Anymap

      The second anymap.

    Returns Anymap

  • Returns an anymap without the provided keys.

    Returns

    The anymap without the provided keys.

    Parameters

    • Rest ...keys: string[]

      The keys to exclude.

    Returns Anymap

  • Filters the anymap values that meet the condition specified in a callback function. Deletes the key if all values are filtered.

    Returns

    The filtered anymap.

    Parameters

    • predicate: ((value) => boolean)

      A function that accepts one argument.

        • (value): boolean
        • Parameters

          • value: any

          Returns boolean

    Returns Anymap

  • Returns an anymap with the provided keys.

    Returns

    The anymap with the provided keys.

    Parameters

    • Rest ...keys: string[]

      The keys to include.

    Returns Anymap

  • Combines two anymaps and returns the elements from the first that exists in the second.

    Returns

    The anymap with elements in anymap.

    Parameters

    • anymap: Anymap

      The second anymap.

    Returns Anymap

  • Combines two anymaps and returns the elements from both.

    Returns

    The anymap with elements from both.

    Parameters

    • anymap: Anymap

      The second anymap.

    Returns Anymap

Generated using TypeDoc