lifecycle-utils
    Preparing search index...

    Class MultiKeyMap<Key, V>

    A utility class that works like a Map, but accepts multiple values as the key for each value.

    Type Parameters

    • const Key extends readonly any[]
    • const V
    Index

    Constructors

    Accessors

    • get size(): number

      Get the number of entries in the map.

      Returns number

    Methods

    • Delete the value for a given key.

      Time complexity: O(1), given that the length of the key is constant.

      Parameters

      Returns boolean

    • Call a function for each entry in the map.

      Parameters

      • callbackfn: (value: V, key: Key, map: this) => void
      • OptionalthisArg: any

      Returns void

    • Get a value for a given key.

      Time complexity: O(1), given that the length of the key is constant.

      Parameters

      Returns undefined | V

    • Check if a value exists for a given key.

      Time complexity: O(1), given that the length of the key is constant.

      Parameters

      Returns boolean

    • Add or update a value for a given key.

      Time complexity: O(1), given that the length of the key is constant.

      Parameters

      Returns this